API

The atelier package

This is the atelier package.

invlib

A library of invoke tasks.

invlib.utils

Utilities for atelier.invlib

invlib.tasks

This is the module that defines the invoke namespace.

jarbuilder

This is an extension for atelier.fablib for managing Java projects.

projects

A minimalistic command-line project management.

test

Defines tools for testing.

utils

Defines a series of utility classes and functions.

sheller

Defines the Sheller class for testing bash commands in a doctest.

atelier.current_project = <Project /builds/lino-framework/atelier>

The currently loaded project. An instance of atelier.Project. This is set by atelier.invlib.setup_from_tasks().

The rstgen package

class rstgen.Column(table, index, header, width=None)

Bases: object

A column in a table.

adjust_width(row)

Adjust required width of this column for the given row.

rstgen.write_header(fd, level, text)

Write the string text to file fd as a header of the given level. See header().

class rstgen.Table(headers, show_headers=True)

Bases: object

Used to render a table.

write(fd, data=[])

rstgen.table([‘header1’,’header2’]) no longer raises an exception “No rows in []” but renders a table with only headers and no rows.

rstgen.ul(items, bullet='-')

Render the given items as a bullet list. items must be an iterable whose elements are strings.

If at least one item contains more than one paragraph, then all items are separated by an additional blank line.

>>> print(ul(["Foo", "Bar", "Baz"]))
- Foo
- Bar
- Baz

>>> print(ul([
...   "Foo", "An item\nwith several lines of text.", "Bar"]))
- Foo
- An item
  with several lines of text.
- Bar

>>> print(ul([
...   "A first item\nwith several lines of text.",
...   "Another item with a nested paragraph:\n\n  Like this.\n\nWow."]))

- A first item
  with several lines of text.

- Another item with a nested paragraph:

    Like this.

  Wow.
rstgen.ol(items, bullet='#.')

Convert the given items into an ordered list.

items must be an iterable whose elements are strings.

>>> print(ol(["Foo", "Bar", "Baz"]))
#. Foo
#. Bar
#. Baz

>>> print(ol([
...   "Foo", "An item\nwith several lines of text.", "Bar"]))
#. Foo
#. An item
   with several lines of text.
#. Bar

>>> print(ol([
...   "A first item\nwith several lines of text.",
...   "Another item with a nested paragraph:\n\n  Like this.\n\nWow."]))

#. A first item
   with several lines of text.

#. Another item with a nested paragraph:

     Like this.

   Wow.
rstgen.boldheader(title)

Convert the given string into bold string, prefixed and followed by newlines.

rstgen.toctree(*children, **options)

Return a toctree directive with specified options and children.

Usage examples

>>> toctree('a', 'b', 'c', maxdepth=2)
'\n\n.. toctree::\n    :maxdepth: 2\n\n    a\n    b\n    c\n'
>>> toctree('a', 'b', 'c', hidden=True)
'\n\n.. toctree::\n    :hidden:\n\n    a\n    b\n    c\n'
rstgen.attrtable(rows, cols)

A shortcut for rendering a table showing the given attributes for each object.

Arguments:

rows: an iterator of objects cols: a string with a space-separated list of attribute names

The sphinxfeed package

See https://github.com/lsaffre/sphinxfeed

sphinxfeed.setup(app)

see: http://sphinx.pocoo.org/ext/appapi.html this is the primary extension point for Sphinx

sphinxfeed.create_feed_item(app, pagename, templatename, ctx, doctree)

Here we have access to nice HTML fragments to use in, say, an RSS feed.