;; some sweet clojure code
(defn hello-earthling
"Greet an earthling in a believable way." (1)
[name]
(println "Hello earthling " (uppercase name))) (2)
A test asciidoc to exercise cljdoc formatting and features.
I have a strong feeling that I might be headstrong.
I am under the impression that that you are thunderstruck by this example.
My code
was encoded
ed.
I am super excited about this subroutine.
Here we have some clojure code:
;; some sweet clojure code
(defn hello-earthling
"Greet an earthling in a believable way." (1)
[name]
(println "Hello earthling " (uppercase name))) (2)
1 | a docstring comes before the arguments |
2 | check with an earthling if uppercasing is soothing |
I we specify clojure-repl
to asciidoctor as our language, we can invoke special highlighting for a repl session:
user=> (require '[clojure.string :as string])
nil
user=> (string/reverse "step on no pets")
"step on no pets"
user=> (reduce + 0 [1 2 3 4 5 6 7 8 6])
42
user=>
This local image should work on github and cljdoc. According to asciidoctor, images are resolved relative to the document or at the path specified by the imagesdir
asciidoctor attribute.
Current value of imagesdir
:
../../images
How about captions, do we display those nicely?
From most serious to least:
Important things are said here. |
Warning to the wise. |
Aren’t you a caution? |
Note that this note is a note. |
Tip the scales with a tip. |
And how do admonitions look with some code in them?
This admonition has some
|
This admonition has some
|
This admonition has some
|
This admonition has some
|
This admonition has some
|
Asciidoc tables are quite full featured, here’s a simple one:
Heading 1 | Heading 2 |
---|---|
col1, row1 | col2, row1 |
col1, row2 | col2, row2 |
col1, row3 | col2, row3 |
col1, row4 | col2, row4 |
Here’s the same table with a title
Heading 1 | Heading 2 |
---|---|
col1, row1 | col2, row1 |
col1, row2 | col2, row2 |
And here’s a nested table example from asciidoctor user manual:
Col 1 | Col 2 | ||||
---|---|---|---|---|---|
Cell 1.1 | Cell 1.2 | ||||
Cell 2.1 | Cell 2.2
|
Here’s a table with custom sizing:
10% width | 40% width | 20% width | remaining |
---|---|---|---|
a | b | c | d |
e | f | g | h |
i | j | k | l |
m | n | o | p |
An autowidth table will only be as wide as it needs to be.[1]
Name of Column 1 | Name of Column 2 | Name of Column 3 |
---|---|---|
Cell in column 1, row 1 | Cell in column 2, row 1 | Cell in column 3, row 1 |
Cell in column 1, row 2 | Cell in column 2, row 2 | Cell in column 3, row 2 |
Do we support svgbob? Not yet but if we someday decide to, this sample from the svgbob demo site won’t look like ASCII art.
.─. ( 0 ) `-' / \ / \ V V .─. .─. ( 1 ) ( 4 ) `-' `-' . / \ | \ `. / \ | \ `. V V | \ `. .─. .─. V V V ( 2 ) ( 3 ) .─. .─. .─. `─' `─' ( 5 ) ( 6 ) ( 7 ) `─' `─' `─'
As far as I can figure, Asciidoctor does not support root relative http links - so we need to fully qualify links to our APIs:
If they are not already, these will soon be converted to root relative links by cljdoc to support local testing.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close