Antora "watch mode" (and Vim hack)

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

 



Hi,

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 ./preview.sh, but
./build.sh must be re-run after each change.)

I'd filed a ticket upstream and was directed to this discussion:
https://gitlab.com/antora/antora/issues/329

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
./build.sh script each time a buffer is saved using "BufWritePost". So
something like this in your .vimrc would work:

augroup fedora_docs
    autocmd!
    autocmd BufWritePost *adoc !./build.sh
augroup END

There's a caveat, though---you must start vim in the project root where
./build.sh resides. I'm sure there's a way to detect the project root
and find ./build.sh 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:
https://github.com/tpope/vim-fugitive

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:
https://github.com/sanjayankur31/vimfiles/blob/master/vimrc

-- 
Thanks,
Regards,
Ankur Sinha "FranciscoD" (He / Him / His) | https://fedoraproject.org/wiki/User:Ankursinha
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: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/docs@xxxxxxxxxxxxxxxxxxxxxxx

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

  Powered by Linux