API

class tests.test_yaml.YamlTests(methodName='runTest')
build_path = '_build/text/docfx_yaml'

Path of all the yaml files.

test_alert_box()

Test whether alert boxes are generated correctly. Avaliable alert boxes are Note, Warning, Tip and Important

test_enum()

Test enum type support

test_examples()

Test example contents

Test external link should be written in markdown format.

test_google_format()

Test google-style docstring.

test_index()

Test index information of project.

test_inheritance()

Test multiple inheritance is properly resolved.

test_name()

Test whether names are generated correctly.

test_numpy_format()

Test numpy-style docstring.

test_references()

Test references are properly inserted.

test_seealso()

Test seealso contents

test_source()

Test source info is parsed properly.

test_summary()

Test module/package/class summary being extracted.

test_toc()

Test toc structure.

test_uid()

Test whether uids are generated correctly.

yaml_files = {'class_files': {'google': ['format.google.foo.Foo.yml', 'format.google.foo.FooException.InternalFoo.yml', 'format.google.foo.FooException.yml'], 'numpy': ['format.numpy.foo.Foo.yml', 'format.numpy.foo.FooException.InternalFoo.yml', 'format.numpy.foo.FooException.yml'], 'rst': ['format.rst.directives.DirectivesFoo.yml', 'format.rst.enum.EnumFoo.yml', 'format.rst.foo.Foo.yml', 'format.rst.foo.FooException.InternalFoo.yml', 'format.rst.foo.FooException.yml', 'format.rst.foo.InheritFoo.yml'], 'namespacepackage': ['nspkg.native.native_foo.Foo.yml', 'nspkg.pkgutil.pkgutil_foo.Foo.yml', 'nspkg.pkg_resources.pkg_resources_foo.Foo.yml']}, 'module_files': {'google': ['format.google.foo.yml'], 'numpy': ['format.numpy.foo.yml'], 'rst': ['format.rst.directives.yml', 'format.rst.enum.yml', 'format.rst.foo.yml']}, 'package_files': {'namesapcepackage': ['nspkg.yml', 'nspkg.native.native_foo.yml', 'nspkg.pkgutil.yml', 'nspkg.pkgutil.pkgutil_foo.yml', 'nspkg.pkg_resources.yml', 'nspkg.pkg_resources.pkg_resources_foo.yml'], 'format': ['format.yml', 'format.rst.yml', 'format.google.yml', 'format.numpy.yml']}}
tests.test_yaml.sphinx_build(test_dir)

Use contextmanager to ensure build cleaning after testing.

Sphinx DocFX YAML Top-level Extension.

This extension allows you to automagically generate DocFX YAML from your Python AutoAPI docs.

class docfx_yaml.extension.Bcolors
BOLD = '\x1b[1m'
ENDC = '\x1b[0m'
FAIL = '\x1b[91m'
HEADER = '\x1b[95m'
OKBLUE = '\x1b[94m'
OKGREEN = '\x1b[92m'
UNDERLINE = '\x1b[4m'
WARNING = '\x1b[93m'
docfx_yaml.extension.build_finished(app, exception)

Output YAML on the file system.

docfx_yaml.extension.build_init(app)

Set up environment data

docfx_yaml.extension.enumerate_cleaned_signature(doc, max_args=20)
docfx_yaml.extension.enumerate_extract_signature(doc, max_args=20)
docfx_yaml.extension.insert_children_on_class(app, _type, datam)

Insert children of a specific class

docfx_yaml.extension.insert_children_on_function(app, _type, datam)

Insert children of a specific class

docfx_yaml.extension.insert_children_on_module(app, _type, datam)

Insert children of a specific module

docfx_yaml.extension.insert_inheritance(app, _type, obj, datam)
docfx_yaml.extension.missing_reference(app, env, node, contnode)
docfx_yaml.extension.process_docstring(app, _type, name, obj, options, lines)

This function takes the docstring and indexes it into memory.

docfx_yaml.extension.process_signature(app, _type, name, obj, options, signature, return_annotation)
docfx_yaml.extension.setup(app)

Plugin init for our Sphinx extension.

Parameters:app (Application) – The Sphinx application instance
docfx_yaml.monkeypatch.patch_docfields(app)

Grab syntax data from the Sphinx info fields.

This is done by monkeypatching into the DocFieldTransformer, which is what Sphinx uses to transform the docutils nodes.field into the sphinx docfields.Field objects.

See usage in Sphinx here.

This also performs the RST doctree to Markdown transformation on the content, using the docfx_yaml.writers.MarkdownWriter.