[GRASS-SVN] r60443 - in grass/trunk/lib/python/pygrass/docs: . _static _templates

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 23 03:51:06 PDT 2014


Author: lucadelu
Date: 2014-05-23 03:51:06 -0700 (Fri, 23 May 2014)
New Revision: 60443

Added:
   grass/trunk/lib/python/pygrass/docs/_static/
   grass/trunk/lib/python/pygrass/docs/_static/pygrass.css
   grass/trunk/lib/python/pygrass/docs/_templates/
   grass/trunk/lib/python/pygrass/docs/_templates/layout.html.template
Modified:
   grass/trunk/lib/python/pygrass/docs/Makefile
   grass/trunk/lib/python/pygrass/docs/conf.py
   grass/trunk/lib/python/pygrass/docs/index.rst
Log:
pygrass doc: improved pygrass documentation

Modified: grass/trunk/lib/python/pygrass/docs/Makefile
===================================================================
--- grass/trunk/lib/python/pygrass/docs/Makefile	2014-05-23 10:43:26 UTC (rev 60442)
+++ grass/trunk/lib/python/pygrass/docs/Makefile	2014-05-23 10:51:06 UTC (rev 60443)
@@ -77,9 +77,9 @@
 	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex/"
 
 man:
-	$(call run_grass,$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man)
+	$(call run_grass,$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(MANDIR))
 	@echo
-	@echo "Build finished. The manual pages are in $(BUILDDIR)/man/"
+	@echo "Build finished. The manual pages are in $(MANDIR)/"
 
 doctest:
 	$(call run_grass,$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest)

Added: grass/trunk/lib/python/pygrass/docs/_static/pygrass.css
===================================================================
--- grass/trunk/lib/python/pygrass/docs/_static/pygrass.css	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/docs/_static/pygrass.css	2014-05-23 10:51:06 UTC (rev 60443)
@@ -0,0 +1,74 @@
+/* GRASS documentation site style sheet
+ *
+ * send improvements to GRASS Developers list
+ * 
+ *  (eg how to reach the same result on netscape, mozilla konqueror?)
+ *
+ * Fonts:
+ *	http://www.w3.org/TR/REC-CSS2/fonts.html
+ * Tables:
+ *	http://www.w3.org/TR/REC-CSS2/tables.html
+ */
+
+body{
+    background: white;
+    color: black;
+    font-family: arial,sans-serif;
+    width: 99%;
+    margin: 8px;
+}
+
+hr.header {
+    height: 3px;
+    color: gray;
+    background-color: gray;
+    width: 100%;
+}
+
+h1{
+    background-color: transparent;
+    color: rgb(25%, 60%, 25%);
+    font-family: arial,sans-serif;
+    font-weight: bold;
+    font-size: x-large;
+}
+
+h2{
+    background-color: transparent;
+    color: rgb(25%, 60%, 25%);
+    font-family: arial,sans-serif;
+    font-weight: bold;
+    font-size: large;
+}
+
+h3{
+    background-color: transparent;
+    color: rgb(25%, 60%, 25%);
+    font-family: arial,sans-serif;
+    font-weight: bold;
+    font-size: large;
+}
+
+h4{
+    background-color: transparent;
+    color: rgb(25%, 60%, 25%);
+    font-family: arial,sans-serif;
+    font-weight: bold;
+    font-size: medium;
+}
+
+table.border {
+    border-collapse:collapse;
+}
+
+table.border td {
+    border: 1px solid rgb(25%, 60%, 25%);
+}
+
+td {
+    padding: 5px;
+}
+
+div.related {
+    background-color: transparent;
+}

Added: grass/trunk/lib/python/pygrass/docs/_templates/layout.html.template
===================================================================
--- grass/trunk/lib/python/pygrass/docs/_templates/layout.html.template	                        (rev 0)
+++ grass/trunk/lib/python/pygrass/docs/_templates/layout.html.template	2014-05-23 10:51:06 UTC (rev 60443)
@@ -0,0 +1,9 @@
+{% extends "!layout.html" %}
+{% block extrahead %}
+<link rel="stylesheet" href="{{ pathto('_static/pygrass.css', 1) }}" type="text/css" />
+{% endblock %}
+
+{% block header %}
+<img src="../grass_logo.png" alt="GRASS logo">
+<hr class="header">
+{% endblock %}
\ No newline at end of file

Modified: grass/trunk/lib/python/pygrass/docs/conf.py
===================================================================
--- grass/trunk/lib/python/pygrass/docs/conf.py	2014-05-23 10:43:26 UTC (rev 60442)
+++ grass/trunk/lib/python/pygrass/docs/conf.py	2014-05-23 10:51:06 UTC (rev 60443)
@@ -12,6 +12,9 @@
 # serve to show the default.
 
 import sys, os
+from datetime import date
+import string
+from shutil import copy
 
 # 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
@@ -20,6 +23,24 @@
     sys.exit("GISBASE not defined")
 sys.path.insert(0, os.path.abspath(os.path.join(os.environ['GISBASE'], 'etc', 'python', 'grass')))
 
+from grass.script import core
+
+footer_tmpl = string.Template(\
+r"""
+{% block footer %}<hr class="header">
+<p><a href="../index.html">Help Index</a> | <a href="../topics.html">Topics Index</a> | <a href="../keywords.html">Keywords Index</a> | <a href="../full_index.html">Full Index</a></p>
+<p>© 2003-${year} <a href="http://grass.osgeo.org">GRASS Development Team</a>, GRASS GIS ${grass_version} Reference Manual</p>
+{% endblock %}
+""")
+
+grass_version = core.version()['version']
+today = date.today()
+
+copy("_templates/layout.html.template", "_templates/layout.html")
+with open("_templates/layout.html", "a+b") as f:
+    f.write(footer_tmpl.substitute(grass_version=grass_version, year=today.year))
+    f.close()
+
 # -- General configuration -----------------------------------------------------
 
 # If your documentation needs a minimal Sphinx version, state it here.
@@ -50,9 +71,9 @@
 # built documents.
 #
 # The short X.Y version.
-version = '0.2'
+#version = '0.2'
 # The full version, including alpha/beta/rc tags.
-release = 'beta'
+#release = 'beta'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
@@ -100,7 +121,7 @@
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
-html_theme = 'default'
+html_theme = 'traditional'
 
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the
@@ -140,7 +161,7 @@
 #html_use_smartypants = True
 
 # Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
+html_sidebars = {"**":["localtoc.html",'relations.html','searchbox.html']}
 
 # Additional templates that should be rendered to pages, maps page names to
 # template names.

Modified: grass/trunk/lib/python/pygrass/docs/index.rst
===================================================================
--- grass/trunk/lib/python/pygrass/docs/index.rst	2014-05-23 10:43:26 UTC (rev 60442)
+++ grass/trunk/lib/python/pygrass/docs/index.rst	2014-05-23 10:51:06 UTC (rev 60443)
@@ -3,26 +3,27 @@
    You can adapt this file completely to your liking, but it should at least
    contain the root `toctree` directive.
 
-Welcome to PyGrass documentation!
+PyGRASS documentation!
 ===================================
 
-In 2006, GRASS GIS developers started to adopt Python for the new GUI. Due
-to this Python became more and more important and developers converted all
-shell scripts from GRASS GIS 6 to Python for GRASS GIS 7.
-
-``pygrass`` improves the integration between GRASS GIS and Python, making
+``PyGRASS`` improves the integration between GRASS GIS and Python, making
 the use of Python under GRASS more consistent with the language itself. Furthermore,
 it simplifies GRASS scripting and programming and more natural for the user.
 
-This project has been funded with support from the Google Summer of Code 2012.
+Background: In 2006, GRASS GIS developers started to adopt Python for the new GUI. Due
+to this Python became more and more important and developers converted all
+shell scripts from GRASS GIS 6 to Python for GRASS GIS 7.
 
+To work with ``PyGRASS`` you need an up-to-date version of GRASS GIS 7.
+The only action before starting to work with ``PyGRASS`` is to launch 
+GRASS GIS 7 and from the console launch ``python`` or ``ipython`` 
+(the second one is the recommended way)
 
 Contents:
 
 .. toctree::
    :maxdepth: 2
 
-   intro
    gis
    raster
    vector
@@ -30,10 +31,19 @@
    modules
 
 
-Indices and tables
-==================
+References
+============
 
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
+Zambelli P, Gebbert S, Ciolli M., 2013. *Pygrass: An Object Oriented Python Application Programming Interface (API) for Geographic Resources Analysis Support System (GRASS) Geographic Information System (GIS)*. ISPRS International Journal of Geo-Information. 2(1):201-219. `doi:10.3390/ijgi2010201 <http://dx.doi.org/10.3390/ijgi2010201>`_
 
+This project has been funded with support from the `Google Summer of Code 2012 <http://trac.osgeo.org/grass/wiki/GSoC#PythonhighlevelmapinteractionforGRASSGIS>`_
+
+
+..
+    Indices and tables
+    ==================
+
+    * :ref:`genindex`
+    * :ref:`modindex`
+    * :ref:`search`
+



More information about the grass-commit mailing list