mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-24 01:35:23 +03:00
Fix Sphinx documentation
Perpetual version string and copyright year. Fix Sphinx warnings.
This commit is contained in:
parent
fb9095b969
commit
4b82e4ad27
@ -10,4 +10,3 @@ include man/glances.1
|
||||
recursive-include docs images/*.png glances-doc.html
|
||||
recursive-include glances *.py
|
||||
recursive-include i18n *.mo
|
||||
prune docs/_build
|
||||
|
29
docs/conf.py
29
docs/conf.py
@ -11,12 +11,31 @@
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import sys, os
|
||||
import datetime
|
||||
import os
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('.'))
|
||||
cwd = os.path.realpath(os.path.dirname(__file__))
|
||||
project_path = os.path.realpath(os.path.join(cwd, '..', 'glances'))
|
||||
|
||||
def get_version():
|
||||
init_file = os.path.realpath(os.path.join(project_path, '__init__.py'))
|
||||
f = open(init_file, 'r')
|
||||
try:
|
||||
for line in f:
|
||||
if line.startswith('__version__'):
|
||||
return line.strip().split(' = ')[1]
|
||||
else:
|
||||
raise ValueError("Version string not found")
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
_version = get_version()
|
||||
_year = datetime.datetime.now().year
|
||||
_copyright = u'{0}, Nicolas Hennion'.format(_year)
|
||||
|
||||
# -- General configuration -----------------------------------------------------
|
||||
|
||||
@ -41,16 +60,16 @@ master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'Glances'
|
||||
copyright = u'2014, Nicolas Hennion'
|
||||
copyright = _copyright
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '1.7.5'
|
||||
version = _version
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '1.7.5'
|
||||
release = version
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
@ -120,7 +139,7 @@ html_theme = 'default'
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
#html_static_path = ['_static']
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
|
@ -1,11 +1,11 @@
|
||||
Welcome to Glances's documentation!
|
||||
===================================
|
||||
Welcome to Glances documentation!
|
||||
=================================
|
||||
|
||||
**Glances** is a cross-platform curses-based monitoring tool written in Python.
|
||||
|
||||
It uses the psutil library and some internal code to get information from your system.
|
||||
|
||||
.. image:: https://raw.github.com/nicolargo/glances/master/docs/images/screenshot-wide.png
|
||||
.. image:: images/screenshot-wide.png
|
||||
|
||||
Get the code
|
||||
------------
|
||||
@ -25,4 +25,4 @@ Indices and tables
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
* :ref:`search`
|
||||
|
Loading…
Reference in New Issue
Block a user