[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master a7c16cd: CSS updates for manual webpage
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master a7c16cd: CSS updates for manual webpage |
Date: |
Sun, 25 Sep 2016 13:00:49 +0000 (UTC) |
branch: master
commit a7c16cd61a222ecd192945018c419d993df657bd
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
CSS updates for manual webpage
The CSS for the manual webpage was further updated after the previous
commit.
- The header (h1, h2, ...) rules are unchanged, but brought before the
other classes of contents for contextual reading: headers appear before
paragraphs and images and etc.
- The no indentation rule was changed to be very generic and easy: until
now, we gave an indentation to all paragraphs, then selected those that
happen first. But that had too much trouble and too many conditions. In
this CSS we done the opposite: by default we assume no indentation. If a
paragraph is followed by another (or has any other tag between it and
another paragraph) then it is indented. This greatly simplified the CSS.
- The spacings were made to be more meaningful.
The `doc/forwebpaeg' script was also updated:
- It now only gets one input directory and specifies a name for the
temporary directory internally.
- It will print the Gnuastro version on the last line (with a link to the
main Gnuastro webpage) to avoid confusion when the user is using other
version (newer alpha versions, or older versions).
- The `htmldatecomment' was removed to also check that difference when
rebuilding the page. It would be very confusing for readers to flip
through the HTML pages and see different dates/versions. Even though the
content is the same.
---
doc/forwebpage | 33 ++++++++------
doc/style.css | 130 +++++++++++++++++++++++++++++++++++++++-----------------
2 files changed, 111 insertions(+), 52 deletions(-)
diff --git a/doc/forwebpage b/doc/forwebpage
index 5fa6d67..0effa50 100755
--- a/doc/forwebpage
+++ b/doc/forwebpage
@@ -7,7 +7,10 @@
# first time. NOTE: This script is defined to be run in Gnuastro's `doc/'
# directory. It should not be called from anywhere else.
#
-# ./forwebpage /temporary/directory /destination/directory
+# # IMPORTANT: do not end the destination directory with a `/'.
+# ./forwebpage /destination/directory
+#
+# The temporary directory will be named `/destination/directory_tmp'.
#
# This script will first run gendocs.sh on the Texinfo source which creates
# the standrard GNU webpage style documentation page. Then it does some
@@ -99,14 +102,17 @@ set -o errexit # Stop if a program
returns false.
umask 002
# Set the temporary directory name:
-tmpdir=$1
+tmpdir=$1_tmp
# Top CVS (webpage checkout) copy
-topwebcheckout=$2
+topwebcheckout=$1
# Set the title value
booktitle="GNU Astronomy Utilities"
+# Get the version of the manual:
+version=$(awk '$2=="VERSION" {print $3}' version.texi)
+
# If the temporary directory already exists, warn the user and abort.
# gendocs.sh will write everything there and we want everything there to be
# freshly created.
@@ -214,8 +220,8 @@ IFS=''
# Make the proper corrections to the HTML files:
echo
-htmldatecomment='<!-- Inserted date. This line will be ignored by diff -->'
echo %%%%% Correcting the HTMLs %%%%%
+
# Correct the address of the `(dir)' links on the top pages of both
# HTML outputs. In the $tmpdir/gnuastro.html, it is `dir.html#top'
# which should be change to index.html. In
@@ -279,14 +285,18 @@ do
echo "</noscript>" >> tmp.html
echo "" >> tmp.html
fi
- echo "<p class=\"bottom-links\"><a
href=\"http://www.gnu.org/software/gnuastro/manual\";>Read in other
formats</a>.</p>" >> tmp.html
+
+ # Add "Read in other formats":
+ echo "<p class=\"bottom-links\"><a
href=\"$cssbase/index.html\">Read in other formats</a>.</p>" >> tmp.html
+
+ # If there is any Javascript in the page, then let the users know.
if [ $hasjavascript = "yes" ]; then
- echo "<p class=\"bottom-links\"><a
href=\"http://www.gnu.org/software/gnuastro/manual/javascript.html\";
rel=\"jslicense\">JavaScript license information</a></p>" >> tmp.html
+ echo "<p class=\"bottom-links\"><a
href=\"$cssbase/javascript.html\" rel=\"jslicense\">JavaScript license
information</a></p>" >> tmp.html
fi
- # Note that the htmldatecomment put after this line is later
- # used to ignore this line in the diffs (so the months on the
- # webpage don't change if this page hasn't changed).
- echo "<p class=\"bottom-links\"><a
href=\"http://www.gnu.org/software/gnuastro\";>GNU Astronomy Utilities</a>
manual, $thismonth.</p> $htmldatecomment" >> tmp.html
+
+ # Put a link to the main Gnuastro webpage.
+ echo "<p class=\"bottom-links\"><a href=\"$jsbase/index.html\">GNU
Astronomy Utilities</a> $version manual, $thismonth.</p>" >> tmp.html
+
fi
#Do any modifications to the line:
@@ -340,8 +350,7 @@ do
# realpath is part of GNU Coreutils.
relname=$(realpath $filename --relative-to=$tmpdir)
if ! diff $filename $topwebcheckout/gnuastro/manual/$relname \
- -I '<!-- This book documents version' \
- -I "$htmldatecomment"; then
+ -I '<!-- This book documents version'; then
cp $filename $topwebcheckout/gnuastro/manual/$relname;
echo "$relname:"
echo " -- Copied to for upload"
diff --git a/doc/style.css b/doc/style.css
index acc8a16..72d2841 100644
--- a/doc/style.css
+++ b/doc/style.css
@@ -19,6 +19,9 @@ A copy of the GNU General Public License is available at
<http://www.gnu.org/licenses>.*/
+
+
+
/* Layout
The CSS Style rules categorized as "Layout" here are to do with the
@@ -91,6 +94,32 @@ body{
}
+
+
+
+/* Headers
+
+ The default body font-weight is 100 (thin), so the default "bold"
+ weight of these headers will make them too thick. Therefore we set
+ these headings to have a font-weight or normal or 400.*/
+h1, h2, h3, h4, h5, h6{
+ font-weight: 400;
+ margin-bottom: 0.3em;
+}
+h1{
+ margin-top: 0;
+ font-size: 1.8em;
+}
+h2{ font-size: 1.5em; }
+h3{ font-size: 1.3em; }
+h4{ font-size: 1.2em; }
+h5{ font-size: 1.1em; }
+h6{ font-size: 1.0em; }
+
+
+
+
+
/* Paragraphs
By default all the paragraphs are indented, except for those that
@@ -98,61 +127,64 @@ body{
zero. */
p{
margin-top: 0;
- text-indent: 1em;
+ text-indent: 0;
line-height: 1.3;
margin-bottom: 0.2em;
}
-em {
- font-weight: 100;
- font-style: italic;
+/* Paragraphs that follow other paragraphs should be indented.*/
+p+p, p+*+p {
+ text-indent: 1em;
}
/* Header (and bottom) links to next and previous titles: */
.header p {
- text-indent: 0;
font-size: 85%;
}
-/* Paragraphs that are immediately after a header or a header and an image,
- or within dd structures, or have links before them (from the index) must
- not have any indentation.*/
-p.bottom-links, dd p,
-h1+p, h1+img+p, h1+figure+p, h1+a+p, h1+a+a+p,
-h2+p, h2+img+p, h2+figure+p, h2+a+p, h2+a+a+p,
-h3+p, h3+img+p, h3+figure+p, h3+a+p, h3+a+a+p,
-h4+p, h4+img+p, h4+figure+p, h4+a+p, h4+a+a+p,
-h5+p, h5+img+p, h5+figure+p, h5+a+p, h5+a+a+p,
-h6+p, h6+img+p, h6+figure+p, h6+a+p, h6+a+a+p, {
+/* Size of bottom links. Also note that since we have multiple bottom
+ links, we need to make sure there is no indentation. */
+p.bottom-links {
text-indent: 0;
+ font-size: 90%;
}
-p.bottom-links {
- font-size: 90%;
+/* When there are multiple footnotes the rules above will indent the
+ footnote contents, so we have to explicitly ask for no indentation: */
+.footnote p {
+ text-indent: 0;
}
-dd{
- padding-bottom: 1em;
+
+
+
+
+/* The emphasis lines */
+em {
+ font-size: 90%;
+ font-weight: 100;
+ font-style: italic;
}
-/* Headers
- The default body font-weight is 100 (thin), so the default "bold"
- weight of these headers will make them too thick. Therefore we set
- these headings to have a font-weight or normal or 400.*/
-h1, h2, h3, h4, h5, h6{
- font-weight: 400;
- margin-bottom: 0.3em;
+
+
+/* Lists: */
+li {
+ padding-bottom: 0.4em;
}
-h1{
- margin-top: 0;
- font-size: 1.8em;
+
+
+
+
+
+/* dd elements */
+dd{
+ padding-bottom: 0.4em;
}
-h2{ font-size: 1.5em; }
-h3{ font-size: 1.3em; }
-h4{ font-size: 1.2em; }
-h5{ font-size: 1.1em; }
-h6{ font-size: 1.0em; }
+
+
+
/* Images */
@@ -170,6 +202,9 @@ h6{ font-size: 1.0em; }
}
+
+
+
/* Example code blocks */
div.example {
width: 90%;
@@ -186,6 +221,23 @@ code, samp {
}
+
+
+
+/* Cartouche boxes. */
+table.cartouche {
+ margin:10px;
+ border:solid;
+ border-width:1px;
+ padding:0.5em 1em 0 1em;
+ border-radius:10px;
+ background-color:#e6eaf4;
+}
+
+
+
+
+
/* Links
The links are distinguished from the main text by being a brigher
@@ -204,6 +256,8 @@ a:hover{ color: #0099ff; }
+
+
/* Sub and Super scripts
Leave line spacing unchanged when <sub> and <sup> are used. */
@@ -219,6 +273,8 @@ sub{ bottom: -0.25em; }
+
+
/* Footnotes: */
.footnote h4 {
font-size: 90%;
@@ -230,9 +286,3 @@ sub{ bottom: -0.25em; }
.footnote p {
font-size: 80%;
}
-
-
-/* MathJax: */
-.MathJax {
- font-size: 3em;
-}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master a7c16cd: CSS updates for manual webpage,
Mohammad Akhlaghi <=