Editing with live preview

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Editing with live preview

mojavelinux
Administrator
I put together a short guide that steps through setting up a live web preview of the HTML generated from your AsciiDoc document by Asciidoctor whenever the document is saved.

Check it out!


If you have additional suggestions, feel free to fork and edit the file, then submit the changes using a pull request.

-Dan

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

Reply | Threaded
Open this post in threaded view
|

Re: Editing with live preview

LightGuardjp
Pretty slick stuff. I think I'd like to see an alternative startup which uses bundler, and you just have to show the contents of the Gemfile and tell them to

. install bundler
. install the bundle
. run guard

If I have the time I'll write up a section in the file


On Tue, Feb 19, 2013 at 7:13 PM, mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I put together a short guide that steps through setting up a live web preview of the HTML generated from your AsciiDoc document by Asciidoctor whenever the document is saved.

Check it out!


If you have additional suggestions, feel free to fork and edit the file, then submit the changes using a pull request.

-Dan

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




If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Editing-with-live-preview-tp6.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Editing with live preview

mojavelinux
Administrator
Great!

There's no question evolving this live preview setup will be a key part of helping writers to be productive.

-Dan
Reply | Threaded
Open this post in threaded view
|

Re: Editing with live preview

paulrayner
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.
Reply | Threaded
Open this post in threaded view
|

Re: Editing with live preview

mojavelinux
Administrator
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

Reply | Threaded
Open this post in threaded view
|

Re: Editing with live preview

LightGuardjp
Slight tangent to this: we should support running on a whole directory and looking for asciidoc files and run them. Then you can watch a whole directory!

Sent from my iPhone

On Mar 2, 2013, at 20:12, "mojavelinux [via Asciidoctor :: Discussion]" <[hidden email]> wrote:

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




If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Editing-with-live-preview-tp6p19.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Editing with live preview

paulrayner
Agreed. In fact, I want to do a whole directory and its subdirectories too. AsciiWatcher (see the Gist I posted) does subdirectories, and I find it very helpful, especially if I'm sending the rendered html to one or more subdirectories.

I've already looked at some of the other Guard implementations and there are a wide range of options in terms of how deep I can go. I'll likely make the first pass fairly minimal (like AsciiWatcher), so we can build on it.

I'll also look into the --watch command. I like this idea. Dan, if you know of any other open source Ruby apps that have this type of switch please let me know so I can see how they've done it.
Reply | Threaded
Open this post in threaded view
|

Re: Editing with live preview

LightGuardjp
First one that comes to my mind is compass. I'm sure there are others though. 

Sent from my iPhone

On Mar 2, 2013, at 21:51, "paulrayner [via Asciidoctor :: Discussion]" <[hidden email]> wrote:

Agreed. In fact, I want to do a whole directory and its subdirectories too. AsciiWatcher (see the Gist I posted) does subdirectories, and I find it very helpful, especially if I'm sending the rendered html to one or more subdirectories.

I've already looked at some of the other Guard implementations and there are a wide range of options in terms of how deep I can go. I'll likely make the first pass fairly minimal (like AsciiWatcher), so we can build on it.

I'll also look into the --watch command. I like this idea. Dan, if you know of any other open source Ruby apps that have this type of switch please let me know so I can see how they've done it.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Editing-with-live-preview-tp6p21.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Editing with live preview

egalitarian
In reply to this post by mojavelinux
CONTENTS DELETED
The author has deleted this message.