Live rendering of AsciiDoc files in Chrome browser

652 views
Skip to first unread message

Alan Thompson

unread,
Sep 2, 2015, 3:06:23 PM9/2/15
to clo...@googlegroups.com
Hey, 

As you all know, the README files on Github, etc can be formatted using the either AsciiDoc (my favorite) or the older MarkDown format.  However, it is a pain to edit these files in just a plain text editor without a good way of seeing the final, rendered format until you commit and push your latest changes up to GH.

If you haven't seen it yet, there is a Chrome extension named "Asciidoctor.js" that will render both AsciiDoc and MarkDown files into HTML right in your browser.  It even features automatic reloading of changes (~2 sec delay) whenever you make a change to the source file.

If you are not already using this or a similar tool, you should give it a try. Enjoy!

Alan

James Elliott

unread,
Sep 2, 2015, 3:37:37 PM9/2/15
to Clojure
Wow, thank you, this is fantastic! I have been developing an extensive set of AsciiDoc documentation (having been forced to transition from FrameMaker to DocBook XML, then driven by its complexity to Markdown, and frustrated by its limitations to AsciiDoc), but found it frustrating that I had to push my changes up to GitHub in order to see how they were working.

One snag I ran into, in case this helps others: I could not see the “Allow access to file URLs” setting in Chrome which is mentioned by the Extension as a requirement for it to work properly until I had turned on the “Developer mode” checkbox at the top of the Extensions page. People who use Chrome regularly have probably already done that, I suppose. :)

  -James

Alan Thompson

unread,
Sep 2, 2015, 4:31:28 PM9/2/15
to clo...@googlegroups.com
Re "File URLs":  Go to the Options page for Asciidoctor.js (right-click on the red "A" to the right of the address bar.  At the top of the page you will see an alert that says, 

"Heads up! In order to use this extension on local files (i.e. files on this computer), you must check the option Allow access to file URLs on the chrome://extensions page"

and you can then click on the "chrome://extensions/" link in the message or just type "chrome://extensions/" into the Chrome address bar.

Another tip regarding file extensions, is that you can use the suffix "*.adoc" for your filenames rather than the longer "*.asciidoc" file suffix.

For you Vim users like me, you will also probably want to create a file "~/.vim/ftdetect/adoc.vim" to enable VIM filetype autodetection, with the one-liner contents of:

" Recognize *.adoc files as Clojure source
autocmd BufWinEnter,BufNewFile,BufRead *.adoc set filetype=asciidoc

Enjoy!
Alan


--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Atamert Ölçgen

unread,
Sep 3, 2015, 2:01:49 AM9/3/15
to clo...@googlegroups.com
I am using AsciiLight plugin for LightTable and very happy with it:


--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Kind Regards,
Atamert Ölçgen

◻◼◻
◻◻◼
◼◼◼

www.muhuk.com

Alan Thompson

unread,
Apr 1, 2016, 7:11:13 PM4/1/16
to Clojure
UPDATE:  AsciiDoc vs MarkDown format:

I have been trying to edit some MarkDown files on GitHub, and it seems that the Google Chrome extension AsciiDoctor.js no longer renders MarkDown, only AsciiDoc.  Not to worry, however!  I just found a similar Chrome extension that does live rendering of Markdown format:  Markdown Preview Plus

***** Another nice tip:  Both Asciidoctor.js and Markdown Preview Plus have an Options panel which allows you to choose "GitHub" styling.....very nice! *****

Alan
Reply all
Reply to author
Forward
0 new messages