Skip to content

Instantly share code, notes, and snippets.

@robdaemon
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save robdaemon/f90afa6ba0aef6168a91 to your computer and use it in GitHub Desktop.

Select an option

Save robdaemon/f90afa6ba0aef6168a91 to your computer and use it in GitHub Desktop.
mixing asciidoctor-diagram and images into a single document
asciidoctor-diagram allows you to mix a diagram into your doc, but GitHub doesn't render it inline. Instead, you can do this:
----
ifdef::env-github[]
image::diagram.png[]
endif::[]
ifndef::env-github[]
["plantuml", "diagram", "png"]
-----------------------------------------------
title My Diagram
object MyObject {
id
name
}
MyObject <|-- MyObject
-----------------------------------------------
endif::[]
----
This is obviously a very contrived diagram, but this will render the generated image, if you commit it to the repo alongside your .adoc file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment