~stick/stma.is

4cb910637819d90150e1a7c4328899ef9f587df6 — Stick 2 months ago 524b2f3
post 2020-04-08-hugo-base-asciidoc-support
1 files changed, 71 insertions(+), 0 deletions(-)

A content/stick/2020-04-08-hugo-base-asciidoc-support.ad
A content/stick/2020-04-08-hugo-base-asciidoc-support.ad => content/stick/2020-04-08-hugo-base-asciidoc-support.ad +71 -0
@@ 0,0 1,71 @@
---
title: "AsciiDoc support in the hugo-base theme"
tags: ["software"]
---

I've added basic support for AsciiDoc to the https://git.sr.ht/~stick/hugo-base[`hugo-base`] theme.
This post shows some of the results.

== AsciiDoc Admontions

Here's the source code...

[source,asciidoc]
----
NOTE: This is a note.

TIP: Notes and tips in AsciiDoc result in ``<aside>``s in HTML.

IMPORTANT: The other admonitions in AsciiDoc result in ``<section>``s in HTML.

[CAUTION]
Why are different admonitions handled differently?
I don't know, you decide.

WARNING: I do not guarantee results if you do not use https://github.com/jirutka/asciidoctor-html5s[`asciidoctor-html5s`].
----

...and here's the result:

NOTE: This is a note.

TIP: Notes and tips in AsciiDoc result in ``<aside>``s in HTML.

IMPORTANT: Important, caution, and warning admonitions in AsciiDoc result in ``<section>``s in HTML, with named classes.

CAUTION: Why are different admonitions handled differently? I don't know, you decide.

WARNING: I do not guarantee results if you do not use https://github.com/jirutka/asciidoctor-html5s[`asciidoctor-html5s`].

== Highlighted Source Code

Note that you will need to bring your own syntax highlighting.

[source,html,linenums]
----
<div class="paragraph"><p>...</p></div>
<div class="paragraph"><p>...</p></div>
<div class="paragraph"><p>...</p></div>
<div class="listingblock"><div class="content">
	<pre class="...">
		<code class="..." data-lang="...">...</code>
	</pre>
</div></div>
----

[source,vim]
----
if exists('did_load_filetypes')
  finish
endif
augroup filetypedetect
	autocmd! BufNewFile,BufRead *.ad setlocal filetype=asciidoc
augroup END
----

== Quotes and Blocks

Handled the same way they are for Markdown.

[quote, Buzz Lightyear]
To Infinity, and Beyond!