Skip to content

Commit 55e944f

Browse files
authored
Merge pull request #68 from tobinus/improve-docs
Improve docs for 1.0.1
2 parents 9f5f3f5 + b284c07 commit 55e944f

24 files changed

+321
-162
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ venv
66
# JetBrains IDE
77
.idea/
88

9+
# Visual Studio Code
10+
.vscode/
11+
912
# Documentation build
1013
/doc/_build
1114
/docs
@@ -15,4 +18,3 @@ venv
1518
/MANIFEST
1619
/build
1720
/podgen.egg-info
18-

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- This `CHANGELOG.md` file, for documenting notable changes.
13+
- Documentation page about PodGen's roadmap (under Background).
14+
15+
### Changed
16+
17+
- Organization of the documentation, along with other documentation
18+
improvements and updates.
1319

1420
### Removed
1521

16-
- Support for Python 3.3, due to its age and lack of support, and bugs with
17-
installing `tinytag`.
22+
- Support for Python 3.3, due to its age and lack of support.
1823

1924
### Fixed
2025

doc/_static/custom.css

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,40 @@
1-
body, div.body {
1+
body {
22
background-color: #fffded;
33
}
4+
div.documentwrapper, div.body {
5+
background: initial;
6+
}
47
pre {
58
background-color: #ebebeb;
69
}
7-
div.sphinxsidebar a.current {
10+
div.sphinxsidebar a:link.current, div.sphinxsidebar a:visited.current {
11+
color: rgba(0, 0, 0, 0.9);
812
text-decoration: none;
913
border-bottom: none;
1014
font-weight: bold;
1115
cursor: text;
1216
}
17+
div.body {
18+
min-width: auto;
19+
}
20+
div.document, div.footer {
21+
width: auto;
22+
max-width: 1000px;
23+
}
24+
a:link,
25+
div.sphinxsidebar a:link {
26+
color: #004B6B;
27+
}
28+
a:visited, div.sphinxsidebar a:visited {
29+
color: #56006B;
30+
}
31+
a.current + ul a[href*="#"] {
32+
color: rgba(0, 0, 0, 0.9);
33+
}
34+
div.toctree-wrapper a[href*="#"]
35+
{
36+
color: rgba(0, 28, 40, 0.65);
37+
}
1338
/* Don't hide logo when viewed on mobile, just invert its colors */
1439
@media screen and (max-width: 875px) {
1540
div.sphinxsidebar p.logo {
@@ -18,4 +43,19 @@ div.sphinxsidebar a.current {
1843
width: 60%;
1944
margin: auto;
2045
}
46+
47+
/* Different link colors */
48+
div.sphinxsidebar a:link {
49+
color: #BFD2DA;
50+
}
51+
52+
div.sphinxsidebar a:visited {
53+
color: #C09FC7;
54+
}
55+
56+
a.current + ul a[href*="#"],
57+
div.sphinxsidebar a:link.current,
58+
div.sphinxsidebar a:visited.current {
59+
color: rgba(255, 255, 255, 0.95);
60+
}
2161
}

doc/user/fork.rst renamed to doc/background/fork.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ request which removes 70% of the features ;-) Among other things, support for AT
1010
Dublin Core is removed, and the remaining code is almost entirely rewritten.
1111

1212
A more detailed reasoning follows. Read it if you're interested, but feel free
13-
to skip to :doc:`basic_usage_guide/part_1`.
13+
to skip to the :doc:`/usage_guide/index`.
1414

1515
Inspiration
1616
-----------
@@ -46,11 +46,9 @@ and you as a user shouldn't need to know all this. You just need to know that th
4646
image must be larger than 1400x1400 pixels, not the history behind everything.
4747

4848
Forking a project gives you a lot of freedom, since you don't have to support
49-
any old behaviour. python-feedgen_ cannot make backwards incompatible changes,
50-
since many projects around the earth rely on the way the library works, and you
51-
cannot expect everyone to use ``pip freeze`` (you should, though!). Whenever a
52-
change *is* appropriate for python-feedgen_, however, we should strive to bring
53-
it there so it can benefit as many as possible :)
49+
any old behaviour. It would be difficult to make these changes upstream, since
50+
many of the problems are inherent to the scope and purpose of the library itself,
51+
and changing that is difficult and not always desirable.
5452

5553

5654
Summary of changes
@@ -93,7 +91,7 @@ The following list is not exhaustive.
9391
* :attr:`.Podcast.explicit` is now required, and is :obj:`bool`.
9492
* Add shorthand for generating the RSS: Just try to converting your :class:`~podgen.Podcast`
9593
object to :obj:`str`!
96-
* Expand the documentation (as you've surely noticed).
94+
* Expand the documentation.
9795
* Move away from the extension framework, and rely on class inheritance instead.
9896

9997
.. _python-feedgen: https://github.com/lkiesow/python-feedgen

doc/background/index.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
==========
2+
Background
3+
==========
4+
5+
Learn about the "why" and "how" of the PodGen project itself.
6+
7+
.. toctree::
8+
:maxdepth: 1
9+
10+
philosophy
11+
scope
12+
fork
13+
roadmap
14+
license

doc/background/license.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-------
2+
License
3+
-------
4+
PodGen is licensed under the terms of both the FreeBSD license and the LGPLv3+.
5+
Choose the one which is more convenient for you. For more details, have a look
6+
at license.bsd_ and license.lgpl_.
7+
8+
.. _license.bsd: https://github.com/tobinus/python-podgen/blob/master/license.bsd
9+
.. _license.lgpl: https://github.com/tobinus/python-podgen/blob/master/license.lgpl

doc/background/philosophy.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
----------
2+
Philosophy
3+
----------
4+
5+
This project is heavily inspired by the "for humans" approach of the
6+
`Requests <https://requests.readthedocs.io>`__ library, which features an API that
7+
is designed to give the developer a great user experience. This is done by
8+
finding a suitable scope and abstraction level, and designing the
9+
API so it supports the developer's vocabulary and their mental model of how
10+
the domain works.
11+
12+
For example, instead of using the names of XML tags like "itunes:image", a more
13+
relevant name, here simply "image", is used. Another example is the duration of
14+
a podcast episode. In XML terms, this is put into an "itunes:duration" tag which exists
15+
outside of the "enclosure" tag, which holds the filename and file size. In PodGen,
16+
the filename, file size, file type and audio duration are all placed together in
17+
a Media instance, since they are all related to the media itself. The goal
18+
has been to "hide" the messy details of the XML and provide an API on top which
19+
uses words that you recognize and use daily when working with podcasts.
20+
21+
To be specific, PodGen aims to follow the same
22+
`PEP 20 <https://www.python.org/dev/peps/pep-0020/>`__ idioms as
23+
`Requests <https://requests.readthedocs.io/en/master/user/intro/#philosophy>`__:
24+
25+
1. Beautiful is better than ugly.
26+
2. Explicit is better than implicit.
27+
3. Simple is better than complex.
28+
4. Complex is better than complicated.
29+
5. Readability counts.
30+
31+
To enable this, the project focuses on one task alone: making it easy to generate a podcast.

doc/background/roadmap.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
-------
2+
Roadmap
3+
-------
4+
5+
When PodGen reaches a certain point where it has all the features it needs,
6+
while still being simple to use, it would not be necessary with further
7+
updates… had it not been for changes to PodGen's dependencies and changes to
8+
the overall podcast standards. Luckily, the applications that read podcasts
9+
tend to be backwards compatible, in order to support all the old podcasts that
10+
are out there.
11+
12+
The current plan for PodGen updates is as follows:
13+
14+
* **New minor version**: Support for the new Apple Podcast specifications and
15+
categories, as much as is possible without breaking backwards compatibility.
16+
* Deprecation warnings for properties and such which will be removed in the
17+
next major version.
18+
* **New major version**: Support for the new Apple Podcast specifications and
19+
categories which could not be included earlier due to backwards compatibility,
20+
or which have new names or behaviours to simplify the API. Removal of
21+
deprecated features.
22+
* **New minor versions**: Removal of support for Python releases that have
23+
passed `End of Life`_ (Python 2.7 after January 1st 2020, Python
24+
3.4), allowing for simplifications and use of new features in the code base.
25+
Other code and documentation improvements should hopefully stop PodGen from
26+
becoming stale and burdensome to maintain.
27+
* Better ways of adding support for RSS features which PodGen itself does not
28+
support.
29+
30+
.. _End of life: https://devguide.python.org/#status-of-python-branches
31+
32+
Unlike other libraries with evolving demands, PodGen is expected to stay
33+
relatively stable with the occasional update. Changes to the Apple Podcast
34+
specifications do not occur particularly often, so PodGen won't need to change
35+
often either.
36+
37+
Since PodGen is an open source project and its maintainer has a limited amount
38+
of time to spare, updates may be sporadic. Despite this, please don't hesitate
39+
to report issues or feature requests if there is something that does not
40+
work or you feel should be included. The project is used by the Student Radio
41+
of Trondheim and will be kept up-to-date with their requirements, though they
42+
are not primarily a podcast producer.

doc/background/scope.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
-----
2+
Scope
3+
-----
4+
5+
This library does NOT help you publish a podcast, or manage the metadata of your
6+
podcasts. It's just a tool that accepts information about your podcast and
7+
outputs an RSS feed which you can then publish however you want.
8+
9+
Both the process of getting information
10+
about your podcast, and publishing it needs to be done by you. Even then,
11+
it will save you from hammering your head over confusing and undocumented APIs
12+
and conflicting views on how different RSS elements should be used. It also
13+
saves you from reading the RSS specification, the RSS Best Practices and the
14+
documentation for iTunes' Podcast Connect.
15+
16+
Here is an example of how PodGen fits into your code:
17+
18+
1. A request comes to your webserver (using e.g. `Flask <https://palletsprojects.com/p/flask/>`__)
19+
2. A podcast router starts to handle the request.
20+
3. The database is queried for information about the requested podcast.
21+
4. **The data retrieved from the database is "translated" into the language of PodGen, using its Podcast, Episode, People and Media classes.**
22+
5. **The RSS document is generated by PodGen and saved to a variable.**
23+
6. The generated RSS document is made into a response and sent to the client.
24+
25+
PodGen is geared towards developers who aren't super familiar with
26+
RSS and XML. If you know exactly how you want the XML to look, then you're
27+
better off using a template engine like Jinja2 (even if friends don't let
28+
friends touch XML bare-handed) or an XML processor like the built-in
29+
`Python ElementTree API <https://docs.python.org/3/library/xml.etree.elementtree.html#module-xml.etree.ElementTree>`__.
30+
If you just want an easy way to create and manage your podcasts,
31+
check out systems like `Podcast Generator <http://www.podcastgenerator.net/>`_.

doc/conf.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
# General information about the project.
4747
project = u'PodGen'
48-
copyright = u'2014, Lars Kiesow. Modified work © 2016, Thorben Dahl'
48+
copyright = u'2014, Lars Kiesow. Modified work © 2019, Thorben Dahl'
4949

5050
# The version info for the project you're documenting, acts as replacement for
5151
# |version| and |release|, also used in various other places throughout the
@@ -112,11 +112,19 @@
112112
'gray_2': "rgba(0, 0, 0, 0.2)",
113113
'gray_3': "rgba(198, 198, 198, 0.9)",
114114

115+
'description': 'Generate podcasts with ease.',
116+
'show_relbars': True,
117+
115118
'github_user': 'tobinus',
116119
'github_repo': 'python-podgen',
117-
'github_banner': True,
118120
'logo_name': False,
119121
'logo': 'logo.png',
122+
123+
'extra_nav_links': {
124+
'Changelog': 'https://github.com/tobinus/python-podgen/blob/master/CHANGELOG.md',
125+
'GitHub': 'https://github.com/tobinus/python-podgen/tree/master',
126+
'PyPI': 'https://pypi.org/project/podgen/',
127+
},
120128
}
121129

122130
# Add any paths that contain custom themes here, relative to this directory.
@@ -278,7 +286,7 @@
278286

279287
# Example configuration for intersphinx: refer to the Python standard library.
280288
intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
281-
'requests': ('http://docs.python-requests.org/en/master', None)}
289+
'requests': ('https://requests.readthedocs.io/en/master', None)}
282290

283291

284292
# Ugly way of setting tabsize

doc/contributing.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ The unit tests reside in ``podgen/tests`` and are written using the
3535
Values
3636
------
3737

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.
38+
Read :doc:`/background/philosophy`, :doc:`/background/scope` and :doc:`/background/fork`
39+
for a run-down on what values/principles lay the foundation for this project.
40+
In short, it is important to keep the API as simple as possible.
4141

4242
You must also write unittests as you code, ideally using **test-driven
4343
development** (that is, write a test, observe that the test fails, write code

0 commit comments

Comments
 (0)