ablog/README.rst

119 lines
3.8 KiB
ReStructuredText
Raw Normal View History

2014-05-08 22:23:52 -07:00
ABlog for Sphinx
================
2014-05-11 21:10:34 -07:00
2015-03-01 08:59:32 -08:00
ABlog is a Sphinx extension that converts any documentation or personal
website project into a full-fledged blog with:
2015-03-01 09:50:39 -08:00
* `Atom feeds`_
* `Archive pages`_
* `Blog sidebars`_
2015-03-01 08:59:32 -08:00
* `Disqus integration`_
* `Font-Awesome integration`_
Looking for an example? Take a look at `ABlog documentation <http://ablog.readthedocs.org>`_
where each manual and release is a blog post ;)
2015-03-01 08:59:32 -08:00
2015-03-01 09:50:39 -08:00
.. _Atom feeds: http://ablog.readthedocs.org/blog/atom.xml
.. _Archive pages: http://ablog.readthedocs.org/blog/
2015-03-01 08:59:32 -08:00
.. _Blog sidebars: http://ablog.readthedocs.org/manual/ablog-configuration-options/#sidebars
.. _Disqus integration: http://ablog.readthedocs.org/manual/ablog-configuration-options/#disqus-integration
.. _Font-Awesome integration: http://ablog.readthedocs.org/manual/ablog-configuration-options/#fa
2015-02-25 23:24:19 -08:00
Installation
------------
You can install ABlog using pip_::
pip install -U ablog
2015-03-02 21:10:07 -08:00
This will also install `Sphinx <http://sphinx-doc.org/>`_, Alabaster_, and
Werkzeug_, respectively required for building your website, making it look
good, and generating feeds.
2015-02-25 23:24:19 -08:00
2015-03-01 09:01:20 -08:00
.. _pip: https://pip.pypa.io
.. _Werkzeug: http://werkzeug.pocoo.org/
2015-03-01 09:35:16 -08:00
.. _Alabaster: https://github.com/bitprophet/alabaster
2015-03-01 09:01:20 -08:00
2015-02-25 23:24:19 -08:00
Getting Started
---------------
2015-03-01 09:35:16 -08:00
If you are starting a new project, see `ABlog Quick Start`_ guide.
2015-02-25 23:24:19 -08:00
2015-03-01 12:32:36 -08:00
If you already have a project, enable blogging by making following changes in ``conf.py``:
2015-02-25 23:24:19 -08:00
.. code-block:: python
2015-03-01 12:32:36 -08:00
# 1. Append 'ablog' to list of extensions
2015-02-25 23:24:19 -08:00
extensions = [
'...',
'ablog'
]
2015-03-01 12:32:36 -08:00
# 2a. Append templates path to `templates_path`
2015-02-25 23:24:19 -08:00
import ablog
templates_path.append(ablog.get_html_templates_path())
2015-03-01 09:50:39 -08:00
# 2b. If `templates_path` is not defined before
2015-02-25 23:24:19 -08:00
templates_path = [ablog.get_html_templates_path()]
2015-03-01 12:32:36 -08:00
If you also installed Alabaster_, see how to configure it here_.
2015-02-25 23:24:19 -08:00
2015-03-01 09:35:16 -08:00
.. _ABlog Quick Start: http://ablog.readthedocs.org/manual/ablog-quick-start
2015-03-01 12:44:21 -08:00
.. _here: https://github.com/bitprophet/alabaster#installation
2015-02-25 23:24:19 -08:00
How it works
------------
If you are new to Sphinx_ and reStructuredText markup language,
2015-03-01 12:43:41 -08:00
you might find `reStructuredText Primer`_ useful. Once you have
some content (in ``.rst`` files), you can post *any page* using
2015-03-01 12:43:41 -08:00
the ``post`` directive as follows:
2015-02-25 23:24:19 -08:00
.. code-block:: rst
.. post:: Apr 15, 2014
2015-03-01 12:32:36 -08:00
:tags: earth, love, peace
:category: python
:author: me
:location: SF
:language: en
2015-03-01 09:35:16 -08:00
2015-03-01 12:46:47 -08:00
ABlog will index all files posted as above. When building HTML pages,
it will create archives and feeds that list these posts as
specified by ``:tag:``, ``:category:``, etc. options.
2015-03-01 09:45:02 -08:00
2015-03-01 12:46:47 -08:00
You can also include a list of posts using ``postlist`` directive:
2015-02-25 23:24:19 -08:00
.. code-block:: rst
2015-03-01 09:35:16 -08:00
.. postlist:: 5
:category: Manual
2015-03-01 09:45:02 -08:00
:reverse:
2015-03-01 12:47:43 -08:00
For ABlog documentation, this converts to the following list of links that you
can follow to learn more about configuring and using ABlog:
2015-02-25 23:24:19 -08:00
* `Posting and Listing <http://ablog.readthedocs.org/manual/posting-and-listing/>`_
* `ABlog Configuration Options <http://ablog.readthedocs.org/manual/ablog-configuration-options/>`_
2015-03-01 09:45:02 -08:00
* `Cross-referencing Blog Pages <http://ablog.readthedocs.org/manual/cross-referencing-blog-pages/>`_
* `Post Excerpts and Images <http://ablog.readthedocs.org/manual/post-excerpts-and-images/>`_
2015-03-01 09:51:13 -08:00
* `Posting Sections <http://ablog.readthedocs.org/manual/posting-and-listing/#posting-sections>`_
2015-02-25 23:24:19 -08:00
2015-03-01 12:45:07 -08:00
.. _reStructuredText Primer: http://sphinx-doc.org/rest.html
2015-03-01 12:43:41 -08:00
For existing projects, it is important to note that ABlog does not intertere
2015-03-01 12:43:41 -08:00
with any Sphinx operations. Since you can post any page from any folder,
you do not need to change how you organize project contents.
2015-02-25 23:24:19 -08:00
2015-03-01 14:13:45 -08:00
.. image:: https://secure.travis-ci.org/abakan/ablog.png?branch=devel
:target: http://travis-ci.org/#!/abakan/ablog
.. image:: https://pypip.in/v/ABlog/badge.png
:target: https://pypi.python.org/pypi/ABlog
.. image:: https://pypip.in/d/ABlog/badge.png
:target: https://crate.io/packages/ablog