doc – Automated documentation generation

This namespace module provides classes that can be used for generating documentation (in HTML, DocBook and XSL-FO).

ll.xist.ns.doc.explain(thing, name=None, format=None, context=[])[source]

Return a XML representation of the doc string of thing, which can be a function, method, class or module.

If thing is not a module, you must pass the context in context, i.e. a list of names of objects into which thing is nested. This means the first entry will always be the module name, and the other entries will be class names.

class ll.xist.ns.doc.base[source]

Bases: ll.xist.xsc.Element

The base of all element classes. Used for dispatching to conversion targets.

class Context[source]

Bases: ll.xist.xsc.Context

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

convert(converter)[source]

implementation of the conversion method. When you define your own element classes you have to overwrite this method and implement the desired conversion.

This method must return an instance of Node. It may not change self.

class ll.xist.ns.doc.block[source]

Bases: ll.xist.ns.doc.base

Base class for all block level elements.

class ll.xist.ns.doc.inline[source]

Bases: ll.xist.ns.doc.base

Base class for all inline elements.

class ll.xist.ns.doc.abbr[source]

Bases: ll.xist.ns.doc.inline

Abbreviation.

class Attrs[source]

Bases: ll.xist.xsc.Attrs

class title[source]

Bases: ll.xist.xsc.TextAttr

class lang[source]

Bases: ll.xist.xsc.TextAttr

__str__()[source]

Return the character content of self as a string. This means that comments and processing instructions will be filtered out. For elements you’ll get the element content.

__str__() can be used everywhere where a plain string representation of the node is required.

For example:

>>> from ll.xist.ns import html
>>> e = html.html(
...    html.head(
...       html.title("The page")
...    ),
...    html.body(
...       html.h1("The header"),
...       html.p("The content", class_="content")
...    )
... )
>>> print(e)
The pageThe headerThe content
class ll.xist.ns.doc.tab[source]

Bases: ll.xist.xsc.Element

Used for displaying a tab character in the HTML output.

convert(converter)[source]

implementation of the conversion method. When you define your own element classes you have to overwrite this method and implement the desired conversion.

This method must return an instance of Node. It may not change self.

class ll.xist.ns.doc.litblock[source]

Bases: ll.xist.ns.doc.block

A literal text block (like source code or a shell session).

class ll.xist.ns.doc.prog[source]

Bases: ll.xist.ns.doc.litblock

A literal listing of all or part of a program.

class ll.xist.ns.doc.tty[source]

Bases: ll.xist.ns.doc.litblock

A dump of a shell session.

class ll.xist.ns.doc.prompt[source]

Bases: ll.xist.ns.doc.inline

The prompt in a tty dump.

class ll.xist.ns.doc.input[source]

Bases: ll.xist.ns.doc.inline

Can be used inside a tty to mark the parts typed by the user.

class ll.xist.ns.doc.rep[source]

Bases: ll.xist.ns.doc.inline

Content that may or must be replaced by the user.

class ll.xist.ns.doc.code[source]

Bases: ll.xist.ns.doc.inline

class ll.xist.ns.doc.option[source]

Bases: ll.xist.ns.doc.code

An option for a software command.

class ll.xist.ns.doc.lit[source]

Bases: ll.xist.ns.doc.code

Inline text that is some literal value.

class ll.xist.ns.doc.func[source]

Bases: ll.xist.ns.doc.code

The name of a function or subroutine, as in a programming language.

class ll.xist.ns.doc.meth[source]

Bases: ll.xist.ns.doc.code

The name of a method or memberfunction in a programming language.

class ll.xist.ns.doc.attr[source]

Bases: ll.xist.ns.doc.code

The name of an attribute of a class/object.

class ll.xist.ns.doc.prop[source]

Bases: ll.xist.ns.doc.code

The name of a property in a programming language.

class ll.xist.ns.doc.class_[source]

Bases: ll.xist.ns.doc.code

The name of a class, in the object-oriented programming sense.

class ll.xist.ns.doc.exc[source]

Bases: ll.xist.ns.doc.code

The name of an exception class.

class ll.xist.ns.doc.markup[source]

Bases: ll.xist.ns.doc.code

A string of formatting markup in text that is to be represented literally.

class ll.xist.ns.doc.self[source]

Bases: ll.xist.ns.doc.code

Use this class when referring to the object for which a method has been called, e.g.:

this function fooifies the object <self/>;.
ll.xist.ns.doc.self_

alias of ll.xist.ns.doc.self

class ll.xist.ns.doc.cls[source]

Bases: ll.xist.ns.doc.inline

Use this class when referring to the object for which a class method has been called, e.g.:

this function fooifies the class <cls/>.
class ll.xist.ns.doc.obj[source]

Bases: ll.xist.ns.doc.code

A object of unspecified type.

class ll.xist.ns.doc.mod[source]

Bases: ll.xist.ns.doc.code

The name of a Python module.

class ll.xist.ns.doc.file[source]

Bases: ll.xist.ns.doc.code

The name of a file.

class ll.xist.ns.doc.dir[source]

Bases: ll.xist.ns.doc.code

The name of a directory.

class ll.xist.ns.doc.user[source]

Bases: ll.xist.ns.doc.code

The name of a user account.

class ll.xist.ns.doc.host[source]

Bases: ll.xist.ns.doc.code

The name of a computer.

class ll.xist.ns.doc.const[source]

Bases: ll.xist.ns.doc.code

The name of a constant.

class ll.xist.ns.doc.data[source]

Bases: ll.xist.ns.doc.code

The name of a data object.

class ll.xist.ns.doc.app[source]

Bases: ll.xist.ns.doc.inline

The name of a software program.

class Attrs[source]

Bases: ll.xist.xsc.Attrs

class moreinfo[source]

Bases: ll.xist.xsc.URLAttr

class ll.xist.ns.doc.h[source]

Bases: ll.xist.ns.doc.base

The text of the title of a section or an example.

class ll.xist.ns.doc.section[source]

Bases: ll.xist.ns.doc.block

A recursive section.

class Attrs[source]

Bases: ll.xist.xsc.Attrs

class role[source]

Bases: ll.xist.xsc.TextAttr

class id[source]

Bases: ll.xist.xsc.IDAttr

class ll.xist.ns.doc.p[source]

Bases: ll.xist.ns.doc.block

A paragraph.

class Attrs[source]

Bases: ll.xist.xsc.Attrs

class type[source]

Bases: ll.xist.xsc.TextAttr

class ll.xist.ns.doc.dt[source]

Bases: ll.xist.ns.doc.block

A term inside a dl.

class ll.xist.ns.doc.li[source]

Bases: ll.xist.ns.doc.block

A wrapper for the elements of a list item in ul or ol.

class ll.xist.ns.doc.dd[source]

Bases: ll.xist.ns.doc.block

A wrapper for the elements of a list item dl.

class ll.xist.ns.doc.list[source]

Bases: ll.xist.ns.doc.block

Common baseclass for ul, ol and dl.

class ll.xist.ns.doc.ul[source]

Bases: ll.xist.ns.doc.list

A list in which each entry is marked with a bullet or other dingbat.

class ll.xist.ns.doc.ol[source]

Bases: ll.xist.ns.doc.list

A list in which each entry is marked with a sequentially incremented label.

class ll.xist.ns.doc.dl[source]

Bases: ll.xist.ns.doc.list

A list in which each entry is marked with a label.

class ll.xist.ns.doc.example[source]

Bases: ll.xist.ns.doc.block

A formal example.

class ll.xist.ns.doc.a[source]

Bases: ll.xist.ns.doc.inline

A hypertext link.

class Attrs[source]

Bases: ll.xist.xsc.Attrs

class href[source]

Bases: ll.xist.xsc.URLAttr

class hreflang[source]

Bases: ll.xist.xsc.TextAttr

class ll.xist.ns.doc.xref[source]

Bases: ll.xist.ns.doc.inline

An internal cross reference.

class Attrs[source]

Bases: ll.xist.xsc.Attrs

class ref[source]

Bases: ll.xist.xsc.TextAttr

class ll.xist.ns.doc.email[source]

Bases: ll.xist.ns.doc.inline

An email address.

class ll.xist.ns.doc.em[source]

Bases: ll.xist.ns.doc.inline

Emphasized text.

class ll.xist.ns.doc.strong[source]

Bases: ll.xist.ns.doc.inline

Emphasized text.

class ll.xist.ns.doc.z[source]

Bases: ll.xist.ns.doc.inline

Put the content into double quotes.

convert(converter)[source]

implementation of the conversion method. When you define your own element classes you have to overwrite this method and implement the desired conversion.

This method must return an instance of Node. It may not change self.

class ll.xist.ns.doc.pyref[source]

Bases: ll.xist.ns.doc.inline

Reference to a Python object: module, class, method, property or function.

class Attrs[source]

Bases: ll.xist.xsc.Attrs

class module[source]

Bases: ll.xist.xsc.TextAttr

class class_[source]

Bases: ll.xist.xsc.TextAttr

class method[source]

Bases: ll.xist.xsc.TextAttr

class property[source]

Bases: ll.xist.xsc.TextAttr

class function[source]

Bases: ll.xist.xsc.TextAttr

class Context[source]

Bases: ll.xist.xsc.Context

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

convert(converter)[source]

implementation of the conversion method. When you define your own element classes you have to overwrite this method and implement the desired conversion.

This method must return an instance of Node. It may not change self.

class ll.xist.ns.doc.fodoc[source]

Bases: ll.xist.ns.doc.base

convert(converter)[source]

implementation of the conversion method. When you define your own element classes you have to overwrite this method and implement the desired conversion.

This method must return an instance of Node. It may not change self.