1.4. Table of Contents

In the config.md file, you should define

and, the most important variable,

Example Menu

The behavior of the menu variable is best understood with an example. Consider the one used in this book/documentation, which yields the table of contents on the menu bar on the left:

menu = [
    "*pages/intro"
    "*PART I"
    "Configurations" => [
        "pages/book"
        "pages/style"
        "pages/menu_bar"
        "pages/toc"
        "pages/navigation"
        "pages/pages"
        "pages/binder"
    ]
    "*PART II"
    "pages/math_and_code" => [
        "pages/franklinmd"
        "src/literate/literatejl.jl"
        "src/weave/weavejl.jl"
        "src/weave/weavejmd.jmd"
        "src/jupyter/notebookipynb.ipynb"
    ]
    "*pages/appendix"
]

Notice how the entries that start with * do not get numbered, and how those that do not start with either pages/, src/weave/, src/literate/, or src/jupyter just have the title, without linking to any page, regardless of being a pair pointing to a vector of subsections or not.

Rules

  1. When a string starts with either pages/, src/weave/, src/literate/, or src/jupyter, it means it points to a file. The title is grabbed from the file.

  2. If an entry points to a file but has no extension, it is assumed to have the .md extension.

  3. When a string does not start with either of the prefixes above, it is assumed it does not point to any content file, and simply contains the title of the entry.

  4. When an entry is a Pair, the second value of the Pair is a Vector of Strings with the list of subsections, each of them following the pattern above.

  5. Inspired by LaTeX, if a string starts with a *, it is not to be numbered. Contrarily to LaTeX, however, if that string points to a lists of subsections, none of them gets numbered either, regardless of starting with * or not. This seemed like a more reasonable behavior.

  6. When the entry points to a file, then, depending on the folder, the file is executed and rendered by either Franklin.jl, Weave.jl, or Literate.jl. Depending on the case, the file can be either Franklin's Markdown, Weave's/Juno's Markdown, Literate's Markdown, a plain julia script with markdown-like comments, or a jupyter notebook. More about that on 1.6. Pages.



Last modified: March 16, 2022. Built with Franklin.jl, using the Book Template.