doc: Reformat conf.py

This commit is contained in:
patrick96 2023-04-03 00:37:12 +02:00 committed by Patrick Ziegler
parent c6eb3f88ea
commit 98d58b6f27

View File

@ -19,6 +19,7 @@ import datetime
import sphinx import sphinx
import packaging.version import packaging.version
def get_version(root_path): def get_version(root_path):
""" """
Reads the polybar version from the version.txt at the root of the repo. Reads the polybar version from the version.txt at the root of the repo.
@ -35,6 +36,7 @@ def get_version(root_path):
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
project = 'Polybar User Manual' project = 'Polybar User Manual'
copyright = '2016-{}, Michael Carlberg & contributors'.format( copyright = '2016-{}, Michael Carlberg & contributors'.format(
datetime.datetime.now().year datetime.datetime.now().year
@ -187,9 +189,18 @@ latex_documents = [
# One entry per manual page. List of tuples # One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section). # (source start file, name, description, authors, manual section).
man_pages = [ man_pages = [
('man/polybar.1', 'polybar', 'A fast and easy-to-use tool status bar', [], 1), (
('man/polybar-msg.1', 'polybar-msg', 'Send IPC messages to polybar', [], 1), 'man/polybar.1', 'polybar',
('man/polybar.5', 'polybar', 'configuration file for polybar(1)', [], 5) 'A fast and easy-to-use tool status bar', [], 1
),
(
'man/polybar-msg.1', 'polybar-msg',
'Send IPC messages to polybar', [], 1
),
(
'man/polybar.5', 'polybar',
'configuration file for polybar(1)', [], 5
)
] ]
man_make_section_directory = False man_make_section_directory = False
@ -250,8 +261,10 @@ if packaging.version.parse(sphinx.__version__) >= packaging.version.parse("1.8.5
class VersionDirective(VersionChange): class VersionDirective(VersionChange):
""" """
Overwrites the Sphinx directive for versionchanged, versionadded, and Overwrites the Sphinx directive for versionchanged, versionadded, and
deprecated and adds an unreleased tag to versions that are not yet released deprecated and adds an unreleased tag to versions that are not yet
released
""" """
def run(self) -> List[Node]: def run(self) -> List[Node]:
directive_version = packaging.version.parse(self.arguments[0]) directive_version = packaging.version.parse(self.arguments[0])
parsed_version_txt = packaging.version.parse(version_txt) parsed_version_txt = packaging.version.parse(version_txt)