robot.libdocpkg package

Implements the Libdoc tool.

The public Libdoc API is exposed via the robot.libdoc module.

Submodules

robot.libdocpkg.builder module

robot.libdocpkg.builder.LibraryDocumentation(library_or_resource, name=None, version=None, doc_format=None)[source]

Generate keyword documentation for the given library, resource or suite file.

Parameters:
  • library_or_resource – Name or path of the library, or path of a resource or a suite file.

  • name – Set name with the given value.

  • version – Set version to the given value.

  • doc_format – Set documentation format to the given value.

Returns:

LibraryDoc instance.

This factory method is the recommended API to generate keyword documentation programmatically. It should be imported via the robot.libdoc module.

Example:

from robot.libdoc import LibraryDocumentation

lib = LibraryDocumentation('OperatingSystem')
print(lib.name, lib.version)
for kw in lib.keywords:
    print(kw.name)
class robot.libdocpkg.builder.DocumentationBuilder[source]

Bases: object

Keyword documentation builder.

This is not part of Libdoc’s public API. Use LibraryDocumentation() instead.

build(source)[source]

robot.libdocpkg.consoleviewer module

class robot.libdocpkg.consoleviewer.ConsoleViewer(libdoc)[source]

Bases: object

classmethod handles(command)[source]
classmethod validate_command(command, args)[source]
view(command, *args)[source]
list(*patterns)[source]
show(*names)[source]
version()[source]
class robot.libdocpkg.consoleviewer.KeywordMatcher(libdoc)[source]

Bases: object

search(patterns)[source]

robot.libdocpkg.datatypes module

class robot.libdocpkg.datatypes.TypeDoc(type, name, doc, accepts=(), usages=None, members=None, items=None)[source]

Bases: Sortable

ENUM = 'Enum'
TYPED_DICT = 'TypedDict'
CUSTOM = 'Custom'
STANDARD = 'Standard'
classmethod for_type(type_info, converters)[source]
classmethod for_enum(enum)[source]
classmethod for_typed_dict(typed_dict)[source]
to_dictionary()[source]
class robot.libdocpkg.datatypes.TypedDictItem(key, type, required=None)[source]

Bases: object

to_dictionary()[source]
class robot.libdocpkg.datatypes.EnumMember(name, value)[source]

Bases: object

to_dictionary()[source]

robot.libdocpkg.htmlutils module

class robot.libdocpkg.htmlutils.DocFormatter(keywords, type_info, introduction, doc_format='ROBOT')[source]

Bases: object

html(doc, intro=False)[source]
class robot.libdocpkg.htmlutils.DocToHtml(doc_format)[source]

Bases: object

class robot.libdocpkg.htmlutils.HtmlToText[source]

Bases: object

html_tags = {'b': '*', 'code': '``', 'div.*?': '', 'em': '_', 'i': '_', 'strong': '*'}
html_chars = {'&amp;': '&', '&apos;': "'", '&gt;': '>', '&lt;': '<', '&quot;': '"', '<br */?>': '\n'}
get_short_doc_from_html(doc)[source]
html_to_plain_text(doc)[source]

robot.libdocpkg.htmlwriter module

class robot.libdocpkg.htmlwriter.LibdocHtmlWriter(theme=None)[source]

Bases: object

write(libdoc, output)[source]
class robot.libdocpkg.htmlwriter.LibdocModelWriter(output, libdoc, theme=None)[source]

Bases: ModelWriter

write(line)[source]

robot.libdocpkg.jsonbuilder module

class robot.libdocpkg.jsonbuilder.JsonDocBuilder[source]

Bases: object

build(path)[source]
build_from_dict(spec)[source]

robot.libdocpkg.jsonwriter module

class robot.libdocpkg.jsonwriter.LibdocJsonWriter[source]

Bases: object

write(libdoc, outfile)[source]

robot.libdocpkg.model module

class robot.libdocpkg.model.LibraryDoc(name='', doc='', version='', type='LIBRARY', scope='TEST', doc_format='ROBOT', source=None, lineno=-1)[source]

Bases: object

Documentation for a library, a resource file or a suite file.

property doc
doc_format
inits

Initializer docs as KeywordDoc instances.

keywords

Keyword docs as KeywordDoc instances.

type_docs
property all_tags
save(output=None, format='HTML', theme=None)[source]
convert_docs_to_html()[source]
to_dictionary(include_private=False, theme=None)[source]
to_json(indent=None, include_private=True, theme=None)[source]
class robot.libdocpkg.model.KeywordDoc(name='', args=None, doc='', short_doc='', tags=(), private=False, deprecated=False, source=None, lineno=-1, parent=None)[source]

Bases: Sortable

Documentation for a single keyword or an initializer.

property short_doc
to_dictionary()[source]

robot.libdocpkg.output module

class robot.libdocpkg.output.LibdocOutput(output_path, format)[source]

Bases: object

robot.libdocpkg.output.get_generation_time()[source]

Return a timestamp that honors SOURCE_DATE_EPOCH.

This timestamp is to be used for embedding in output files, so that builds can be made reproducible.

robot.libdocpkg.robotbuilder module

class robot.libdocpkg.robotbuilder.LibraryDocBuilder[source]

Bases: object

build(library)[source]
class robot.libdocpkg.robotbuilder.ResourceDocBuilder[source]

Bases: object

type = 'RESOURCE'
build(path)[source]
class robot.libdocpkg.robotbuilder.SuiteDocBuilder[source]

Bases: ResourceDocBuilder

type = 'SUITE'
class robot.libdocpkg.robotbuilder.KeywordDocBuilder(resource=False)[source]

Bases: object

build_keywords(owner)[source]
build_keyword(kw)[source]

robot.libdocpkg.standardtypes module

robot.libdocpkg.writer module

robot.libdocpkg.writer.LibdocWriter(format=None, theme=None)[source]

robot.libdocpkg.xmlbuilder module

class robot.libdocpkg.xmlbuilder.XmlDocBuilder[source]

Bases: object

build(path)[source]

robot.libdocpkg.xmlwriter module

class robot.libdocpkg.xmlwriter.LibdocXmlWriter[source]

Bases: object

write(libdoc, outfile)[source]