ablog/docs/index.rst

123 lines
3.2 KiB
ReStructuredText
Raw Normal View History

2014-04-27 16:58:25 -07:00
ABlog for Sphinx
================
ABlog is a Sphinx extension that converts any documentation or personal
website project into a full-fledged blog with:
2014-04-27 16:58:25 -07:00
* `Atom feeds`_
* `Archive pages`_
* `Blog sidebars`_
* `Disqus integration`_
* `Font-Awesome integration`_
2015-04-13 21:37:20 -07:00
* `Easy GitHub Pages deploys`_
2014-04-27 16:58:25 -07:00
.. _Atom feeds: http://ablog.readthedocs.org/blog/atom.xml
.. _Archive pages: http://ablog.readthedocs.org/blog/
.. _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-04-13 21:37:20 -07:00
.. _Easy GitHub Pages deploys: http://ablog.readthedocs.org/manual/deploy-to-github-pages/
2014-04-27 16:58:25 -07:00
.. _installation:
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
2015-04-08 22:53:58 -07:00
This will also install `Sphinx <http://sphinx-doc.org/>`_, Alabaster_,
2015-07-05 00:02:59 -07:00
Werkzeug_, Invoke_, dateutil_ respectively required for building your website,
making it look good, generating feeds, running deploy commands, and parsing
dates.
.. _pip: https://pip.pypa.io
.. _Werkzeug: http://werkzeug.pocoo.org/
.. _Alabaster: https://github.com/bitprophet/alabaster
2015-04-08 22:53:58 -07:00
.. _Invoke: http://www.pyinvoke.org/
2015-07-05 00:02:59 -07:00
.. _dateutil: https://pypi.python.org/pypi/python-dateutil
2015-02-25 23:24:19 -08:00
Getting Started
---------------
If you are starting a new project, see `ABlog Quick Start`_ guide.
2014-04-27 16:58:25 -07:00
If you already have a project, enable blogging by making following changes in ``conf.py``:
2014-04-27 16:58:25 -07:00
.. code-block:: python
2015-03-27 13:16:01 -07:00
# 1. Add 'ablog' to list of extensions
2014-04-27 16:58:25 -07:00
extensions = [
'...',
'ablog'
]
2015-03-27 13:16:01 -07:00
# 2. Add ablog templates path
2014-05-25 21:50:04 -04:00
import ablog
2015-03-23 23:03:03 -07:00
# 2a. if `templates_path` is not defined
templates_path = [ablog.get_html_templates_path()]
# 2b. if `templates_path` is defined
2014-04-27 16:58:25 -07:00
templates_path.append(ablog.get_html_templates_path())
.. _ABlog Quick Start: http://ablog.readthedocs.org/manual/ablog-quick-start
2014-04-27 16:58:25 -07:00
How it works
------------
If you are new to Sphinx_ and reStructuredText markup language,
you might find `reStructuredText Primer`_ useful. Once you have
2015-03-23 23:03:03 -07:00
content (in ``.rst`` files), you can post *any page* using the
2015-07-12 21:50:41 -07:00
:rst:dir:`post` directive as follows:
2014-04-27 16:58:25 -07:00
.. _reStructuredText Primer: http://sphinx-doc.org/rest.html
2014-04-27 16:58:25 -07:00
.. code-block:: rst
.. post:: Apr 15, 2014
:tags: earth, love, peace
:category: python
:author: me
:location: SF
:language: en
2014-04-27 16:58:25 -07:00
2015-03-23 23:03:03 -07:00
ABlog will index all files posted as above and list them in archives and feeds
specified in ``:tag:``, ``:category:``, etc. options.
2014-04-27 16:58:25 -07:00
2015-07-12 21:50:41 -07:00
You can also include a list of posts using :rst:dir:`postlist` directive:
2014-04-27 16:58:25 -07:00
.. code-block:: rst
.. postlist::
:list-style: circle
:category: Manual
:format: {title}
2015-03-28 20:09:09 -07:00
:sort:
2014-09-14 21:19:41 -07:00
2015-03-23 23:03:03 -07:00
For ABlog documentation, this converts to the following where you
can find more about configuring and using ABlog:
2014-04-27 16:58:25 -07:00
.. postlist::
:category: Manual
:list-style: circle
:format: {title}
:sort:
2014-09-14 21:19:41 -07:00
2015-05-03 07:18:41 -07:00
.. only:: html
2015-03-01 14:13:45 -08:00
2018-02-17 13:54:34 +01:00
.. image:: https://secure.travis-ci.org/sunpy/ablog.png?branch=devel
:target: http://travis-ci.org/#!/sunpy/ablog
2015-03-01 14:13:45 -08:00
2015-05-03 07:18:41 -07:00
.. image:: https://readthedocs.org/projects/ablog/badge/?version=latest
:target: http://ablog.readthedocs.org/
.. toctree::
:hidden:
:glob:
2015-07-05 00:02:59 -07:00
*/*