]> git.wincent.com - docvim.git/log
docvim.git
7 years agoTeach Markdown printer about @mapping and @command
Greg Hurrell [Tue, 7 Jun 2016 07:38:03 +0000 (00:38 -0700)] 
Teach Markdown printer about @mapping and @command

7 years agoAdd @mapping support to Vim printer
Greg Hurrell [Tue, 7 Jun 2016 07:28:20 +0000 (00:28 -0700)] 
Add @mapping support to Vim printer

7 years agoGet @command annotation working
Greg Hurrell [Tue, 7 Jun 2016 07:16:46 +0000 (00:16 -0700)] 
Get @command annotation working

7 years agoMake wrapping aware of concealed characters
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.

7 years agoKill a stray comment
Greg Hurrell [Mon, 6 Jun 2016 15:57:19 +0000 (08:57 -0700)] 
Kill a stray comment

7 years agoUse worktree as issue tracker
Greg Hurrell [Mon, 6 Jun 2016 15:48:07 +0000 (08:48 -0700)] 
Use worktree as issue tracker

Taking standards to new lows.

7 years agoFix misplaced whitespace in output
Greg Hurrell [Mon, 6 Jun 2016 15:47:16 +0000 (08:47 -0700)] 
Fix misplaced whitespace in output

7 years agoAdd test showing @option 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.

7 years agoPrint options
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.

7 years agoFix lints
Greg Hurrell [Mon, 6 Jun 2016 14:46:18 +0000 (07:46 -0700)] 
Fix lints

7 years agoUse actual max int rather than hard-coded constant
Greg Hurrell [Mon, 6 Jun 2016 14:38:46 +0000 (07:38 -0700)] 
Use actual max int rather than hard-coded constant

7 years agoHandle overlength headings
Greg Hurrell [Mon, 6 Jun 2016 14:36:52 +0000 (07:36 -0700)] 
Handle overlength headings

#uglycode

7 years agoFix duplicate content
Greg Hurrell [Mon, 6 Jun 2016 14:17:10 +0000 (07:17 -0700)] 
Fix duplicate content

7 years agoInitial cut at @mapping, @command, @option, @function
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).

7 years agoMake Vim headings work by colocating link targets on same line
Greg Hurrell [Mon, 6 Jun 2016 08:03:58 +0000 (01:03 -0700)] 
Make Vim headings work by colocating link targets on same line

7 years agoAdd entries to symbol table for generated headings
Greg Hurrell [Mon, 6 Jun 2016 06:53:25 +0000 (23:53 -0700)] 
Add entries to symbol table for generated headings

7 years agoAutogen headings in Vim printer too
Greg Hurrell [Mon, 6 Jun 2016 06:38:46 +0000 (23:38 -0700)] 
Autogen headings in Vim printer too

7 years agoAdd auto-generated headings to Markdown printer
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.

7 years agoAdd basic support for @options, @functions and @commands annotations
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.

7 years agoOverhaul testing and compilation
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.

7 years agoAdd a missing type annotation
Greg Hurrell [Sun, 5 Jun 2016 08:46:09 +0000 (01:46 -0700)] 
Add a missing type annotation

7 years agoDon't rely on transformers
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.

7 years agoKill off an out-of-date comment
Greg Hurrell [Sun, 5 Jun 2016 08:40:24 +0000 (01:40 -0700)] 
Kill off an out-of-date comment

7 years agoFix copy pasta error
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.

7 years agoDRY up other visitors
Greg Hurrell [Sun, 5 Jun 2016 08:35:55 +0000 (01:35 -0700)] 
DRY up other visitors

7 years agoMore simplification
Greg Hurrell [Sun, 5 Jun 2016 08:22:31 +0000 (01:22 -0700)] 
More simplification

7 years agoTrim down imports
Greg Hurrell [Sun, 5 Jun 2016 08:15:18 +0000 (01:15 -0700)] 
Trim down imports

7 years agoMore DRYing
Greg Hurrell [Sun, 5 Jun 2016 08:03:07 +0000 (01:03 -0700)] 
More DRYing

7 years agoFurther visitor DRYing
Greg Hurrell [Sun, 5 Jun 2016 07:57:30 +0000 (00:57 -0700)] 
Further visitor DRYing

7 years agoTidy indentation
Greg Hurrell [Sun, 5 Jun 2016 07:43:06 +0000 (00:43 -0700)] 
Tidy indentation

7 years agoFix lints
Greg Hurrell [Sun, 5 Jun 2016 07:37:04 +0000 (00:37 -0700)] 
Fix lints

7 years agoExtract Visitor module
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.

7 years agoRemove some old comments
Greg Hurrell [Sun, 5 Jun 2016 06:23:47 +0000 (23:23 -0700)] 
Remove some old comments

7 years agoFix indentation
Greg Hurrell [Sun, 5 Jun 2016 06:23:31 +0000 (23:23 -0700)] 
Fix indentation

7 years agoSuppress unwanted trailing whitespace
Greg Hurrell [Sun, 5 Jun 2016 06:12:13 +0000 (23:12 -0700)] 
Suppress unwanted trailing whitespace

7 years agoFurther refine hard-wrapping
Greg Hurrell [Sun, 5 Jun 2016 05:03:05 +0000 (22:03 -0700)] 
Further refine hard-wrapping

7 years agoBe better about hard-wrap placement
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.

7 years agoRename `hardwrap` -> `textwidth`
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.

7 years agoAlign
Greg Hurrell [Sun, 5 Jun 2016 03:37:14 +0000 (20:37 -0700)] 
Align

7 years agoAlways link unconditionally in Vim help output
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.

7 years agoReplace a literal that I missed with a constant
Greg Hurrell [Sun, 5 Jun 2016 03:32:40 +0000 (20:32 -0700)] 
Replace a literal that I missed with a constant

7 years agoMove hardwrapping from `plaintext` into `append`
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.

7 years agoTidy
Greg Hurrell [Sat, 4 Jun 2016 20:36:54 +0000 (13:36 -0700)] 
Tidy

7 years agoGet rid of meaningless distinction in Markdown printer
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.

7 years agoShare integration tests inputs across output types
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.

7 years agoMake slurping a little more robust
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.

7 years agoRemove unwanted blank lines before fenced code blocks
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.

7 years agoFix some lints
Greg Hurrell [Sat, 4 Jun 2016 07:00:06 +0000 (00:00 -0700)] 
Fix some lints

7 years agoReorder things
Greg Hurrell [Sat, 4 Jun 2016 06:57:40 +0000 (23:57 -0700)] 
Reorder things

7 years agoEliminate unwanted trailing whitespace
Greg Hurrell [Sat, 4 Jun 2016 04:20:39 +0000 (21:20 -0700)] 
Eliminate unwanted trailing whitespace

7 years agoInitial primitive cut at hard wrapping
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.

7 years agoRemove last use of Append
Greg Hurrell [Sat, 4 Jun 2016 02:09:32 +0000 (19:09 -0700)] 
Remove last use of Append

7 years agoConvert one more `Append`
Greg Hurrell [Thu, 2 Jun 2016 14:24:06 +0000 (07:24 -0700)] 
Convert one more `Append`

7 years agoContinue `Append` -> `append` conversion
Greg Hurrell [Thu, 2 Jun 2016 14:18:28 +0000 (07:18 -0700)] 
Continue `Append` -> `append` conversion

7 years agoUpdate `fenced` to use `append`
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.

7 years agoInline `return` call inside `fenced` function
Greg Hurrell [Thu, 2 Jun 2016 07:43:14 +0000 (00:43 -0700)] 
Inline `return` call inside `fenced` function

Step 1 of ?.

7 years agoDrop excess blank lines after fenced code blocks in Vim output
Greg Hurrell [Thu, 2 Jun 2016 07:41:17 +0000 (00:41 -0700)] 
Drop excess blank lines after fenced code blocks in Vim output

7 years agoCreate append helper and start using it
Greg Hurrell [Thu, 2 Jun 2016 07:20:19 +0000 (00:20 -0700)] 
Create append helper and start using it

7 years agoFeel the linter love
Greg Hurrell [Thu, 2 Jun 2016 02:19:09 +0000 (19:19 -0700)] 
Feel the linter love

7 years agoGet some TODOs out of the work tree
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.

7 years agoAdd partial line to Vim printer context
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.

7 years agoUse operations list in Vim printer
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.

7 years agoDeal with linebreaks inside list items
Greg Hurrell [Wed, 1 Jun 2016 08:07:58 +0000 (01:07 -0700)] 
Deal with linebreaks inside list items

7 years agoFix unwanted stripping of leading whitespace
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.

7 years agoFix excess line at break tags in blockquotes
Greg Hurrell [Wed, 1 Jun 2016 07:49:28 +0000 (00:49 -0700)] 
Fix excess line at break tags in blockquotes

7 years agoAdd some tests
Greg Hurrell [Wed, 1 Jun 2016 07:39:05 +0000 (00:39 -0700)] 
Add some tests

Revealing some still-unresolved issues to be fixed.

7 years agoShow how linebreaks can be contextual
Greg Hurrell [Wed, 1 Jun 2016 07:33:46 +0000 (00:33 -0700)] 
Show how linebreaks can be contextual

7 years agoFurther flesh out README
Greg Hurrell [Wed, 1 Jun 2016 07:23:16 +0000 (00:23 -0700)] 
Further flesh out README

7 years agoEven sillier example of putting monadic state
Greg Hurrell [Wed, 1 Jun 2016 02:12:35 +0000 (19:12 -0700)] 
Even sillier example of putting monadic state

7 years agoSilly demonstration of getting at 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.

7 years agoUse State + Reader monad transformer stack
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.

7 years agoAdd some fixture files that I previously forgot to include
Greg Hurrell [Tue, 31 May 2016 14:29:18 +0000 (07:29 -0700)] 
Add some fixture files that I previously forgot to include

7 years agoFix indentation
Greg Hurrell [Tue, 31 May 2016 14:27:34 +0000 (07:27 -0700)] 
Fix indentation

7 years agoRename `State` to `Metadata`
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.

7 years agoUpdate .tmux paths for Vim 8-pre
Greg Hurrell [Tue, 31 May 2016 14:14:44 +0000 (07:14 -0700)] 
Update .tmux paths for Vim 8-pre

7 years agoFix lint
Greg Hurrell [Tue, 31 May 2016 14:13:21 +0000 (07:13 -0700)] 
Fix lint

7 years agoUpgrade README
Greg Hurrell [Tue, 31 May 2016 14:12:21 +0000 (07:12 -0700)] 
Upgrade README

7 years agoHook up plugin and footer extraction
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.

7 years agoExtract footers and plugin sections
Greg Hurrell [Tue, 31 May 2016 07:36:24 +0000 (00:36 -0700)] 
Extract footers and plugin sections

7 years agoFix trailing whitespace at end of file
Greg Hurrell [Tue, 31 May 2016 06:56:10 +0000 (23:56 -0700)] 
Fix trailing whitespace at end of file

7 years agoActually write output files
Greg Hurrell [Tue, 31 May 2016 06:50:29 +0000 (23:50 -0700)] 
Actually write output files

7 years agoSimplify some case statements with the LambdaCase extension
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

7 years agoUse MultiWayIf extension to make a nested `if` less ugly
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

7 years agoSort link targets for Markdown output too
Greg Hurrell [Tue, 31 May 2016 05:37:48 +0000 (22:37 -0700)] 
Sort link targets for Markdown output too

7 years agoSort link targets
Greg Hurrell [Tue, 31 May 2016 05:36:20 +0000 (22:36 -0700)] 
Sort link targets

7 years agoRight-align link targets
Greg Hurrell [Tue, 31 May 2016 05:34:38 +0000 (22:34 -0700)] 
Right-align link targets

7 years agoStart prepping to hangle hard-wrapping
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...

7 years agoFix @plugin printing in Vim printer
Greg Hurrell [Mon, 30 May 2016 14:28:32 +0000 (07:28 -0700)] 
Fix @plugin printing in Vim printer

7 years agoMake Vim printer more useful
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.

7 years agoFix some lints
Greg Hurrell [Mon, 30 May 2016 07:06:41 +0000 (00:06 -0700)] 
Fix some lints

7 years agoFix test breakage caused by missing modules
Greg Hurrell [Mon, 30 May 2016 07:00:51 +0000 (00:00 -0700)] 
Fix test breakage caused by missing modules

7 years agoAdd Mappings visitor
Greg Hurrell [Mon, 30 May 2016 06:57:26 +0000 (23:57 -0700)] 
Add Mappings visitor

7 years agoAdd extract function to Plugin 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.

7 years agoTrim down footer extraction to its "final" form
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.

7 years agoAdd some notes about footer extraction
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.

7 years agoTeach CLI to operate on target arguments
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.

7 years agoMake CLI tool print markdown
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.

7 years agoInclude a couple of examples of alternatives to `walk`
Greg Hurrell [Thu, 7 Apr 2016 14:39:39 +0000 (07:39 -0700)] 
Include a couple of examples of alternatives to `walk`

7 years agoFix lints
Greg Hurrell [Thu, 7 Apr 2016 06:57:54 +0000 (23:57 -0700)] 
Fix lints

7 years agoRemove explicit Plated instance
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.