ablog/docs/index.rst

111 lines
2.6 KiB
ReStructuredText
Raw Normal View History

2014-04-27 16:58:25 -07:00
ABlog for Sphinx
================
It's a Blog... It's a Documentation... It's Sphinx with ABlog
ABlog is a Sphinx extension that can convert any documentation or personal
website project into a full-fledged blog with:
2014-04-27 16:58:25 -07:00
* `Atom feeds <http://ablog.readthedocs.org/blog/atom.xml>`_
* :ref:`archives`
* :ref:`sidebars`
* :ref:`disqus-integration`
* :ref:`fa` integration
2014-04-27 16:58:25 -07:00
Looking for an example? Just browse this documentation ;)
2014-04-27 16:58:25 -07:00
Installation
------------
2014-04-27 16:58:25 -07:00
You can install ABlog using pip_::
2014-05-11 21:10:34 -07:00
pip install -U ablog
2014-05-11 21:10:34 -07:00
In addition to Sphinx_, Werkzeug_ is required for generating feeds.
2014-04-27 16:58:25 -07:00
Configuration
-------------
To enable blogging in a Sphinx project, append ``ablog`` to the
list of extensions and ABlog template path to :confval:`templates_path`
2014-04-27 16:58:25 -07:00
in :file:`conf.py`:
.. code-block:: python
extensions = [
'...',
'ablog'
]
2014-05-25 21:50:04 -04:00
import ablog
2014-04-27 16:58:25 -07:00
templates_path.append(ablog.get_html_templates_path())
# if `templates_path` is not defined before
templates_path = [ablog.get_html_templates_path()]
See more detailed instructions in :ref:`ablog-configuration-options`
and :ref:`posting-and-listing` posts.
2014-04-27 16:58:25 -07:00
**Read The Docs**
On `Read The Docs`_, ABlog may cause an exception when Sphinx build environment
is being pickled. To circumvent this problem, include the following
in :file:`conf.py`::
if os.environ.get('READTHEDOCS', None) == 'True':
skip_pickling = True
This should not effect how the documentation is built.
2014-04-27 16:58:25 -07:00
How it works
------------
ABlog catalogs all :file:`.rst` files indicated as posts and creates
archive pages and a blog feed. It does not interfere with Sphinx's operations,
and you do not need to change how you structure content in separate folders.
You can convert *any page*, containing a new usage example or a new release
announcement, to a post with the :rst:dir:`post` directive as follows:
.. code-block:: rst
.. post:: Apr 15, 2014
:tags: python, earth, love, peace
ABlog will include the page in specified archive pages and the blog feed.
You can include a list of posts anywhere simply using :rst:dir:`postlist`
directive:
.. code-block:: rst
.. postlist:: 2
2014-09-14 21:19:41 -07:00
:category: Release
2014-04-27 16:58:25 -07:00
2014-09-14 21:19:41 -07:00
This converts to a list of links to the most recent five posts in
:ref:`category-release` category:
.. postlist:: 2
2014-09-14 21:19:41 -07:00
:category: Release
Documentation
-------------
You can learn more about ablog features in the following posts:
2014-04-27 16:58:25 -07:00
.. postlist:: 10
2014-09-14 21:19:41 -07:00
:category: Manual
:sort:
2014-04-27 16:58:25 -07:00
Feedback
--------
2014-05-11 21:10:34 -07:00
ABlog has been used with the Sphinx_ 1.2.2, Python 2.7 and 3.4
2014-04-27 16:58:25 -07:00
to generate its documentation blog. If you try it with different
2014-05-11 21:10:34 -07:00
Python and Sphinx versions, please give feedback to help us improve it.