Restructure changelog generation as a Sphinx extension

develop
lethosor 2020-07-04 02:15:05 -04:00
parent f32757fa09
commit f81f77352c
3 changed files with 20 additions and 4 deletions

@ -22,8 +22,6 @@ import re
import shlex # pylint:disable=unused-import
import sys
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'docs'))
from gen_changelog import generate_changelog
# -- Support :dfhack-keybind:`command` ------------------------------------
# this is a custom directive that pulls info from dfhack.init-example
@ -180,19 +178,23 @@ def all_keybinds_documented():
# Actually call the docs generator and run test
generate_changelog()
write_script_docs()
all_keybinds_documented()
# -- General configuration ------------------------------------------------
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'docs', 'sphinx_extensions'))
# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '1.8'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.extlinks']
extensions = [
'sphinx.ext.extlinks',
'dfhack.changelog',
]
# This config value must be a dictionary of external sites, mapping unique
# short alias names to a base URL and a prefix.

@ -283,3 +283,17 @@ if __name__ == '__main__':
print('stable missing: ' + description)
if description not in content_dev:
print('dev missing: ' + description)
def sphinx_entrypoint(app, config):
generate_changelog()
def setup(app):
app.connect('config-inited', sphinx_entrypoint)
return {
'version': '0.1',
'parallel_read_safe': True,
'parallel_write_safe': True,
}