README.adoc
1// Copyright 2015-2021 The Khronos Group Inc.
2//
3// SPDX-License-Identifier: CC-BY-4.0
4
5= Vulkan Asciidoc Configuration Files
6
7== Macros
8
9The macros in `spec-macros.rb` and `spec-macros/extension.rb` are described
10in the "`Vulkan Documentation and Extensions: Procedures and Conventions`"
11document (see the link:../styleguide.txt[style guide].
12
13== Support for Math
14
15Asciidoctor is customized to insert KaTeX `<script>` tags from
16`math.js` for HTML5, and properly pass through math which has
17`\begin{}\/end{}` delimiters instead of $$\[\]\(\).
18
19For PDF builds, asciidoctor-mathematical is used to generate
20images.
21
22== Stylesheets
23
24`khronos.css` is the stylesheet used for HTML output.
25It is a slightly tweaked version of the Asciidoctor 'Colony' theme.
26
27== Chunked Spec Index
28
29`chunkindex` contains scripts for building and using a search index for the
30Vulkan chunked HTML specification.
31
32== Asciidoctor Extensions
33
34We use a number of Asciidoctor customizations written in Ruby, described
35briefly below.
36
37* `asciidoctor-mathematical-ext.rb` - make latexmath: blocks work in table cells
38* `extension-highlighter.rb` - one way of constructing a diff HTML document
39* `katex_replace.rb` - substitute KaTeX for MathJax in output HTML
40* `loadable_html.rb` - add some status messages for slow-loading documents
41* `rouge-extend-css.rb` - override parts of the 'rouge' highlighter CSS
42* `spec-macros.rb` - custom asciidoctor macros used in spec markup
43* `tilde_open_block.rb` - allow '~~~~' as an open block delimiter
44* `vuid-expander.rb` - add anchors to valid usage ID tags
45* `vu-to-json.rb` - extract valid usage statements to JSON as part of a dummy spec build
46
README.md
1# Vulkan Asciidoc Configuration Files
2
3## Macros
4
5The macros in `vulkan-macros.rb` and `vulkan-macros/extension.rb` are
6described in the "Vulkan Documentation and Extensions: Procedures and
7Conventions" document (see the [styleguide](../styleguide.txt)).
8
9## Support for Math
10
11Asciidoctor is customized to insert KaTeX `<script>` tags from
12`math.js` for HTML5, and properly pass through math which has
13`\begin{}\/end{}` delimiters instead of $$\[\]\(\).
14
15For PDF builds, asciidoctor-mathematical is used to generate
16
17`math-docbook.conf` is heavily conditionalized depending on whether the
18final output format (which should be described in the a2x-format variable)
19is `pdf` or not, since Docbook passes through math differently to dblatex
20vs. the XHTML stylesheets. This could be simplified now that we're only
21using Docbook for PDFs.
22
23## Stylesheets
24
25`khronos.css` is the stylesheet used for HTML output.
26