linuxdoc.rstKernelDoc module

rstKernelDoc

Implementation of the kernel-doc reST-directive.

The kernel-doc (KernelDoc) directive includes contend from linux kernel source code comments.

exception linuxdoc.rstKernelDoc.FaultyOption[source]

Bases: Exception

class linuxdoc.rstKernelDoc.KernelDoc(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: Directive

KernelDoc (kernel-doc) directive

errMsg(msg)[source]
final_argument_whitespace = True

May the final argument contain whitespace?

getNodes()[source]
getParserOptions()[source]
option_spec = {'debug': <function flag>, 'doc': <function unchanged_required>, 'encoding': <function encoding>, 'exp-ids': <function unchanged_required>, 'exp-method': <function unchanged_required>, 'export': <function unchanged>, 'functions': <function unchanged_required>, 'internal': <function unchanged>, 'known-attrs': <function unchanged_required>, 'language': <function unchanged_required>, 'linenos': <function flag>, 'man-sect': <function nonnegative_int>, 'module': <function unchanged_required>, 'no-header': <function flag>, 'snippets': <function unchanged_required>, 'symbols': <function unchanged_required>}

Mapping of option names to validator functions.

optional_arguments = 0

Number of optional arguments after the required arguments.

parseSource(opts)[source]
required_arguments = 1

Number of required directive arguments.

run()[source]
class linuxdoc.rstKernelDoc.KernelDocParser(app, *args, **kwargs)[source]

Bases: Parser

debug(message, **replace)[source]
error(message, **replace)[source]
info(message, **replace)[source]
warn(message, **replace)[source]
linuxdoc.rstKernelDoc.PARSER_CACHE = <linuxdoc.rstKernelDoc.ParserCache object>

ToDo: this type of cache (in process) does not (fully) support sphinx’s paralell build (job option -j N) where builds are spanned over processes. Sphinx-build creates a new job (process) not for each kernel-doc directive but for each rest-file (that contains at least one kernel-doc directive).

class linuxdoc.rstKernelDoc.ParserCache[source]

Bases: object

A simple (in process) cache for KernelDocParser objects (read PARSER_CACHE)

get(opts)[source]
get_id(opts)[source]

Generate a cache ID from the options of the kernel-doc directive. Some of the options control the parsing rules and thus in the end the parsing result.

set(opts, parser)[source]
class linuxdoc.rstKernelDoc.WriterList(parser, *args, **kwargs)[source]

Bases: ViewList

docutils ViewList with write method.

flush()[source]
write(cont)[source]
linuxdoc.rstKernelDoc.setup(app)[source]