You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(html5s): implement converter focusing on html correct semantics
`asciidoctor` has a [community provided
converter](https://github.com/jirutka/asciidoctor-html5s) that focuses on correct
semantics, accessibility and compatibility with common typographic CSS styles.
Closes#329.
Render mathematical formulas using MathJax 4. Enable it by setting the `:stem:` document attribute.
102
+
103
+
[source,asciidoc]
104
+
....
105
+
= My Document
106
+
:stem: latexmath
107
+
....
108
+
109
+
The `:stem:` attribute accepts:
110
+
111
+
- `latexmath` - use LaTeX notation
112
+
- `asciimath` - use AsciiMath notation
113
+
- _(empty)_ - defaults to `latexmath` for blocks, `asciimath` for inline
114
+
115
+
**Inline formulas** use the `stem:[]` macro:
116
+
117
+
[source,asciidoc]
118
+
....
119
+
The solution is stem:[x = (-b +- sqrt(b^2 - 4ac)) / (2a)].
120
+
....
121
+
122
+
**Block formulas** use the `[stem]` attribute on a passthrough block:
123
+
124
+
[source,asciidoc]
125
+
....
126
+
[stem]
127
+
++++
128
+
x = (-b +- sqrt(b^2 - 4ac)) / (2a)
129
+
++++
130
+
....
131
+
132
+
When enabled, MathJax is loaded from the jsdelivr CDN (`cdn.jsdelivr.net/npm/mathjax@4`) and renders formulas client-side. LaTeX uses `\(...\)` and `\[...\]` delimiters; AsciiMath uses `\$...\$`.
133
+
134
+
To suppress MathJax processing on specific elements, add the CSS class `nostem`, `nolatexmath`, or `noasciimath`.
135
+
136
+
### Semantic HTML5 Output (`html5s`)
137
+
138
+
An alternative backend that produces semantic HTML5 instead of the traditional div-based layout, inspired by Jakub Jirutka's https://github.com/jirutka/asciidoctor-html5s[asciidoctor-html5s] gem for Asciidoctor. Enable it with `--backend html5s`:
139
+
140
+
[source,console]
141
+
....
142
+
acdc convert --backend html5s document.adoc
143
+
....
144
+
145
+
Key differences from the standard backend:
146
+
147
+
- **Sections** use `<section>` elements instead of `<div class="sectN">`
148
+
- **Admonitions** use `<aside>` (note, tip) or `<section>` (warning, important, caution) with ARIA roles
149
+
- **Images** use `<figure>` and `<figcaption>` instead of `<div class="imageblock">`
150
+
- **Example blocks** use `<figure>` instead of `<div class="exampleblock">`
151
+
- **Sidebars** use `<aside>` instead of `<div class="sidebarblock">`
152
+
- **Callout lists** use `<ol>` instead of a table layout
153
+
- **Titled paragraphs** are wrapped in `<section>` with `<h6 class="block-title">`
154
+
- **Block titles** use `<h6 class="block-title">` instead of `<div class="title">`
155
+
156
+
The semantic variant ships with its own stylesheet (light and dark mode) and supports a few additional document attributes:
157
+
158
+
- `:html5s-force-stem-type:` — override the stem notation (`latexmath` or `asciimath`) regardless of the `:stem:` value
159
+
- `:html5s-image-default-link: self` — make all images link to themselves by default
160
+
- `:html5s-image-self-link-label:` — custom aria label for self-linked images (default: "Open the image in full size")
161
+
99
162
### Document Attributes
100
163
101
164
Set document attributes via command line:
@@ -175,5 +238,8 @@ The HTML converter:
175
238
176
239
## Differences from Asciidoctor
177
240
178
-
While the HTML converter aims for compatibility with Asciidoctor, there are some known
179
-
differences and limitations.
241
+
While the HTML converter aims for compatibility with Asciidoctor, there are some known differences and limitations.
242
+
243
+
- The `css-signature` attribute is not supported. Use a document ID instead (`[[my-id]]` above the title).
244
+
- Syntax highlighting uses syntect with inline CSS styles rather than external highlight.js or Pygments. Language coverage may differ.
245
+
- The `html5s` backend is inspired by Jakub Jirutka's https://github.com/jirutka/asciidoctor-html5s[asciidoctor-html5s] gem but is a separate implementation with its own output.
0 commit comments