atelier.sphinxconf.blog

(This module’s source code is available here.)

This Sphinx extension defines the blogger_year and blogger_index directives.

Usage: add the following to your conf.py:

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

And usually this file structure:

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

Individual blog entries, including yearly directories and index.rst files, are automatically created by fab 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/2010/0107.rst

Thanks to

Functions

docname_to_day(year, s)
format_date([date, format, locale]) Return a date formatted according to the given pattern.
monthname(n, language) Return the monthname for month # n in specified language.
setup(app)

Classes

InsertInputDirective(name, arguments, ...) Base class for directives that work by generating rst markup to be forwarded to state_machine.insert_input().
MainBlogIndexDirective(name, arguments, ...) Directive to insert a blog master archive page toctree
Year(env) A Year instance is created for each blogger_year directive.
YearBlogIndexDirective(name, arguments, ...) Directive to insert a year’s calendar
class atelier.sphinxconf.blog.MainBlogIndexDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)

Directive to insert a blog master archive page toctree

class atelier.sphinxconf.blog.Year(env)

A Year instance is created for each blogger_year directive.

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

Directive to insert a year’s calendar

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

Return the monthname for month # n in specified language.