Search results

Types

Classes
Interfaces
Enums
Functions
Type aliases
Constants

Members

Properties
Methods
Getters
Setters
Enum members
Show privates

Other

In this module only

Type alias DocumentStructure

Defined in index.ts

What is a documentation structure?

A documentation structure is something like a theme, but way more flexibale. It doesn't only allow you to change the style of the page, but also it's functionality. A documentation structure provides functions which transform data about your project into HTML strings.

If you would like to change the generated site only stylistically, it's highly recommended to just use a custom documentation structure. If you'd like to change how things are generated, for example maybe you'd like to use React Static to make your documentation an SPA, then write your completely own generator using the typescript extractor

To see how a documentation structure should look like, visit the repository of the default documentation structure.

index

Every document structure should have an entry point which exports a function called init. The function must return an object containing all the functions for the componentstype Componentsts-docs/documentStructure/Components. The default documentation structure uses plain template strings to generate the HMTL output, but you could use a templating engine, too.

The init function has two arguments, the StaticDocumentationData and the generatorclass Generatorts-docs/generator/Generator.

component functions

A component function renders a specific component. A list of all component names can be found heretype Componentsts-docs/documentStructure/Components. Each function takes in exactly one argument - an object with data which is specific to the component at hand, and it must return a string.

assets folder

The assets folder contains files which will be used by the client. Images, css files and javascript files. You need to specify where the assets folder is located via the assets property in the package.json for the documentation generator.

jsx-to-str

The default documentation generator uses jsx-to-str, a typescript transformer which turns JSX literals into plain strings during transpilation.

{
components: Recordexternal Record<Componentstype Componentsts-docs/documentStructure/Components, (data: unknown) => string>,
assetsPath: string
}