Table of Contents

DIG AsciiDoc Style Guide

New AsciiDoc Style Changes for Antora

As of the 3.6 release of Evergreen, we are using Antora as a new "framework" for the Evergreen docs. Antora requires some changes to the directory structure, and it reveals some AsciiDoc syntax errors (since it uses the more strict AsciiDoctor for converting to HTML).

In addition, DIG recommends the following changes.

Add a Table of Contents to the top of each AsciiDoc file

This simply means adding this AsciiDoc line near the top of each .adoc file. The toc designation should go on the 2nd line of your file, just below the top header. (The old system added this during the HTML build process.)

= Heading =
:toc:

Use prefix/suffix style headings instead of underline style

The basic reasons are:

Example: Change this

Heading 1
---------

To this

== Heading 1 ==

Here's a Python script that could help with the conversion (only adds prefix; we'd need to modify it to add the suffix):

Changes to cross-reference structure

Antora requires a new cross-reference structure. All existing cross references were converted via script, but new docs will need to indicate cross references in this manner:

xref:reports:reporter_folder.adoc#reporter_creating_folders[Creating Folders]

The above breaks down as follows:

For historical purposes, the old xref syntax is below

The below is an example of the now-deprecated cross reference style. DO NOT USE THIS!

<<reporter_creating_folders,Creating Folders>>

General

Formatting

Headers

Changing A Section Heading

To prevent breaking internal links:

  1. Any time we edit a section heading (even fixing a typo), first check the HTML of the docs for the autogenerated anchor name. (This will be in an <a id=""> tag, just inside the "<h2>" tag, or "<h3>", etc. Example anchor name: "_shelving_location_groups")
  2. Search the docs code for that exact anchor name to find any references. (These will look like "<>".)
  3. Update the section heading and any references you found (it's okay to guess at the new anchor name; the docs committer can double-check this after it's published).
  4. NOTE: This may change the docs page URL, which would break external links and bookmarks. To prevent this, ask the DIG email list how they handle redirecting pages that move.

Header Prefix Syntax

= Header Level 0 =
== Header Level 1 ==
=== Header Level 2 ===
==== Header Level 3 ====
===== Header Level 4 =====

Header Underline Syntax

As noted above, we are no longer using the header underline syntax as of the 3.6 documentation due to the Antora move.

Other Formatting

.Optional Title
[source,perl]
----
# This is a *source* block
print "Hello world!";
----

Wording

Standard Terminology

Linking

Special blocks

Use case

When you want to document why a particular feature might be used, it's helpful to put that in an Asciidoc "sidebar" (though it often is displayed as a callout block). Syntax:

Use Case
************************************************
This feature is useful in cases where
your library wants to catalog books about
tigers and other big cats.
************************************************

Screenshots

Common Mistakes

To edit a Receipt:
 
. Select *Administration -> Workstation -> Print Templates*.
. Choose the Receipt in the drop down list.
. If you are using Hatch, you can choose different printers for different types
  of receipts with the Force Content field. If not, leave that field blank.
  Printer Settings can be set at *Administration -> Workstation -> Printer
  Settings*.
+    
image::media/receipt1.png[select checkout]
+
. Make edits to the Receipt on the right hand side.

Note how this preserves the numbering:

Further Reading