Skip to content

To Markdown

Anton edited this page Dec 26, 2019 · 2 revisions

Typal is closely integrated with Documentary. The development process of upgrading the look and feel of documentation is always in both packages at the same time. However, there is a plan to decouple them and bring all HTML template code into Documentary, as well as providing configurable options (e.g., <boolean> underlinePropertyName, <boolean> joinDefaultWithDescription, etc), skins and the ability to implement custom tables using JSX components.

ToMarkdownOptions extends LinkingOptions: These options are there for Documentary integration as these 2 packages work together.

Name Type & Description Default
narrow boolean false
If specified, this will return an object { props: ps, anyHaveDefault, constr } for Documentary. Otherwise, returns a string. Semi-private API.
details !Array<string> -
The list of types that should be displayed in a <details> element, with the name and description as summary, and the properties table inside.
preprocessDesc (description: string) => string
How to process description. Documentary will strip the triple-backtick code blocks and insert them manually at the end to avoid any transforms in them.
description* string: The description to pre-process.

LinkingOptions: Options for linking.

Name Type & Description Default
escapePipe boolean true
Escapes the | in unions so it becomes \|.
flatten (boolean | function(string): void) false
Whether to follow links of referenced types. This will exclude them from printing in imports when compiling README documentation. If function is passed, it will be called with the name of flattened type.
link (info: { link: string, type: !Type }) => string
The function to get a link to the type. By default, prepends # to the generated link, but in case of Wiki generation, Documentary will make sure that types can be linked across pages.
info* { link: string, type: !Type }: The link is the type name that will be present for anchoring on the page, e.g., type-config. The type is the linked type.
nameProcess (name: string, odd?: boolean) => string
Preprocessor for the name of the type. Can be used to include icons.
name* string: The name of the type.
odd boolean (optional): When creating a table, indicates whether the row is odd or even.

Clone this wiki locally