rstgen.sphinxconf.blog

This Sphinx extension defines the blogger_year and blogger_index directives.

Usage: add the following to your conf.py:

extensions += ['rstgen.sphinxconf.blog']

And usually this file structure:

  • docs/blog/index.rst –> contains a main_blogindex directive (hidden toctree)

Individual blog entries are automatically created by inv blog, leading to a file structure like this:

  • docs/blog/2013/index.rst –> contains a blogger_year directive

  • docs/blog/2013/0107.rst –> a blog entry

  • docs/blog/2013/0108.rst –> another blog entry

  • docs/blog/2013/0108b.rst –> a second blog entry on January 8

The inv blog command automatically creates yearly directories and index.rst files when needed.

If you want a second separate blog entry on a same day, you must manually create a file.

Thanks to

Functions

get_all_entries(env)

get_blogger_years(env, blogname)

monthname(n, language)

Return the monthname for month # n in specified language.

navigator(years, current)

years is an iterable of BloggerYear instances.

setup(app)

year2docname(y)

Classes

BloggerDay(*args, **kwargs)

BloggerYear(env)

A BloggerYear instance is created for each blogger_year directive.

LatestEntriesDirective(name, arguments, ...)

Directive to insert a list of the latest blog entries.

MainBlogIndexDirective(name, arguments, ...)

Directive to insert a blog master archive page toctree

YearBlogIndexDirective(name, arguments, ...)

Directive to insert a year's calendar

rstgen.sphinxconf.blog.monthname(n, language)

Return the monthname for month # n in specified language.

class rstgen.sphinxconf.blog.BloggerYear(env)

Bases: object

A BloggerYear instance is created for each blogger_year directive.

rstgen.sphinxconf.blog.navigator(years, current)

years is an iterable of BloggerYear instances.

class rstgen.sphinxconf.blog.MainBlogIndexDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)

Bases: InsertInputDirective

Directive to insert a blog master archive page toctree

class rstgen.sphinxconf.blog.YearBlogIndexDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)

Bases: InsertInputDirective

Directive to insert a year’s calendar

class rstgen.sphinxconf.blog.LatestEntriesDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)

Bases: InsertInputDirective

Directive to insert a list of the latest blog entries.