Antora "watch mode" (and Vim hack)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



I was looking at whether Antora could automatically generate pages when
the source change so that previewing while modifying docs would be
somewhat easier. (One does not need to re-run ./, but
./ must be re-run after each change.)

I'd filed a ticket upstream and was directed to this discussion:

It seems to be a WIP, and for the moment there's a way to do this. It
uses a gulpfile(?) however, and I don't know enough to figure out how to
make this work with our workflow. Would someone know?


Also, as a hack in the meantime, if you use vim, you can re-run the
./ script each time a buffer is saved using "BufWritePost". So
something like this in your .vimrc would work:

augroup fedora_docs
    autocmd BufWritePost *adoc !./
augroup END

There's a caveat, though---you must start vim in the project root where
./ resides. I'm sure there's a way to detect the project root
and find ./ and put the output into the quickfix list etc, but
I've not gotten down to writing a full plugin yet. :)

Add fugitive to the mix etc., and you don't need to exit vim while
editing docs at all:

Please feel free to improve on this and share them with everyone. Your
friends in the vim documentation are:

: help augroup
: help autocmd
: help BufWritePost

My rather messy vimrc is here for reference:

Ankur Sinha "FranciscoD" (He / Him / His) |
Time zone: Europe/London

Attachment: signature.asc
Description: PGP signature

docs mailing list -- docs@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to docs-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct:
List Guidelines:
List Archives:

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Red Hat 9]     [Yosemite News]     [KDE Users]

  Powered by Linux