Greg Hurrell [Wed, 30 Mar 2016 06:59:16 +0000 (23:59 -0700)]
Italicize all the things
Comments are usually italics, so these should be too.
Note that I can't actually ship this as it depends on
`functions#italicize_group`, which is only defined in my dot files, but
I will eventually extract that too into a separate plug-in so that I can
re-use it here too.
For the same reason that @mappings is useful, we want a way to
supplement the auto-generated COMMANDS, FUNCTIONS and OPTIONS sections
with arbitrary additional info.
For now this info will get appended to the section, but in the future I
might look at providing nested @header and @footer annotations to allow
you to force it to one location of the other; eg:
@commands
@header
Stuff that gets prepended to the COMMANDS section.
Allow docvim blocks to appear inside function bodies
For example, I just had a case where I had an option defined/used inside
a function:
function s:foo()
""
" @option g:SomeOption boolean 1
"
" This option does some thing.
let l:dispatch=get(g:, 'SomeOption', 1)
" [code that uses the option here...]
endfunction
Note that @option is a bit different from @mapping and @command. The
latter generally will have one authoritative place where they are
defined and where their documentation can logically/obviously go. An
@option on the other hand, may be used in multiple places.
So it may make sense to either just document these elsewhere (like up in
the @plugin area), or get into the habit of making a centralized place
where option default values are defined, so that they can be documented
independently of their usage sites.
This is the work-in-progresss syntax highlighting for the
not-yet-released "docvim" syntax (this will be a tool that I'll release
for embedding extractable documentation inline inside Vim plugins).