Skip to content

Commit 397d0af

Browse files
authored
Merge pull request #24 from tobinus/refactor-documentation-#8
Refactor documentation, closes #8
2 parents c5d7b42 + 048d1b1 commit 397d0af

25 files changed

+770
-413
lines changed

doc/_static/custom.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,18 @@ body, div.body {
44
pre {
55
background-color: #ebebeb;
66
}
7+
div.sphinxsidebar a.current {
8+
text-decoration: none;
9+
border-bottom: none;
10+
font-weight: bold;
11+
cursor: text;
12+
}
13+
/* Don't hide logo when viewed on mobile, just invert its colors */
14+
@media screen and (max-width: 875px) {
15+
div.sphinxsidebar p.logo {
16+
display: block;
17+
filter: invert(100%);
18+
width: 60%;
19+
margin: auto;
20+
}
21+
}

doc/api.rst

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,6 @@
11
=================
2-
Developer's Guide
3-
=================
4-
5-
6-
-------
7-
Testing
8-
-------
9-
10-
You can test the module integration-testing-style by simply executing::
11-
12-
$ python -m podgen
13-
14-
When working on this project, you should run the unit tests as well as the
15-
integration test, like this::
16-
17-
$ make test
18-
19-
The unit tests reside in ``podgen/tests`` and are written using the
20-
:mod:`unittest` module.
21-
22-
23-
-----------------
242
API Documentation
25-
-----------------
3+
=================
264

275
.. autosummary::
286

doc/conf.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
# -- General configuration -----------------------------------------------------
1717

1818
# If your documentation needs a minimal Sphinx version, state it here.
19-
#needs_sphinx = '1.0'
19+
needs_sphinx = '1.4'
20+
21+
# Don't show warnings about the button images not being local
22+
suppress_warnings = ['image.nonlocal_uri']
2023

2124
# Add any Sphinx extension module names here, as strings. They can be extensions
2225
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
@@ -103,12 +106,11 @@
103106
'fixed_sidebar': False,
104107
'page_width': "1000px",
105108
'sidebar_width': "225px",
106-
'show_related': True,
107109
'body_text': "rgba(0, 0, 0, 0.8)",
108110
'footer_text': "rgba(0, 0, 0, 0.5)",
109111
'gray_1': "rgba(0, 0, 0, 0.9)",
110112
'gray_2': "rgba(0, 0, 0, 0.2)",
111-
'gray_3': "rgba(0, 0, 0, 0.1)",
113+
'gray_3': "rgba(198, 198, 198, 0.9)",
112114

113115
'github_user': 'tobinus',
114116
'github_repo': 'python-podgen',
@@ -134,7 +136,7 @@
134136
# The name of an image file (within the static path) to use as favicon of the
135137
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
136138
# pixels large.
137-
html_favicon = "favicon.ico"
139+
html_favicon = "_static/favicon.ico"
138140

139141
# Add any paths that contain custom static files (such as style sheets) here,
140142
# relative to this directory. They are copied after the builtin static files,
@@ -215,13 +217,13 @@
215217
# Grouping the document tree into LaTeX files. List of tuples
216218
# (source start file, target name, title, author, documentclass [howto/manual]).
217219
latex_documents = [
218-
('index', 'pyPodGen.tex', u'pyPodGen Documentation',
219-
u'Lars Kiesow', 'manual'),
220+
('index', 'pyPodGen.tex', u'PodGen Documentation',
221+
u'Lars Kiesow and Thorben Dahl', 'manual'),
220222
]
221223

222224
# The name of an image file (relative to this directory) to place at the top of
223225
# the title page.
224-
#latex_logo = None
226+
latex_logo = '_static/logo.png'
225227

226228
# For "manual" documents, if this is true, then toplevel headings are parts,
227229
# not chapters.
@@ -231,13 +233,13 @@
231233
#latex_show_pagerefs = False
232234

233235
# If true, show URL addresses after external links.
234-
#latex_show_urls = False
236+
latex_show_urls = "true"
235237

236238
# Documents to append as an appendix to all manuals.
237239
#latex_appendices = []
238240

239241
# If false, no module index is generated.
240-
#latex_domain_indices = True
242+
latex_domain_indices = False
241243

242244

243245
# -- Options for manual page output --------------------------------------------
@@ -250,7 +252,7 @@
250252
]
251253

252254
# If true, show URL addresses after external links.
253-
#man_show_urls = False
255+
man_show_urls = True
254256

255257

256258
# -- Options for Texinfo output ------------------------------------------------
@@ -275,7 +277,7 @@
275277

276278

277279
# Example configuration for intersphinx: refer to the Python standard library.
278-
intersphinx_mapping = {'http://docs.python.org/': None}
280+
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
279281

280282

281283
# Ugly way of setting tabsize

doc/contributing.rst

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
============
2+
Contributing
3+
============
4+
5+
Setting up
6+
----------
7+
8+
To install the dependencies, run::
9+
10+
$ pip install -r requirements
11+
12+
while you have a `virtual environment <http://docs.python-guide.org/en/latest/dev/virtualenvs/>`_
13+
activated.
14+
15+
You are recommended to use `pyenv <https://github.com/yyuu/pyenv>`_ to handle
16+
virtual environments and Python versions. That way, you can easily test and
17+
debug problems that are specific to one version of Python.
18+
19+
Testing
20+
-------
21+
22+
You can perform an integration test by running ``podgen/__main__.py``::
23+
24+
$ python -m podgen
25+
26+
When working on this project, you should run the unit tests as well as the
27+
integration test, like this::
28+
29+
$ make test
30+
31+
The unit tests reside in ``podgen/tests`` and are written using the
32+
:mod:`unittest` module.
33+
34+
35+
Values
36+
------
37+
38+
Read :doc:`/user/introduction` and :doc:`/user/fork` for a run-down on what
39+
values/principles lay the foundation for this project. In short, it is important
40+
to keep the API as simple as possible.
41+
42+
You must also write unittests as you code, ideally using **test-driven
43+
development** (that is, write a test, observe that the test fails, write code
44+
so the test works, observe that the test succeeds, write a new test and so on).
45+
That way, you know that the tests actually contribute and you get to think
46+
about how the API will look before you tackle the problem head-on.
47+
48+
Make sure you update ``podgen/__main__.py`` so it still works, and use your new
49+
functionality there if it makes sense.
50+
51+
You must also make sure you **update any relevant documentation**. Remember that
52+
the documentation includes lots of examples and also describes the API
53+
independently from docstring comments in the code itself.
54+
55+
Pull requests in which the unittests and documentation are NOT up to date
56+
with the code will NOT be accepted.
57+
58+
Lastly, a single **commit** shouldn't include more changes than it needs. It's better to do a big
59+
change in small steps, each of which is one commit. Explain the impact of your
60+
changes in the commit message.
61+
62+
The Workflow
63+
------------
64+
65+
#. Check out `waffle.io <https://waffle.io/tobinus/python-podgen>`_ or
66+
`GitHub Issues <https://github.com/tobinus/python-podgen/issues>`_.
67+
68+
* Find the issue you wish to work on.
69+
* Add your issue if it's not already there.
70+
* Discuss the issue and get feedback on your proposed solution. Don't waste
71+
time on a solution that might not be accepted!
72+
73+
#. Work on the issue in a separate branch which follows the name scheme
74+
``tobinus/python-podgen#<issue-number>-<brief-description>`` in your own fork. To be honest, I
75+
don't know if Waffle.io will notice that, but it doesn't hurt to try, I
76+
guess! You might want to read up on `Waffle.io's recommended workflow <https://github.com/waffleio/waffle.io/wiki/Recommended-Workflow-Using-Pull-Requests-&-Automatic-Work-Tracking>`_.
77+
78+
#. Push the branch.
79+
80+
#. Do the work.
81+
82+
#. When you're done and you've updated the documentation and tests (see above),
83+
create a pull request which references the issue.
84+
85+
#. Wait for me or some other team member to review the pull request. Keep an
86+
eye on your inbox or your GitHub notifications, since we may have some
87+
objections or feedback that you must take into consideration. **It'd be a
88+
shame if your work never led to anything because you didn't notice a
89+
comment!**
90+
91+
#. Consider making the same changes to `python-feedgen <https://github.com/lkiesow/python-feedgen>`_
92+
as well.

doc/index.rst

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,53 @@ PodGen
99
:target: http://podgen.readthedocs.io/en/latest/?badge=latest
1010
:alt: Documentation Status
1111

12-
Wouldn't it be nice if there was a **clean and simple library** which could help you
13-
**generate podcast RSS feeds** from your Python code? Well, today's your lucky day!
12+
.. image:: https://badge.waffle.io/tobinus/python-podgen.svg?label=ready&title=Ready
13+
:target: https://waffle.io/tobinus/python-podgen
14+
:alt: 'Stories in Ready'
15+
16+
Don't you wish there was a **clean and simple library** which could help you
17+
**generate podcast RSS feeds** with your Python code? Well, today's your lucky day!
1418

1519
>>> from podgen import Podcast, Episode, Media
1620
>>> # Create the Podcast
1721
>>> p = Podcast(
18-
name="My Awesome Podcast",
22+
name="The Library Tuesday Talk",
1923
description="My friends and I discuss Python"
2024
" libraries each Tuesday!",
21-
website="http://example.org/awesomepodcast"
25+
website="http://example.org/librarytuesdaytalk"
2226
)
2327
>>> # Add some episodes
2428
>>> p.episodes += [
25-
Episode(title="PodGen rocks!",
29+
Episode(title="Worry about timezones no more",
2630
media=Media("http://example.org/ep1.mp3", 11932295),
27-
summary="I found an awesome library for creating podcasts"),
31+
summary="Using pytz, you can make your code timezone-aware "
32+
"with very little hassle."),
2833
Episode(title="Heard about clint?",
2934
media=Media("http://example.org/ep2.mp3", 15363464),
3035
summary="The man behind Requests made something useful "
31-
"for us command-line lovers."
36+
"for us command-line nerds."
3237
]
3338
>>> # Generate the RSS feed
3439
>>> rss = str(p)
3540

3641
You don't need to read the RSS specification, write XML by hand or wrap your
37-
head around ambiguous, undocumented APIs. Just provide the data, and PodGen
38-
fixes the rest for you!
39-
40-
Where to start
41-
--------------
42+
head around ambiguous, undocumented APIs. PodGen incorporates the industry's
43+
best practices and lets you focus on collecting the necessary metadata and
44+
publishing the podcast.
4245

43-
Take a look at the :doc:`user/example` for a larger example, read about
44-
:doc:`the project's background <user/introduction>` or refer to
45-
the :doc:`user/basic_usage_guide/index` for a detailed introduction to PodGen.
4646

47-
Contents
48-
--------
47+
User Guide
48+
----------
4949

5050
.. toctree::
5151
:maxdepth: 3
5252

53-
user/index
53+
user/introduction
54+
user/installation
55+
user/fork
56+
user/basic_usage_guide/part_1
57+
user/basic_usage_guide/part_2
58+
user/basic_usage_guide/part_3
59+
user/example
60+
contributing
5461
api

doc/user/basic_usage_guide/index.rst

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)