Login  Register

Re: Editing with live preview

Posted by mojavelinux on Mar 03, 2013; 3:11am
URL: https://discuss.asciidoctor.org/Editing-with-live-preview-tp6p19.html

Paul,

That would be fantastic!

I think Guard support for Asciidoctor is going to be an absolute killer feature. I showcased my setup at DevConf and it caused quite a ripple.

For me, the most compelling option is the --watch command on the asciidoctor command. We really want to be able to give writers that out of the box experience, and there's no better way than "gem install asciidoctor" + "asciidoctor -w file.ad".

There are a couple of ways to approach it:

1. Generate a Guard file automatically
2. Ship a Guard file out of the box
3. Setup Guard inline

There are two ways the watch could run:

1. Just look at the source file and run Asciidoctor when it changes
2. Run on the directory that contains the file and regenerate the file if it changes or any AsciiDoc file in the same directory

The LiveReload plugin should handle all the other files such as CSS, JS, etc.

Play around with it and let us know which approach you think works best.

-Dan

p.s. I'm thrilled to hear that Asciidoctor is helping you stay in the flow of writing your book.

...also, I just wrote my first test in Cucumber today :)

On Sun, Mar 3, 2013 at 12:46 AM, paulrayner [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I see you have issues #182 and #191 that both relate to live preview. I'm interested in working on these issues.

See https://gist.github.com/paulrayner/5073777 for an example of something I've done in this area. I've been using AsciiWatcher to write my Addison Wesley book BDD with Cucumber using AsciiDoctor to do all the live preview. AsciiWatcher does the job nicely, but I'd like to do it as more of a standard solution using Guard as you suggest.

So if no one else has already claimed them, feel free to assign both these issues to me.

Cheers,
Paul. 
 
--
Dan Allen
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

http://google.com/profiles/dan.j.allen
http://mojavelinux.com
http://mojavelinux.com/seaminaction