Table of Contents
getting-started.md
. @tutorial
directive. So, the internal name for the tutorial in our example would be getting-started
and the code to link to it from a documentation block would be: @tutorial getting-startedWhen linking from another tutorial, the directive has to be wrapped in curly braces, so the code will become:
{@tutorial getting-started}On compilation, JSDoc will replace that portion with a link to the tutorial file.
getting-started.json
. The content of the JSON meta file is an object
with two important properties
. Both the properties are optional: title
: This value becomes the tutorial’s title. It is shown on the tutorial’s page as the page title and is used as the anchor tag text in links to the tutorial. This is different from the internal machine name. The internal machine name of a tutorial is always derived from the file name. So, a tutorial’s title can be changed anytime without changing its filename. If the title is changed, all references to that tutorial will automatically update to the new title provided.children
: This is an array of tutorial names that are rendered as children of the current tutorial. More on this in the following section.{ "title": "Getting Started", "children": [ "building-your-first-chart", "configuring-your-chart" ] }
children
children
property in the parent tutorial’s JSON metadata. This helps in organizing entire documentation into a tree with neat sections. The nesting, however, is at the meta level. The child tutorials still remain in the same location, their file names upon compilation remain the same. They simply show up as sub-articles under their parent tutorial in the generated documentation and do not appear on the main “Tutorials” menu anymore. JSDoc handles any cyclic dependency which may result from specifying the parent tutorial in the children
property of the child tutorial. In this case, JSDoc takes only the first instance of the relation. If it already knows that a given tutorial is a child of a parent, it will ignore any further relation it finds to the parent from the child. -u
switch for providing path to the tutorial folder. This path is relative to the directory from which JSDoc is executed. Assuming the tutorials are kept in ./docs/tutorials
, the command for running JSDoc has to be modified to: $ jsdoc [options] -u "./docs/tutorials"Even if the tutorial path is specified in the configuration, specifying it on the commandline takes precedence over the configuration.
tutorials
under the opts
property in the configuration. The value of the tutorials
property will be a string containing relative path to the tutorials directory. Taking the same example above, the configuration file would look like: { … "opts": { … "tutorials": "./docs/tutorials" } }
Have you ever spent hours buried in documentation, hunting for a specific piece of code?…
Do you feel like your data is a cryptic puzzle, locked away from revealing its…
In web development, mastering JavaScript charting libraries is crucial for keeping up with the fast-paced…
Ever spend an afternoon neck-deep in documentation, searching for that one elusive code snippet? Or…
In the dynamic world of data visualization, the need for precision and innovation has never…
Are you drowning in data but struggling to find the insights that drive real business…