There is some weird stuff going on with the GitHub Asciidoc renderer.
There is a great gist covering a lot of these as well: link: gist GitHub Flavored Asciidoc. In my opinion, it’s sad that asciidoc itself does not just work correctly natively. I understand the need for GitHub Flavored Markdown since markdown was lacking features GitHub needed. Asciidoc does not lack those features and it would be nice for practitioners if there was not a special GitHub flavored asciidoc.
This is a ruby code block with annotations:
require 'sinatra' // (1)
get '/hi' do // (2)
"Hello World!" // (3)
end
-
Library import
-
URL mapping
-
HTTP response body
This is what it looks like when rendered by asciidoctor:
Now this paragraph under the image is way too closely aligned with the image and caption above. This is broken as well…
This is a json code block with annotations:
{
"name": "jess-global-admin", (1)
"description": "Adds jessfraz as a global admin.", (2)
"bindings": [
{
"identities": [
"user:jessfraz" (3)
],
"role": "roles/global.admin" (4)
}
],
"etag": "aGVsbG8K=", (5)
"version": 1 (6)
}
-
A name, must be unique.
-
An optional description.
-
A user
-
The role
-
The etag
-
The version
It is vomiting… likely because json doesn’t support comments.
However, asciidoctor is like "yo I got this." This is what it looks like when rendered by asciidoctor:
Now this paragraph under the image is way too closely aligned with the image and caption above. This is broken as well…
So asciidoc does links like reference. But If I link to something internal I want to do Source code blocks with annotation
(←- THIS SHOULD BE A CODE LITERAL, instead it is resolving it) but let’s see what happens: Source code blocks with annotation.
It’s broken because GitHub is doing markdown like header links not asciidoc which starts with an and uses `’s between words. Now all these inline code blocks are vomiting as well….
So there are two problems here:
-
the link doesn’t work: should be #_source_code_blocks_with_annotation NOT #source-code-blocks-with-annotation
-
my literal inline code snippet should be shown as just that, not the rendered link and then all the following inline code snippets should not be terrible
Some support for diagrams would be nice: https://asciidoctor.org/docs/asciidoctor-diagram/