Skip to content

Instantly share code, notes, and snippets.

@HodGreeley
Last active November 15, 2019 22:54
Show Gist options
  • Save HodGreeley/ba3e477e256e469170064061b3b8d981 to your computer and use it in GitHub Desktop.
Save HodGreeley/ba3e477e256e469170064061b3b8d981 to your computer and use it in GitHub Desktop.
Tips for using AsciiDoc

Tips for using AsciiDoc

Command line processing:

asciidoctor -a allow-uri-read -b html5 blogpost.adoc

Visual Studio Code support

Add this to user or workspace settings to allow importing of content via URI

"asciidoc.html_generator": "asciidoctor -a allow-uri-read -o-"

To output html5 instead of xhtml, add -b html5

Pull content directly from GitHub

Use links to raw content.

e.g. include::https://raw.githubusercontent.com/couchbaselabs/xdcr-java-sample/master/src/main/java/com/couchbase/server/xdcr/ClusterBasics.java[]

This works with images, too.

Keep a file of commonly used links and shorthand codes. For example AsciiDoc automatically replaces {CBS} with the link {CBS}. Or, don’t supply default text and add it on use, e.g. {XDCR-}[XDCR is cool].

Use tags

With tags, you can automate including code segments from complete source. See http://asciidoctor.org/docs/user-manual/#include-partial

Use callouts

Number code lines for reference. This doesn’t currently translate well to WordPress. See http://asciidoctor.org/docs/user-manual/#callouts

Linked images

License Apache%202.0 blue

5JiISK4fWHJvXxBVOtVvXLGsXud6ZS5XZ  KzH17pO LvjwWKRWUveErQ6 RcxDnLx8dxm7LRS9zwt j9BOaCZnod8Zfmgj8QrN vbmKmwoTG8bwo6jkVPU2n9iaTnIn3KHFn9 bt2ygkiBSJkJ6V 8bdOmyeJDbbaeGG5QhV48xXr  bkNl 4 GfPDBR4NWCV T hReoeo7iab7zib1GlHQqYQFi1LRhT0VtZIgA EW4uSwYHCoQdESHYc8cvtsMwadygNzrAlT XJsUDVzrXmfxlQgGgjbA1wi bRIfUDskT4WWT8KRTHtQkvEDiaohiBWTYHOVwAJmmWaximfjyCLGYLlSxALxTq LNUeZq3yXY2qA 6q9NwhHpwqlq8EJGUSUSvz0Y5o0ON5wxK2R7EFM 6DNq1YFKAKzo8zAJcu uE05Em7e 07b8 09el2lKEQUQ6EVYPwi8y5jLRI25y5DC4UBUwkZFvgH0VQovoHiSe5UDYeTqu2KXfXo7e4P0gOzPk3C9FcT42JE K SVjwg12cQI8ZymoQ1X66x694MhjLr2N6RJD qsv2Pnyz=w2878 h1516

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment