[GRASS-SVN] r61935 - in grass/trunk: lib/gis man tools
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Sep 13 18:27:32 PDT 2014
Author: wenzeslaus
Date: 2014-09-13 18:27:32 -0700 (Sat, 13 Sep 2014)
New Revision: 61935
Modified:
grass/trunk/lib/gis/parser_html.c
grass/trunk/man/build_html.py
grass/trunk/man/grassdocs.css
grass/trunk/tools/mkhtml.py
Log:
doc: new style for manual pages (co-author: neteler)
* page in block with given width to have shorter lines on wide screens (selected width 700px)
* improved style for TOC: smaller spacing, links green, underlined on hover, heading, unfolds on hover (might not be need with narrow content), transparent when folded
* all links green
* headings has different sizes (h2 and h3 had the same size - large)
* the whole page must be in containder div for narrow content to work
Modified: grass/trunk/lib/gis/parser_html.c
===================================================================
--- grass/trunk/lib/gis/parser_html.c 2014-09-14 01:27:24 UTC (rev 61934)
+++ grass/trunk/lib/gis/parser_html.c 2014-09-14 01:27:32 UTC (rev 61935)
@@ -49,7 +49,8 @@
fprintf(stdout,
"<link rel=\"stylesheet\" href=\"grassdocs.css\" type=\"text/css\">\n");
fprintf(stdout, "</head>\n");
- fprintf(stdout, "<body bgcolor=\"white\">\n\n");
+ fprintf(stdout, "<body bgcolor=\"white\">\n");
+ fprintf(stdout, "<div id=\"container\">\n\n");
fprintf(stdout,
"<a href=\"index.html\"><img src=\"grass_logo.png\" alt=\"GRASS logo\"></a>\n");
fprintf(stdout, "<hr class=\"header\">\n\n");
Modified: grass/trunk/man/build_html.py
===================================================================
--- grass/trunk/man/build_html.py 2014-09-14 01:27:24 UTC (rev 61934)
+++ grass/trunk/man/build_html.py 2014-09-14 01:27:32 UTC (rev 61935)
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# utilities for generating HTML indices
-# (c) 2003-2006, 2009-2013 by the GRASS Development Team, Markus Neteler, Glynn Clements, Luca Delucchi
+# (c) 2003-2014 by the GRASS Development Team, Markus Neteler, Glynn Clements, Luca Delucchi
import sys
import os
@@ -49,7 +49,7 @@
r""" <link rel="stylesheet" href="grassdocs.css" type="text/css">
</head>
<body style="width: ${body_width}">
-
+<div id="container">
<!-- this file is generated by man/build_html.py -->
<a href="index.html"><img src="grass_logo.png" alt="GRASS logo"></a>
@@ -189,6 +189,8 @@
r"""<hr class="header">
<p><a href="${index_url}">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>
+
+</div>
</body>
</html>
""")
@@ -209,6 +211,7 @@
toc = \
r"""
<div class="toc">
+<h4 class="toc">Table of contents</h4>
<ul class="toc">
<li class="toc"><a class="toc" href="full_index.html#d">Display commands (d.*)</a></li>
<li class="toc"><a class="toc" href="full_index.html#db">Database commands (db.*)</a></li>
@@ -271,6 +274,7 @@
<link rel="stylesheet" href="grassdocs.css" type="text/css">
</head>
<body style="width: 99%">
+<div id="container">
<a href="index.html"><img src="grass_logo.png" alt="GRASS logo"></a>
<hr class="header">
@@ -284,6 +288,7 @@
<link rel="stylesheet" href="grassdocs.css" type="text/css">
</head>
<body style="width: 99%">
+<div id="container">
<a href="index.html"><img src="grass_logo.png" alt="GRASS logo"></a>
<hr class="header">
@@ -296,6 +301,7 @@
<link rel="stylesheet" href="grassdocs.css" type="text/css">
</head>
<body bgcolor="white">
+<div id="container">
<a href="index.html"><img src="grass_logo.png" alt="GRASS logo"></a>
<hr class="header">
Modified: grass/trunk/man/grassdocs.css
===================================================================
--- grass/trunk/man/grassdocs.css 2014-09-14 01:27:24 UTC (rev 61934)
+++ grass/trunk/man/grassdocs.css 2014-09-14 01:27:32 UTC (rev 61935)
@@ -1,4 +1,4 @@
-/* GRASS documentation site style sheet
+/* GRASS GIS documentation site style sheet
*
* send improvements to GRASS Developers list
*
@@ -14,9 +14,26 @@
background: white;
color: black;
font-family: arial,sans-serif;
- width: 80%;
}
+#container
+{
+ position: relative;
+ margin: 0 auto;
+ padding-left: 10px;
+ padding-right: 10px;
+ width: 700px;
+ background-color: white;
+ height:auto !important;
+ min-height: 100%;
+ border-style:solid;
+ border-bottom-width: 2px;
+ border-top-width: 2px;
+ border-left-width: 10px;
+ border-right-width: 10px;
+ border-color: #DDDDDD;
+}
+
hr.header {
height: 3px;
color: gray;
@@ -29,7 +46,8 @@
color: rgb(25%, 60%, 25%);
font-family: arial,sans-serif;
font-weight: bold;
- font-size: x-large;
+ font-size: xx-large;
+ width: 80%; /* avoid collision with toc */
}
h2{
@@ -37,7 +55,7 @@
color: rgb(25%, 60%, 25%);
font-family: arial,sans-serif;
font-weight: bold;
- font-size: large;
+ font-size: x-large;
}
h3{
@@ -56,6 +74,14 @@
font-size: medium;
}
+a {
+ color: rgb(25%, 60%, 25%);
+}
+
+a:visited {
+ color: rgb(25%, 60%, 25%);
+}
+
div.code{
width: 97%;
color : black;
@@ -104,7 +130,7 @@
}
div.toc{
- background-color: transparent;
+ /* background-color: transparent; */
position: fixed;
border: solid 1px rgb(25%, 60%, 25%);
top: 5px;
@@ -112,19 +138,53 @@
width: 17%;
font-size: small;
border-radius: 10px;
+ z-index: 1;
}
li.toc {
- margin-left: -15px;
- padding: 3px 3px; 3px; 3px;
+ margin-left: 0;
+ padding: 3px 3px 3px 3px;
+ padding-left: 0;
color: rgb(25%, 60%, 25%);
}
ul.toc {
margin-top: 3px;
margin-bottom: 3px;
+ padding-left: 10%;
+ margin-left: 5%;
}
a.toc {
text-decoration: none;
}
+
+a.toc:hover, a.toc:active {
+ text-decoration: underline;
+}
+
+h4.toc {
+ padding-top: 3px;
+ margin-top: 3px;
+ padding-bottom: 3px;
+ margin-bottom: 3px;
+ padding-left: 6px;
+}
+
+/* show and hide toc */
+
+div.toc:hover ul {
+ display: block;
+}
+
+div.toc ul {
+ display: none;
+}
+
+div.toc:hover {
+ background-color: white;
+}
+
+div.toc {
+ background-color: rgba(255, 255, 255, 0.7);
+}
Modified: grass/trunk/tools/mkhtml.py
===================================================================
--- grass/trunk/tools/mkhtml.py 2014-09-14 01:27:24 UTC (rev 61934)
+++ grass/trunk/tools/mkhtml.py 2014-09-14 01:27:32 UTC (rev 61935)
@@ -36,6 +36,8 @@
<link rel="stylesheet" href="grassdocs.css" type="text/css">
</head>
<body bgcolor="white">
+<div id="container">
+
<a href="index.html"><img src="grass_logo.png" alt="GRASS logo"></a>
<hr class="header">
"""
@@ -51,6 +53,7 @@
"""<hr class="header">
<p><a href="index.html">Main index</a> | <a href="${INDEXNAME}.html">${INDEXNAMECAP} 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>
+</div>
</body>
</html>
""")
@@ -59,6 +62,7 @@
"""<hr class="header">
<p><a href="index.html">Main 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>
+</div>
</body>
</html>
""")
@@ -133,6 +137,7 @@
fd = sys.stdout
fd.write('<div class="toc">\n')
+ fd.write('<h4 class="toc">Table of contents</h4>\n')
fd.write('<ul class="toc">\n')
first = True
has_h2 = False
More information about the grass-commit
mailing list