Render Docs, use of {index} and {next}


I am in the process of getting the admin guide developed. Working on the base shell at this time. In the main documentation, such as the user’s manual there are files called index.txt scattered around the directories that as far as I can tell are used to generate the links for the main table of contents and the next page links. I see {index} and {next} tags in the markdown and based on what I see in those text files, it makes sense that these are used to build the navigation.

What I can’t seem to figure out is how to get my pandoc template to process these tags on my local computer. This is what I have in my template right now:

<!DOCTYPE html>
<!-- Built on Frappe. -->
<html$if(lang)$ lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0>
  <meta name="generator" content="frappe">
  <meta name="author" content="$author-meta$">
  <meta name="" content="$date-meta$">
  <meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$">
  <title>$if(title)$ $title$ $endif$</title>
  <style type="text/css">q { quotes: "“" "”" "‘" "’"; }</style>
  <style type="text/css">
  <link rel="stylesheet" href="$css$">
<body data-path="user">
<h1 class="title">$title$</h1>
<p class="subtitle">$subtitle$</p>
<p class="author">$author$</p>
<p class="date">$date$</p>
<nav id="$idprefix$TOC">

Does anyone have any ideas they can provide? This template is essentially the default html5 one with a few edits at the top.


1 Like

You can convert this template into markdown, add {index} to the end of it, build the documentation using

bench build-docs

I am writing on Windows and not Linux as a dev environment. What does bench build-docs do specifically to convert the {index} tag to html?

It replaces the {index} with the entries found in index.txt and {next} with the next topic.
You can view the code here