Markdown¶
Overview¶
Deprecated
We have two Markdown documentation generators within the linkml framework -
gen-doc
andgen-markdown
. It is important to note that whilegen-markdown
still works, it has been deprecated (no active development) in favour of the de factogen-doc
generator.
Docs¶
Command Line¶
gen-markdown¶
Generate markdown documentation of a LinkML model.
Warning
gen-markdown is deprecated. Please use gen-doc instead.
gen-markdown [OPTIONS] YAMLFILE
Options
- -d, --dir <dir>¶
Required Output directory
- -c, --classes <classes>¶
Class(es) to emit
- -M, --map-fields <map_fields>¶
Map metamodel fields, e.g. slot=field
- -i, --img¶
Download YUML images to ‘image’ directory
- -I, --index-file <index_file>¶
Name of markdown file that holds index
- --noimages¶
Do not (re-)generate images
- --noyuml¶
Do not add yUML figures to pages
- --notypesdir¶
Do not create a separate types directory
- --warnonexist¶
Warn if output file already exists
- -V, --version¶
Show the version and exit.
- -f, --format <format>¶
Output format
- Default:
'md'
- Options:
md
- --metadata, --no-metadata¶
Include metadata in output
- Default:
True
- --useuris, --metauris¶
Use class and slot URIs over model uris
- Default:
True
- -im, --importmap <importmap>¶
Import mapping file
- --log_level <log_level>¶
Logging level
- Default:
'WARNING'
- Options:
CRITICAL | ERROR | WARNING | INFO | DEBUG
- -v, --verbose¶
Verbosity. Takes precedence over –log_level.
- --mergeimports, --no-mergeimports¶
Merge imports into source file (default=mergeimports)
- --stacktrace, --no-stacktrace¶
Print a stack trace when an error occurs
- Default:
False
Arguments
- YAMLFILE¶
Required argument
Code¶
- class linkml.generators.markdowngen.MarkdownGenerator(schema: str | ~typing.TextIO | ~linkml_runtime.linkml_model.meta.SchemaDefinition | ~linkml.utils.generator.Generator | ~pathlib.Path, schemaview: ~linkml_runtime.utils.schemaview.SchemaView | None = None, format: str | None = None, metadata: bool = True, useuris: bool | None = None, log_level: int | None = 30, mergeimports: bool | None = True, source_file_date: str | None = None, source_file_size: int | None = None, logger: ~logging.Logger | None = None, verbose: bool | None = None, output: str | None = None, namespaces: ~linkml_runtime.utils.namespaces.Namespaces | None = None, directory_output: bool = False, base_dir: str = None, metamodel_name_map: dict[str, str] = None, importmap: str | ~collections.abc.Mapping[str, str] | None = None, emit_prefixes: set[str] = <factory>, metamodel: ~linkml.utils.schemaloader.SchemaLoader = None, stacktrace: bool = False, include: str | ~pathlib.Path | ~linkml_runtime.linkml_model.meta.SchemaDefinition | None = None, directory: str | None = None, image_directory: str | None = None, classes: set[~linkml_runtime.linkml_model.meta.ClassDefinitionName] = None, image_dir: bool = False, index_file: str = 'index.md', noimages: bool = False, noyuml: bool = False, no_types_dir: bool = False, warn_on_exist: bool = False, gen_classes: set[~linkml_runtime.linkml_model.meta.ClassDefinitionName] | None = None, gen_classes_neighborhood: ~linkml.utils.typereferences.References | None = None)[source]¶
Generates markdown documentation for a LinkML schema
Each schema element (class, slot, type, enum) is translated into its own markdown file; additionally, an index.md is generated that links everything together.
The markdown is suitable for deployment as a MkDocs or Sphinx site
Deprecated
The MarkdownGenerator class is being deprecated in favor of DocGenerator which can be found at the following path – linkml/generators/docgen.py. Going forward, DocGenerator which can be invoked using the gen-doc command will be the preferred way to generate Markdown documentation files for LinkML schemas.
Deprecated since version v1.9.1.
Recommendation: Update to use gen-doc