README.adoc: make it work offline too
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 26 Sep 2023 22:37:54 +0000 (18:37 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 26 Sep 2023 22:37:54 +0000 (18:37 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
README.adoc

index c3ebe7f0ff9d4a9cc83b6137f93acbcb7acfcc21..1132dd7c8839f2732a2a081c879f97b098254f1f 100644 (file)
@@ -1,9 +1,23 @@
-= Normand
-Philippe Proulx
+// Show ToC at a specific location for a GitHub rendering
+ifdef::env-github[]
+:toc: macro
+endif::env-github[]
+
+ifndef::env-github[]
 :toc: left
+endif::env-github[]
+
+// This is to mimic what GitHub does so that anchors work in an offline
+// rendering too.
+:idprefix:
+:idseparator: -
 
+// Other attributes
 :py3: Python{nbsp}3
 
+= Normand
+Philippe Proulx
+
 [.normal]
 image:https://img.shields.io/pypi/v/normand.svg?label=Latest%20version[link="https://pypi.python.org/pypi/normand"]
 
@@ -16,6 +30,11 @@ tool.
 WARNING: This version of Normand is 0.1, meaning both the Normand
 language and the module/CLI interface aren't stable.
 
+ifdef::env-github[]
+// ToC location for a GitHub rendering
+toc::[]
+endif::env-github[]
+
 == Introduction
 
 The purpose of Normand is to consume human-readable text representing
This page took 0.023735 seconds and 4 git commands to generate.