Skip to content

Program-repo/Program-repo.github.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

ifdef::env-github[] :tip-caption: :bulb: :note-caption: :information_source: :important-caption: :heavy_exclamation_mark: :caution-caption: :fire: :warning-caption: :warning: endif::[]

= Github Asciidoc Example

== Welcome!

This is an example file of what you can do with asciidoc as rendered on github. It is basically a gist except that gists don't render asciidoc like files do.

== Admonitions

[NOTE]

A sample note admonition. We can use gemoji icons in the Asciidoctor markup. We assign an icon name to the document attributes tip-caption, note-caption and important-caption.

TIP: It works!

IMPORTANT: Asciidoctor is awesome, don't forget!

CAUTION: Don't forget to add the ...-caption document attributes in the header of the document on GitHub.

WARNING: You have no reason not to use Asciidoctor.

== Source Code Rendering

Here is an example of some R code.

[source,r]

par(mfrow=c(1, 2)) # divide graph area in 2 columns boxplot(cars$speed, main="Speed", sub=paste("Outlier rows: ", boxplot.stats(cars$speed)$out)) # box plot for 'speed' boxplot(cars$dist, main="Distance", sub=paste("Outlier rows: ", boxplot.stats(cars$dist)$out)) # box plot for 'distance'

== Diagramming

Asciidoc has a diagramming plugin that renders either

  • PlantUML
  • ditaa
  • GraphViz dot

However this is not turned on within Github.

If I was to include the following in my document:

[source]

@startuml class Car Driver - Car : drives > Car *- Wheel : have 4 > Car -- Person : < owns @enduml

It renders as text.

@startuml class Car Driver - Car : drives > Car *- Wheel : have 4 > Car -- Person : < owns @enduml

However, if I move that PlantUML to a seperate puml file, then I can use the PlantUML proxy server to render an included image (rendered below).

image::http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.github.com/brianrepko/github-asciidoc-example/master/class-example.puml[]

One advantage of the PlantUML proxy server is that is fully supports all PlantUML functions including some funky extensions used to do database diagrams.

image::http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.github.com/brianrepko/github-asciidoc-example/master/database-example.puml[]

== Future additions

  • TOCs
  • Images
  • Tables as an example of CSV/data layout
  • Footnotes
  • Lack of includes - include vs link
  • Attributes
  • Source Code - show rout output
  • Source Code - add callouts
  • Custom macros (menu, btn, kbd, and icon)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published