gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master fa224c5: Dirty fix to CSS first paragraph inde


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master fa224c5: Dirty fix to CSS first paragraph indentation
Date: Mon, 3 Oct 2016 23:27:16 +0000 (UTC)

branch: master
commit fa224c5a96662700ce8f1bcb981f9c2592da2e76
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    Dirty fix to CSS first paragraph indentation
    
    The indentation problem in the book's webpage can make it slightly hard to
    read the text: we are accustomed to seeing the first paragraph of a
    distinct part of text (for example under a title or within a quotation) not
    having any indentation. So when this indentation is not corrected in such
    cases, the text becomes unprofessional and strange to the eye: why should
    the text under a title be indented? Is the title irrelevant to the text
    (like an image)?
    
    When the `<p>' tags have a parent like `.header', `dd', `li', `blockquote'
    and the rest, it is very easy to write a CSS to apply the
    indentation. However, unfortunately the regions between titles and the end
    of the page in Texinfo's output is not within an environment. Also, between
    the title and first paragraph there might be images, or index links.
    
    A dirty solution to this problem was to manually select all paragraphs with
    non-paragraph tags between them and a header. Since we can only work with
    known numbers of tags in CSS, we then had to explicitly add a fixed number
    of non-paragraphs between the headers and paragraphs. This is dirty because
    it can be buggy and also if there is more than 10 tags between the title
    and first paragraph, the first paragraph will be indented. So it is not the
    best solution to the problem.
    
    However, this dirty fix does make most of the text more readable, so we are
    implementing it with this commit until a better and more general solution
    is found. Maybe we can get in touch with the Texinfo developers and ask
    them to put the text within one header inside of a parent tag. I will try
    to write up a list of requests (as we do in the `doc/forwebpage' script)
    and submit to them.
---
 Makefile.am       |    8 ++---
 doc/gnuastro.texi |    6 ++--
 doc/style.css     |  101 +++++++++++++++++++++++++++++++++++++++++++++--------
 3 files changed, 94 insertions(+), 21 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 8a96d06..8d93660 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -216,11 +216,11 @@ install-exec-local:
         echo 
"==================================================================="; \
         echo "      ,           , ";                                           
     \
         echo "     /             \ ";                                          
     \
-        echo "    ((__-^^-,-^^-__))        Congratulations!";                  
     \
-        echo "     \`-_---' \`---_-'         GNU Astronomy Utilities 
(Gnuastro),";  \
-        echo "      \`--|o\` 'o|--'          Version $(VERSION)";              
     \
+        echo "    ((__-^^-,-^^-__))       Congratulations!";                   
     \
+        echo "     \`-_---' \`---_-'        GNU Astronomy Utilities 
(Gnuastro),";   \
+        echo "      \`--|o\` 'o|--'         Version $(VERSION)";               
     \
         echo "         \  \`  / ";                                             
     \
-        echo "          ): :(              Successfully installed on this 
sytem.";  \
+        echo "          ): :(             Successfully installed on this 
system.";  \
         echo "          :o_o: ";                                               
     \
         echo "           \"-\" ";                                              
     \
         echo;                                                                  
     \
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index a2fbbeb..ef1d5c9 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -16984,9 +16984,9 @@ One of the most common formats to store and transfer 
normally sized data
 are ASCII files (which can be seen on a text editor). During your
 processing experiments (with the data, or what programmers call
 ``developing'') you will also often want to see how your data is being
-processed and one of the easiest ways to check out out your arrays is to
-write them out as an ASCII file and check them. The functions here are
-mainly focused on tables that contain numbers.
+processed and one of the easiest ways to check out your arrays is to write
+them out as an ASCII file and check them. The functions here are mainly
+focused on tables that contain numbers.
 
 @deffn Macro GAL_TXTARRAY_LOG
 When an element of the input table cannot be read as a number, the column
diff --git a/doc/style.css b/doc/style.css
index 1db73e2..90a3934 100644
--- a/doc/style.css
+++ b/doc/style.css
@@ -130,17 +130,97 @@ h6{ font-size: 1.0em; }
 
 
 
-/* Paragraphs */
+/* Paragraphs: by default they are indented. */
 p{
     margin-top: 0;
-    text-indent: 0;
-    line-height: 1.3;
+    line-height: 1.4;
+    text-indent: 1em;
     margin-bottom: 0.2em;
 }
 
-/* Paragraphs that follow other paragraphs should be indented.*/
-p+p, p+*+p {
-    text-indent: 1em;
+
+/* Select all paragraphs that must not be indented. Some of them don't need
+   any `:first-of-type' because:
+
+    - The `header's have only one <p> in the HTMLs.
+
+    - All `<p>'s in the `.footnote's and `.bottom-links's must have no
+      indentation, not just the first ones. */
+.header p,
+.footnote p,
+p.bottom-links,
+dd p:first-of-type,
+li p:first-of-type,
+.cartouche p:first-of-type,
+blockquote p:first-of-type,
+.float-caption p:first-of-type,
+h1 + p,
+h1 + :not(p) + p,
+h1 + :not(p) + :not(p) + p,
+h1 + :not(p) + :not(p) + :not(p) + p,
+h1 + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h1 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h1 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h1 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h1 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + p,
+h1 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + :not(p) + p,
+h1 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + :not(p) + :not(p) + p,
+h2 + p,
+h2 + :not(p) + p,
+h2 + :not(p) + :not(p) + p,
+h2 + :not(p) + :not(p) + :not(p) + p,
+h2 + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h2 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h2 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h2 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h2 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + p,
+h2 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + :not(p) + p,
+h2 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + :not(p) + :not(p) + p,
+h3 + p,
+h3 + :not(p) + p,
+h3 + :not(p) + :not(p) + p,
+h3 + :not(p) + :not(p) + :not(p) + p,
+h3 + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h3 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h3 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h3 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h3 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + p,
+h3 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + :not(p) + p,
+h3 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + :not(p) + :not(p) + p,
+h4 + p,
+h4 + :not(p) + p,
+h4 + :not(p) + :not(p) + p,
+h4 + :not(p) + :not(p) + :not(p) + p,
+h4 + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h4 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h4 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h4 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h4 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + p,
+h4 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + :not(p) + p,
+h4 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + :not(p) + :not(p) + p,
+h5 + p,
+h5 + :not(p) + p,
+h5 + :not(p) + :not(p) + p,
+h5 + :not(p) + :not(p) + :not(p) + p,
+h5 + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h5 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h5 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h5 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h5 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + p,
+h5 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + :not(p) + p,
+h5 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + :not(p) + :not(p) + p,
+h6 + p,
+h6 + :not(p) + p,
+h6 + :not(p) + :not(p) + p,
+h6 + :not(p) + :not(p) + :not(p) + p,
+h6 + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h6 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h6 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h6 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + p,
+h6 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + p,
+h6 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + :not(p) + p,
+h6 + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + :not(p) + 
:not(p) + :not(p) + :not(p) + p {
+    text-indent: 0;
 }
 
 /* Header (and bottom) links to next and previous titles: */
@@ -151,16 +231,9 @@ p+p, p+*+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%;
 }
 
-/* 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;
-}
-
 
 
 
@@ -223,7 +296,6 @@ dd{
 }
 .float-caption p {
     font-size: 90%;
-    text-indent: 0;
 }
 
 
@@ -266,6 +338,7 @@ table.cartouche {
 /* Menu tables */
 table.menu {
     font-size: 95%;
+    padding: 0.5em 0 0 1em;
 }
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]