Skip to content

Commit b717f06

Browse files
author
Thomas Grainger
committed
Include readme and changelog in docs Fixes #12
1 parent 70afcc3 commit b717f06

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

django_babel/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# -*- coding: utf-8 -*-
2+
from pkg_resources import get_distribution
23

3-
__version__ = '1.0-dev'
4+
__version__ = get_distribution('django-babel').version

docs/conf.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
import sys
1717
import os
1818

19+
import django_babel
20+
21+
22+
def _short_version(release):
23+
parts = release.split('.')
24+
return '.'.join(parts[:2])
25+
26+
1927
# If extensions (or modules to document with autodoc) are in another directory,
2028
# add these directories to sys.path here. If the directory is relative to the
2129
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -30,7 +38,11 @@
3038
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3139
# ones.
3240
extensions = [
41+
'sphinx.ext.autodoc',
42+
'sphinx.ext.autosummary',
3343
'sphinx.ext.intersphinx',
44+
'sphinx.ext.todo',
45+
'sphinx.ext.viewcode',
3446
]
3547

3648
# Add any paths that contain templates here, relative to this directory.
@@ -52,11 +64,11 @@
5264
# The version info for the project you're documenting, acts as replacement for
5365
# |version| and |release|, also used in various other places throughout the
5466
# built documents.
55-
#
56-
# The short X.Y version.
57-
version = '0.3.4'
67+
5868
# The full version, including alpha/beta/rc tags.
59-
release = '0.3.4'
69+
release = django_babel.__version__
70+
# The short X.Y version.
71+
version = _short_version(release)
6072

6173
# The language for content autogenerated by Sphinx. Refer to documentation
6274
# for a list of supported languages.
@@ -261,4 +273,4 @@
261273

262274

263275
# Example configuration for intersphinx: refer to the Python standard library.
264-
intersphinx_mapping = {'http://docs.python.org/': None}
276+
intersphinx_mapping = {'https://docs.python.org/': None}

docs/index.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6+
========================================
67
Welcome to django-babel's documentation!
78
========================================
89

10+
.. include:: ../README.rst
11+
.. include:: ../CHANGELOG.rst
12+
913
Contents:
1014

1115
.. toctree::
@@ -19,4 +23,3 @@ Indices and tables
1923
* :ref:`genindex`
2024
* :ref:`modindex`
2125
* :ref:`search`
22-

0 commit comments

Comments
 (0)