From 1431c66c54cf75359ecda54355a9d9124e98bfd8 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Wed, 14 Jan 2015 12:32:56 +0100 Subject: [PATCH] Documentation generation --- .gitignore | 3 +++ docs/_static/.keep | 0 docs/conf.py | 20 ++++++++++---------- documentation.sh | 27 +++++++++++++++++++++++++++ gns3server/version.py | 1 + gns3server/web/documentation.py | 2 +- 6 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 docs/_static/.keep create mode 100755 documentation.sh diff --git a/.gitignore b/.gitignore index 638a9fe7..876a38ec 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,6 @@ nosetests.xml # Gedit Backup Files *~ + +#Documentation build +docs/_build diff --git a/docs/_static/.keep b/docs/_static/.keep new file mode 100644 index 00000000..e69de29b diff --git a/docs/conf.py b/docs/conf.py index c3203698..346e586a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- # -# POC documentation build configuration file, created by +# GNS3 documentation build configuration file, created by # sphinx-quickstart on Mon Jan 5 14:15:48 2015. # # This file is execfile()d with the current directory set to its @@ -21,7 +21,7 @@ import os # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) -from demoserver.version import __version__, __version_info__ +from gns3server.version import __version__, __version_info__ # -- General configuration ------------------------------------------------ @@ -46,8 +46,8 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = 'POC' -copyright = '2015, POC Team' +project = 'GNS3' +copyright = '2015, GNS3 GNS3 Technologies Inc.' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -179,7 +179,7 @@ html_static_path = ['_static'] # html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'POCdoc' +htmlhelp_basename = 'GNS3doc' # -- Options for LaTeX output --------------------------------------------- @@ -199,7 +199,7 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('index', 'POC.tex', 'POC Documentation', 'POC Team', 'manual'), + ('index', 'GNS3.tex', 'GNS3 Documentation', 'GNS3 Team', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -228,8 +228,8 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'gns3', 'POC Documentation', - ['POC Team'], 1) + ('index', 'gns3', 'GNS3 Documentation', + ['GNS3 Team'], 1) ] # If true, show URL addresses after external links. @@ -242,8 +242,8 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'POC', 'POC Documentation', - 'POC Team', 'POC', 'One line description of project.', + ('index', 'GNS3', 'GNS3 Documentation', + 'GNS3 Team', 'GNS3', 'One line description of project.', 'Miscellaneous'), ] diff --git a/documentation.sh b/documentation.sh new file mode 100755 index 00000000..251146e2 --- /dev/null +++ b/documentation.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Copyright (C) 2015 GNS3 Technologies Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# +# Build the documentation +# + +set -e + +py.test +python gns3server/web/documentation.py +cd docs +make html diff --git a/gns3server/version.py b/gns3server/version.py index 977c9652..049db3b8 100644 --- a/gns3server/version.py +++ b/gns3server/version.py @@ -16,3 +16,4 @@ # along with this program. If not, see . __version__ = "1.3.dev1" +__version_info__ = (1, 3, 0, 0) diff --git a/gns3server/web/documentation.py b/gns3server/web/documentation.py index 4bc28c39..2a2d212c 100644 --- a/gns3server/web/documentation.py +++ b/gns3server/web/documentation.py @@ -18,7 +18,7 @@ import re import os.path -from .route import Route +from gns3server.web.route import Route class Documentation(object):