Outline and tags
Simple outline with several sections, several sidebars in an outline file, and outline tags.
Sidebar name with simple outline#
Let's start with a simple outline, and move along slowly.
This outline describes the structure of a sidebar called docs. We need a sidebar name when we refer to a sidebar's content. You place a sidebar name in a level 2 heading. Sidebar's structure appears in a bullet list immediately following the sidebar name. In our example above, the sidebar has three sections, Section A, Section B, and Section C. Topics inside each section appear as indented bullet list. Topic 1 and Topic 2 are topics inside Section A. Both Section B and Section C have a single topic, Topic 2 and Topic 4, respectively.
sidebars.js -- the sidebars description skelo generates contains the following:
skelo will generate topic files in .md format: topic-1.md, topic-2.md, topic-3.md, and topic-4.md, and each topic will have a title identical to its sidebar entry. For example, clicking Topic 1 on the sidebar will show the topic-1.md whose title is Topic 1.
topic-1.md contains YAML front-matter to describe the title, id, and sidebar_label -- the format Docusaurus expects for documentation files:
Let's move along, and create a sub-section in the outline:
The sidebars.js file resulting from skelo after processing the outline above is:
The outline above is similar to the one on top, with Section A containing Topic 1 and a subsection Subtopic 1 of A with Topic 2 and Topic 5 inside it. The following files will be generated:
- topic-1.md
- topic-2.md
- topic-3.md
- topic-4.md
- topic-5.md
We will make a further change:
What's going on here? The @headers sub-item inside Topic 1 indicates a topic headers outline with Header 1 and Header 2 as top level headers inside the topic. Header 1.1 and Header 1.2 appear as sub-headers of Header 1, while Header 2.1 and Header 2.2 are sub-headers of Header 2.
The sidebars.js has not changed compared to previous example. What has changed is the content of topic-1.md to include ## headers:
Several sidebars in an outline file#
You can place several sidebars in an outline file as pairs of sidebar name and bullet list. The sidebars.js resulting from processing the outline file will contain sections for each sidebar name.
Let's examine the multi-sidebars-outline.md file:
This outline contains definitions for two sidebars: docs and features, each sidebar name followed by its outline. All topic files skelo generate will go in the folder indicated in the -d or --docs option.
The sidebars.js file contains:
Customize outline with tags#
You can control what skelo generates for sections, topic, sub-sections, and headers with outline tags. Outline tags follow the outline entry, and start with @ followed by tag name and tag content. Each outline tag also has a shortcut, usually a single letter.
@brief, @b#
Brief description text following the section, topic, or header.
Usage: @b word [word...]
Example:
@folder, @f#
Create folder based on outline item, or use the @slug value.
Usage: @f
Example:
@headers#
Provide topic header outline on following lines.
The @headers tag appear on a line of its own, as a subitem of the topic. Following lines include the headers outline as a bullet list inside @headers
Usage: - @headers
Example:
@slug, @s#
Slug words as alternative topic file identifier. Use next words to create a slug. For example, "@s Sample alternative" generates the topic slug: sample-alternative.
Usage: @slug word [word...]
Example:
@title, @t#
Alternative topic title to use instead of navigation item.
Usage: @topic word [word...]
Example: