Browse Source

docs: Autodetect version and copyright year in the sphinx doc

Signed-off-by: Christian Decker <decker.christian@gmail.com>
Suggested-by: Rusty Russell <@rustyrussell>
issue-2080
Christian Decker 6 years ago
parent
commit
816f20d1c0
  1. 9
      doc/conf.py

9
doc/conf.py

@ -21,6 +21,9 @@
# import sys # import sys
# sys.path.insert(0, os.path.abspath('.')) # sys.path.insert(0, os.path.abspath('.'))
from datetime import datetime
import subprocess
# -- General configuration ------------------------------------------------ # -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here. # If your documentation needs a minimal Sphinx version, state it here.
@ -59,17 +62,17 @@ master_doc = 'index'
# General information about the project. # General information about the project.
project = 'c-lightning' project = 'c-lightning'
copyright = '2019, c-lightning dev community'
author = 'c-lightning Developers' author = 'c-lightning Developers'
copyright = datetime.now().strftime('2015 — %Y, {}'.format(author))
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '0.6.3' version = subprocess.check_output('git describe --always --dirty=-modded --abbrev=7'.split()).decode('ASCII')
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '0.6.3pre' release = version
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

Loading…
Cancel
Save