]>
git.wincent.com - docvim.git/log
Greg Hurrell [Tue, 7 Jun 2016 07:38:03 +0000 (00:38 -0700)]
Teach Markdown printer about @mapping and @command
Greg Hurrell [Tue, 7 Jun 2016 07:28:20 +0000 (00:28 -0700)]
Add @mapping support to Vim printer
Greg Hurrell [Tue, 7 Jun 2016 07:16:46 +0000 (00:16 -0700)]
Get @command annotation working
Greg Hurrell [Tue, 7 Jun 2016 02:04:40 +0000 (19:04 -0700)]
Make wrapping aware of concealed characters
This is the cheap-but-approximate approach. Results are reasonable, costs are
very low, and the consequences of being (slightly) wrong are livable. Let's go
with this for now.
Greg Hurrell [Mon, 6 Jun 2016 15:57:19 +0000 (08:57 -0700)]
Kill a stray comment
Greg Hurrell [Mon, 6 Jun 2016 15:48:07 +0000 (08:48 -0700)]
Use worktree as issue tracker
Taking standards to new lows.
Greg Hurrell [Mon, 6 Jun 2016 15:47:16 +0000 (08:47 -0700)]
Fix misplaced whitespace in output
Greg Hurrell [Mon, 6 Jun 2016 15:41:05 +0000 (08:41 -0700)]
Add test showing @option output
Something buggy in the parser: note that we have to explicitly say "none" for
the no-default case, but I intended that to be simply omittable.
Greg Hurrell [Mon, 6 Jun 2016 15:31:14 +0000 (08:31 -0700)]
Print options
Alignment will need a bit of work here, but this is a good first draft.
Specifically, if we want things to look like this in the UI:
g:SomeOpt
g:SomeOpt string (default: 10)
The output will actually need to be:
*g:SomeOpt*
|g:SomeOpt| string (default: 10)
Because `|` and `*` don't take up any width due to being concealed by Vim.
Greg Hurrell [Mon, 6 Jun 2016 14:46:18 +0000 (07:46 -0700)]
Fix lints
Greg Hurrell [Mon, 6 Jun 2016 14:38:46 +0000 (07:38 -0700)]
Use actual max int rather than hard-coded constant
Greg Hurrell [Mon, 6 Jun 2016 14:36:52 +0000 (07:36 -0700)]
Handle overlength headings
#uglycode
Greg Hurrell [Mon, 6 Jun 2016 14:17:10 +0000 (07:17 -0700)]
Fix duplicate content
Greg Hurrell [Mon, 6 Jun 2016 13:55:27 +0000 (06:55 -0700)]
Initial cut at @mapping, @command, @option, @function
Still some bugs to sort out (eg. duplicate symbol table entry due to extra
`MappingsAnnotation` when we perform extraction) and polish to apply (not
actually printing the options/functions etc).
Greg Hurrell [Mon, 6 Jun 2016 08:03:58 +0000 (01:03 -0700)]
Make Vim headings work by colocating link targets on same line
Greg Hurrell [Mon, 6 Jun 2016 06:53:25 +0000 (23:53 -0700)]
Add entries to symbol table for generated headings
Greg Hurrell [Mon, 6 Jun 2016 06:38:46 +0000 (23:38 -0700)]
Autogen headings in Vim printer too
Greg Hurrell [Mon, 6 Jun 2016 06:19:08 +0000 (23:19 -0700)]
Add auto-generated headings to Markdown printer
For @functions, @commands, @mappings, @options.
Greg Hurrell [Mon, 6 Jun 2016 05:14:09 +0000 (22:14 -0700)]
Add basic support for @options, @functions and @commands annotations
Still need to auto-emit headings for these, but I think they basically work.
Also need to make `Option`, `Function` and `Command` visitors.
Greg Hurrell [Sun, 5 Jun 2016 14:06:32 +0000 (07:06 -0700)]
Overhaul testing and compilation
We now "compile" in the test suite, meaning that we pipe our translation units
through the various extraction transforms after parsing. This means three main
things:
- Everything is nested inside a `Project` node type now, consisting of one or
more translation units.
- Nodes within the project are ordered (or reordered) to maintain desired
section ordering.
- As we add more phases to "compilation" (eg. automated insertion of table
of contents etc), these will get reflected in the test suite automatically.
As part of this, extracted test-specific bits out into a new `Util` module (ie.
pretty-printing methods, convenience functions) and the "compile" pipeline into
a `Compile` module.
Greg Hurrell [Sun, 5 Jun 2016 08:46:09 +0000 (01:46 -0700)]
Add a missing type annotation
Greg Hurrell [Sun, 5 Jun 2016 08:44:47 +0000 (01:44 -0700)]
Don't rely on transformers
Don't want two monad transformer libraries at play here
needlessly.
Greg Hurrell [Sun, 5 Jun 2016 08:40:24 +0000 (01:40 -0700)]
Kill off an out-of-date comment
Greg Hurrell [Sun, 5 Jun 2016 08:40:07 +0000 (01:40 -0700)]
Fix copy pasta error
Suprised neither the compiler nor the tests seemed to
complain about this.
Greg Hurrell [Sun, 5 Jun 2016 08:35:55 +0000 (01:35 -0700)]
DRY up other visitors
Greg Hurrell [Sun, 5 Jun 2016 08:22:31 +0000 (01:22 -0700)]
More simplification
Greg Hurrell [Sun, 5 Jun 2016 08:15:18 +0000 (01:15 -0700)]
Trim down imports
Greg Hurrell [Sun, 5 Jun 2016 08:03:07 +0000 (01:03 -0700)]
More DRYing
Greg Hurrell [Sun, 5 Jun 2016 07:57:30 +0000 (00:57 -0700)]
Further visitor DRYing
Greg Hurrell [Sun, 5 Jun 2016 07:43:06 +0000 (00:43 -0700)]
Tidy indentation
Greg Hurrell [Sun, 5 Jun 2016 07:37:04 +0000 (00:37 -0700)]
Fix lints
Greg Hurrell [Sun, 5 Jun 2016 07:30:29 +0000 (00:30 -0700)]
Extract Visitor module
First step in factoring out some of the duplication here.
Greg Hurrell [Sun, 5 Jun 2016 06:23:47 +0000 (23:23 -0700)]
Remove some old comments
Greg Hurrell [Sun, 5 Jun 2016 06:23:31 +0000 (23:23 -0700)]
Fix indentation
Greg Hurrell [Sun, 5 Jun 2016 06:12:13 +0000 (23:12 -0700)]
Suppress unwanted trailing whitespace
Greg Hurrell [Sun, 5 Jun 2016 05:03:05 +0000 (22:03 -0700)]
Further refine hard-wrapping
Greg Hurrell [Sun, 5 Jun 2016 04:26:53 +0000 (21:26 -0700)]
Be better about hard-wrap placement
Still needs a refactor, but the output is better.
Greg Hurrell [Sun, 5 Jun 2016 03:39:46 +0000 (20:39 -0700)]
Rename `hardwrap` -> `textwidth`
Because I want to use the name `hardwrap` for a function as part of some
imminent refactoring.
Greg Hurrell [Sun, 5 Jun 2016 03:37:14 +0000 (20:37 -0700)]
Align
Greg Hurrell [Sun, 5 Jun 2016 03:35:11 +0000 (20:35 -0700)]
Always link unconditionally in Vim help output
May not even need the symbol table at all in this printer, but we'll keep it
around for now, just in case.
Greg Hurrell [Sun, 5 Jun 2016 03:32:40 +0000 (20:32 -0700)]
Replace a literal that I missed with a constant
Greg Hurrell [Sat, 4 Jun 2016 22:01:56 +0000 (15:01 -0700)]
Move hardwrapping from `plaintext` into `append`
Solves a bunch of issues, creates others, which I will have to fix in a
follow-up. The code itself is a complex, fragile, ugly, clusterfuck, so consider
this a work-in-progress.
Additionally, there are some unfortunate breaks which were there before and
continue to be there, like just inside parens, and things like that. Will need
to sort all that out too.
Greg Hurrell [Sat, 4 Jun 2016 20:36:54 +0000 (13:36 -0700)]
Tidy
Greg Hurrell [Sat, 4 Jun 2016 20:35:40 +0000 (13:35 -0700)]
Get rid of meaningless distinction in Markdown printer
All the cases must return Env, so let's put them all together
whether or not they explicitly access the state.
Greg Hurrell [Sat, 4 Jun 2016 14:20:49 +0000 (07:20 -0700)]
Share integration tests inputs across output types
May eventually share other things too (I still have some
manual symlinks going on), but this is a good start.
Greg Hurrell [Sat, 4 Jun 2016 14:01:40 +0000 (07:01 -0700)]
Make slurping a little more robust
But note remaining caveat inline. This really
should only be used to trim whitespace, at least
for now.
Greg Hurrell [Sat, 4 Jun 2016 13:52:46 +0000 (06:52 -0700)]
Remove unwanted blank lines before fenced code blocks
But note that this is a little bit fragile, even though
the tests pass. More work can be done to make this more
robust.
Greg Hurrell [Sat, 4 Jun 2016 07:00:06 +0000 (00:00 -0700)]
Fix some lints
Greg Hurrell [Sat, 4 Jun 2016 06:57:40 +0000 (23:57 -0700)]
Reorder things
Greg Hurrell [Sat, 4 Jun 2016 04:20:39 +0000 (21:20 -0700)]
Eliminate unwanted trailing whitespace
Greg Hurrell [Sat, 4 Jun 2016 02:17:40 +0000 (19:17 -0700)]
Initial primitive cut at hard wrapping
This isn't ideal as noted inline (no rollback yet, which means we wind up with
trailing whitespace), but it is a reasonable start.
Greg Hurrell [Sat, 4 Jun 2016 02:09:32 +0000 (19:09 -0700)]
Remove last use of Append
Greg Hurrell [Thu, 2 Jun 2016 14:24:06 +0000 (07:24 -0700)]
Convert one more `Append`
Greg Hurrell [Thu, 2 Jun 2016 14:18:28 +0000 (07:18 -0700)]
Continue `Append` -> `append` conversion
Greg Hurrell [Thu, 2 Jun 2016 14:01:04 +0000 (07:01 -0700)]
Update `fenced` to use `append`
I wanted to write this using `>>=` but evidently that is not the right tool.
Greg Hurrell [Thu, 2 Jun 2016 07:43:14 +0000 (00:43 -0700)]
Inline `return` call inside `fenced` function
Step 1 of ?.
Greg Hurrell [Thu, 2 Jun 2016 07:41:17 +0000 (00:41 -0700)]
Drop excess blank lines after fenced code blocks in Vim output
Greg Hurrell [Thu, 2 Jun 2016 07:20:19 +0000 (00:20 -0700)]
Create append helper and start using it
Greg Hurrell [Thu, 2 Jun 2016 02:19:09 +0000 (19:19 -0700)]
Feel the linter love
Greg Hurrell [Thu, 2 Jun 2016 02:12:27 +0000 (19:12 -0700)]
Get some TODOs out of the work tree
Horrible hygiene I know, but I need to compensate the functional purity somehow.
Greg Hurrell [Wed, 1 Jun 2016 17:37:28 +0000 (10:37 -0700)]
Add partial line to Vim printer context
This will be used to perform current line width calculations, so that we can
decide whether or not to hard-wrap.
Greg Hurrell [Wed, 1 Jun 2016 17:27:28 +0000 (10:27 -0700)]
Use operations list in Vim printer
Let's see if I can use this to implement hard-wrapping. It is very ugly, but if
I can get it working I'll have some tests in place and can then try refactoring.
Greg Hurrell [Wed, 1 Jun 2016 08:07:58 +0000 (01:07 -0700)]
Deal with linebreaks inside list items
Greg Hurrell [Wed, 1 Jun 2016 07:55:06 +0000 (00:55 -0700)]
Fix unwanted stripping of leading whitespace
Stripping trailing whitespace is desired, but the leading
strip was actually busting the output.
Greg Hurrell [Wed, 1 Jun 2016 07:49:28 +0000 (00:49 -0700)]
Fix excess line at break tags in blockquotes
Greg Hurrell [Wed, 1 Jun 2016 07:39:05 +0000 (00:39 -0700)]
Add some tests
Revealing some still-unresolved issues to be fixed.
Greg Hurrell [Wed, 1 Jun 2016 07:33:46 +0000 (00:33 -0700)]
Show how linebreaks can be contextual
Greg Hurrell [Wed, 1 Jun 2016 07:23:16 +0000 (00:23 -0700)]
Further flesh out README
Greg Hurrell [Wed, 1 Jun 2016 02:12:35 +0000 (19:12 -0700)]
Even sillier example of putting monadic state
Greg Hurrell [Wed, 1 Jun 2016 02:07:20 +0000 (19:07 -0700)]
Silly demonstration of getting at monadic state
Doesn't affect the output, but proves that I can `get` the state.
Greg Hurrell [Tue, 31 May 2016 14:47:02 +0000 (07:47 -0700)]
Use State + Reader monad transformer stack
Doesn't do anything useful yet, but it will: I want to use this to track current
line width, for the purposes of wrapping. As noted here:
https://ro-che.info/articles/2012-01-02-composing-monads
The order in which I compose the State and Reader monad transformers shouldn't
matter at all. If I end up needing Writer too, I will be able to replace this
with the RWS monad transformer.
Greg Hurrell [Tue, 31 May 2016 14:29:18 +0000 (07:29 -0700)]
Add some fixture files that I previously forgot to include
Greg Hurrell [Tue, 31 May 2016 14:27:34 +0000 (07:27 -0700)]
Fix indentation
Greg Hurrell [Tue, 31 May 2016 14:21:34 +0000 (07:21 -0700)]
Rename `State` to `Metadata`
State was a terrible name to use in conjunction with the Reader monad, as it
easily leads to confusion with the State monad. Let's just call it `Metadata`
(about the project AST) for now; that's a horribly generic name too, but it is
at least an improvement.
Greg Hurrell [Tue, 31 May 2016 14:14:44 +0000 (07:14 -0700)]
Update .tmux paths for Vim 8-pre
Greg Hurrell [Tue, 31 May 2016 14:13:21 +0000 (07:13 -0700)]
Fix lint
Greg Hurrell [Tue, 31 May 2016 14:12:21 +0000 (07:12 -0700)]
Upgrade README
Greg Hurrell [Tue, 31 May 2016 07:38:57 +0000 (00:38 -0700)]
Hook up plugin and footer extraction
Obviously the horrible `ast2` binding name will have to go away, but this works.
Greg Hurrell [Tue, 31 May 2016 07:36:24 +0000 (00:36 -0700)]
Extract footers and plugin sections
Greg Hurrell [Tue, 31 May 2016 06:56:10 +0000 (23:56 -0700)]
Fix trailing whitespace at end of file
Greg Hurrell [Tue, 31 May 2016 06:50:29 +0000 (23:50 -0700)]
Actually write output files
Greg Hurrell [Tue, 31 May 2016 05:55:00 +0000 (22:55 -0700)]
Simplify some case statements with the LambdaCase extension
Via:
https://www.schoolofhaskell.com/school/to-infinity-and-beyond/pick-of-the-week/guide-to-ghc-extensions/basic-syntax-extensions
Greg Hurrell [Tue, 31 May 2016 05:44:51 +0000 (22:44 -0700)]
Use MultiWayIf extension to make a nested `if` less ugly
Still pretty ugly though...
Via:
https://www.schoolofhaskell.com/school/to-infinity-and-beyond/pick-of-the-week/guide-to-ghc-extensions/basic-syntax-extensions
Greg Hurrell [Tue, 31 May 2016 05:37:48 +0000 (22:37 -0700)]
Sort link targets for Markdown output too
Greg Hurrell [Tue, 31 May 2016 05:36:20 +0000 (22:36 -0700)]
Sort link targets
Greg Hurrell [Tue, 31 May 2016 05:34:38 +0000 (22:34 -0700)]
Right-align link targets
Greg Hurrell [Mon, 30 May 2016 14:36:25 +0000 (07:36 -0700)]
Start prepping to hangle hard-wrapping
This is going to be ugly...
Greg Hurrell [Mon, 30 May 2016 14:28:32 +0000 (07:28 -0700)]
Fix @plugin printing in Vim printer
Greg Hurrell [Mon, 30 May 2016 14:09:42 +0000 (07:09 -0700)]
Make Vim printer more useful
Still a work-in-progress, but it is close to what we want now.
Greg Hurrell [Mon, 30 May 2016 07:06:41 +0000 (00:06 -0700)]
Fix some lints
Greg Hurrell [Mon, 30 May 2016 07:00:51 +0000 (00:00 -0700)]
Fix test breakage caused by missing modules
Greg Hurrell [Mon, 30 May 2016 06:57:26 +0000 (23:57 -0700)]
Add Mappings visitor
Greg Hurrell [Mon, 30 May 2016 06:51:10 +0000 (23:51 -0700)]
Add extract function to Plugin visitor
Lots of duplication/similarity with the Footer visitor, but I want to do this a
few times before I dry to identify and abstract away the pattern.
Greg Hurrell [Sun, 29 May 2016 23:13:37 +0000 (16:13 -0700)]
Trim down footer extraction to its "final" form
Want the external interface provided by "extract" to
be simple, so we wrap the `runWriter` call and return
a List instead of a DList.
Greg Hurrell [Sun, 29 May 2016 14:27:55 +0000 (07:27 -0700)]
Add some notes about footer extraction
Likely going to settle on postorder uniplate technique
at which point I will remove some of the extraneous
exports and simplify.
Greg Hurrell [Sat, 28 May 2016 14:02:34 +0000 (07:02 -0700)]
Teach CLI to operate on target arguments
Still not writing to filesystem, but will add that in a bit.
For now, just debugging everything over standard out is
super convenient.
Obviously, this code is super ugly with that staggered `if`
statement, so will refactor.
Greg Hurrell [Sat, 28 May 2016 06:37:04 +0000 (23:37 -0700)]
Make CLI tool print markdown
Apologies for the shitty commit with a bunch of very stale lingering worktree
changes just thrown in there for no good reason.
Greg Hurrell [Thu, 7 Apr 2016 14:39:39 +0000 (07:39 -0700)]
Include a couple of examples of alternatives to `walk`
Greg Hurrell [Thu, 7 Apr 2016 06:57:54 +0000 (23:57 -0700)]
Fix lints
Greg Hurrell [Thu, 7 Apr 2016 06:56:24 +0000 (23:56 -0700)]
Remove explicit Plated instance
Thought I would need it based on reading:
https://hackage.haskell.org/package/lens-4.13.2.1/docs/Control-Lens-Plated.html
but it seems that I do not.