Skip to content

Commit b5588cd

Browse files
authored
Merge pull request #37 from Holzhaus/documentation-fixes
Documentation Fixes
2 parents c7089cb + c358947 commit b5588cd

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

.pre-commit/version_check.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import docutils.utils
1313
import docutils.frontend
1414

15-
CHANGELOG_PATTERN = re.compile(r"^Version (\S+)((?: \(unreleased\)))?$")
15+
CHANGELOG_PATTERN = re.compile(r"^Version (\S+)((?: \(.+\)))?$")
1616

1717

1818
def parse_rst(text: str) -> docutils.nodes.document:
@@ -56,15 +56,15 @@ def get_sphinxchangelog_version(rootdir):
5656
matchobj = CHANGELOG_PATTERN.match(visitor.sectiontitles_found[1])
5757
assert matchobj
5858
version = matchobj.group(1)
59-
version_unreleased = matchobj.group(2)
59+
version_date = matchobj.group(2)
6060

6161
matchobj = CHANGELOG_PATTERN.match(visitor.sectiontitles_found[2])
6262
assert matchobj
6363
release = matchobj.group(1)
64-
release_unreleased = matchobj.group(2)
64+
release_date = matchobj.group(2)
6565

66-
if version_unreleased:
67-
assert release_unreleased
66+
if version_date:
67+
assert version_date == release_date
6868

6969
return version, release
7070

docs/changelog.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,43 +19,43 @@ Version 0.2.4 (unreleased)
1919
* Rewrite the path handling of the Sphinx extension to handle branch names containing a forward slash properly on Windows and add unittests and Windows CI builds to make sure it doesn't break on future updates. (`#31 <issue31_>`_, `#35 <issue35_>`_)
2020

2121

22-
Version 0.2.3
23-
-------------
22+
Version 0.2.3 (2020-05-04)
23+
--------------------------
2424

2525
* Fixed return codes of main() function and exit with non-zero status if no matching refs were found.
2626
* Added some logging calls to the git module.
2727
* Fixed bug where local branch was used to check the existence of files on remote branches.
2828

2929

30-
Version 0.2.2
31-
-------------
30+
Version 0.2.2 (2020-05-01)
31+
--------------------------
3232

3333
* Added additional checks to determine if a branch or tag contains both the Sphinx source directory and the :file:`conf.py` file. If that's not the case, that branch or tag is skipped automatically and not copied to the temporary directory. (`#9 <issue9_>`_)
3434

3535

36-
Version 0.2.1
37-
-------------
36+
Version 0.2.1 (2020-04-19)
37+
--------------------------
3838

3939
* Fixed handling of absolute output paths in `vpathto` and ensure that all generated paths are relative.
4040

4141

42-
Version 0.2.0
43-
-------------
42+
Version 0.2.0 (2020-04-19)
43+
--------------------------
4444

4545
* Added a way to override config variables using placeholders that expand to each version's actual value (`#4 <issue4_>`_, `#7 <issue7_>`_).
4646

4747

4848
Version 0.1
4949
===========
5050

51-
Version 0.1.1
52-
-------------
51+
Version 0.1.1 (2020-03-12)
52+
--------------------------
5353

5454
* Fixed version number in documentation
5555
* Fixed issue that caused the wrong configuration directory being used when the ``-c`` argument was not specified on the command line
5656

57-
Version 0.1.0
58-
-------------
57+
Version 0.1.0 (2020-03-11)
58+
--------------------------
5959

6060
* Initial release
6161

docs/faq.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,16 @@ Then it copies the data for each version into separate temporary directories, bu
2424
The :file:`conf.py` file from the currently checked out branch will be used to build old versions, so it's not necessary to make changes old branches or tags to add support for ``sphinx-multiversion``.
2525
This also means that theme improvements, template changes, etc. will automatically be applied to old versions without needing to add commits.
2626

27+
2728
Do I need to make changes to old branches or tags?
2829
==================================================
2930

30-
No, you don't. ``sphinx-multiversion`` will always use the :file:`conf.py` file from you currently checked out branch.
31+
No, you don't. ``sphinx-multiversion`` will always use the :file:`conf.py` file from your currently checked out branch.
32+
33+
The downside is that this behaviour restricts the kinds of changes you may do to your configuration, because it needs to retain compatibility with old branches.
34+
For example, if your :file:`conf.py` file hardcodes a path (e.g. for opening a file), but that file does not exist in some older branches that you want to build documentation for, this will cause issues.
35+
In these cases you will need to add a check if a file actually exists and adapt the path accordingly.
36+
3137

3238
What are the license terms of ``sphinx-multiversion``?
3339
======================================================

0 commit comments

Comments
 (0)