Returns the code snippet for a code element as markdown string.
The element to create a code snippet for, the name can be qualified with :: to specify the class.
Optionalfmt: Omit<FnElementInfo, "info" | "program">Formatting options for the code snippet (see FnElementInfo)
Optionalfilter: ElementFilterAn optional filter to further specify the element to get the code for, in case multiple elements with the same name exist.
code(exampleFn.name, { dropLinesStart: 1, dropLinesEnd: 2 })
Creates a code snippet for the exampleFn function in the code base,
dropping the first and last two lines of the function definition.
If, for example, the function looks like this:
function exampleFn(a: number, b: number): number {
// This is an example
const result = a + b;
return result;
}
The resulting code snippet will be (auto-gobbled by default):
// This is an example
const result = a + b;
printCodeOfElement - for the underlying impl.
Returns the documentation for a code element as markdown string.
If you want to, e.g., prefix all of these lines with indentation or > for blockquotes,
use prefixLines.
The element to create documentation for, the name can be qualified with :: to specify the class.
Optionalfilter: Omit<ElementFilter, "file">An optional filter to further specify the element to get the documentation for, in case multiple elements with the same name exist.
doc(exampleFn.name)
Creates the documentation for the exampleFn function in the code base as markdown string.
Generates an auto-generation header for the wiki page.
The name of the file being generated. Probably use module.filename.
The purpose of the file, e.g., 'wiki context for types'.
Returns the hierarchy (e.g., class inheritance) for a code element as markdown string, including their documentation and snippets.
The element to create a hierarchy for, the name can be qualified with :: to specify the class.
Optionalfmt: Omit<PrintHierarchyArguments, "info" | "root" | "program">Formatting options for the hierarchy (see PrintHierarchyArguments)
Optionalfilter: ElementFilterAn optional filter to further specify the element to get the hierarchy for, in case multiple elements with the same name exist.
hierarchy(MyClass.name, { maxDepth: 2 })
Creates the hierarchy for the MyClass class in the code base,
including up to two levels of inheritance.
printHierarchy - for the underlying impl.
Generate a hyperlink to a code element in the wiki.
If you want to reference the member of a class, use ClassName::MemberName as element name.
For ease of use, you can also call linkM to create a link to a member.
The element to create a link for, the name can be qualified with :: to specify the class.
This causes the link to be usually printed as ClassName::ElementName. If you want to avoid showing
the class name, use ::: as separator. Please note that for elements with a sensible (.name),
you can also pass the function/constructor reference directly (e.g., link(MyClass)).
Optionalfmt: LinkFormatFormatting options for the link (see LinkFormat)
Optionalfilter: ElementFilterAn optional filter to further specify the element to link to, in case multiple elements with the same name exist.
link(registerPluginMaker.name)
Creates a (markdown) link to the registerPluginMaker function in the code base
and, if available, attaches the TS documentation as tooltip.
By using the .name, the link text will be registerPluginMaker but respect, e.g., renaming refactorings done in the code base.
Generate a hyperlink to a type/element definition in the code base which is displayed using the file path as name
The element to create a link for, the name can be qualified with :: to specify the class.
linkFile(registerPluginMaker.name)
Creates a (markdown) link to the registerPluginMaker function in the code base
using the file path as link name.
Generate a hyperlink to a member of a class in the wiki. This is a convenience method around link.
Optionalfmt: LinkFormat & { hideClass?: boolean }Optionalfilter: ElementFilterGenerates a mermaid diagram for the given code element, returned as markdown string.
The element to create a mermaid diagram for, the name can be qualified with :: to specify the class.
OptionalinlineTypes: string[]Optional list of type names to inline in the mermaid diagram (instead of linking them out).
Provides methods to generate links, code snippets, and documentation for code elements. These wrap around a collection of useful helpers originating from the doc utils. To create an instance, use makeDocContextForTypes (although if you are writing a wiki, you get such an instance).