Skip to content

Commit

Permalink
Format online documentation
Browse files Browse the repository at this point in the history
Main goal to be more readable. Specifically:

- Make pages look more paper-like by

    * having margins for the text to the "paper",

    * having margins for the "paper" to the borders of the screen, and

    * applying a maximum width for the "paper".

- Change fonts to the free fonts FreeSerif, FreeSans and Mononoki.

- Change to:

    * Serif in body text.

    * Sans-serif almost everywhere else.

  I did this as I think it is easier to read texts with serif in
  comparison to sans-serif, and since it looks better when switching to
  and from the math Computer Modern Roman used by MathJax which is of
  serif-type.

- Reduce size of headers as they were overwhelmingly large.

- Remove box around inline code. As the documentation is written as a
  text, code should only be considered as another font family, similar
  to how italic/oblique is used to emphasize things and how italic
  symbols are used in mathematics: It is simply another "mode" in the
  text.

- Insert spacing between items in the sidebar as they were too close to
  each other.

- Reduce size of term in description list.

NOTE:  Some things in the documentation should be changed in order to
look the best. One of these is to use monospace/inline code when
referring to a computer variable. Another thing is to use monospace for
C-files (*.c, *.h) in the headers. Optionally, one can also start using
monospace when referring to websites and emails; I need to think about
how to do this in practice first (there are multiple options).
  • Loading branch information
albinahlback committed Apr 11, 2022
1 parent ab5e81c commit 472e7e1
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 1 deletion.
88 changes: 87 additions & 1 deletion doc/source/_static/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,94 @@ ul .toctree-l1 {

div.body {
min-width: 450px;
max-width: 100%;
max-width: 900px;
padding: 5% 7% 5% 7%;
margin-left: auto;
margin-right: auto;
}

li p { margin: 0.2em; }



@import url("importfonts.css");


/*
################################################################################
# set fonts
################################################################################
*/

/* set standard for everything else */
div.body
{
font-family: FreeSerif, serif;
font-size: 110%;
}
b
{
font-family: FreeSerif, serif;
font-style: normal;
font-weight: bold;
font-size: 105%;
}
em
{
font-family: FreeSerif, serif;
font-style: italic;
font-size: 105%;
}
pre
{
font-family: Mononoki, monospace;
font-size: 87%;
}
kbd, code /* Code and inputs */
{
background-color: rgba(0, 0, 0, 0); /* Transparent */
font-family: Mononoki, monospace;
font-size: 87%;
padding: 0px;
}

/* headings */
h1, h2, h3, h4, h5, h6
{
font-family: FreeSans, sans-serif;
}
h1 code
{
font-family: Mononoki, monospace;
font-size: 92%;
font-weight: bold; /* Typeset C-files as bold in main header */
}
h2 code, h3 code, h4 code, h5 code, h6 code
{
font-family: Mononoki, monospace;
font-size: 92%;
font-weight: normal; /* Don't make it bold in other headers*/
}
div.body h1 { font-size: 180%; }
div.body h2 { font-size: 140%; }
div.body h3 { font-size: 125%; }
div.body h4 { font-size: 115%; }
div.body h5 { font-size: 110%; }
div.body h6 { font-size: 100%; }

/* sidebar */
.sphinxsidebarwrapper { font-size: 110%; }
.sphinxsidebarwrapper li { margin: 3px 0; }

/* toctree */
div[class="toctree-wrapper compound"]
{
font-family: FreeSans, sans-serif; font-size: 92%;
}
div[class="toctree-wrapper compound"] code
{
font-family: Mononoki, monospace; font-size: 92%;
}

/* description lists */
dt { font-size: 90%; }
Binary file added doc/source/_static/fonts/FreeSans-small.woff
Binary file not shown.
Binary file added doc/source/_static/fonts/FreeSerif-small.woff
Binary file not shown.
Binary file added doc/source/_static/fonts/FreeSerifBold-small.woff
Binary file not shown.
Binary file not shown.
Binary file added doc/source/_static/fonts/mononoki-Regular.woff2
Binary file not shown.
55 changes: 55 additions & 0 deletions doc/source/_static/importfonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@font-face
{
font-family: FreeSans;
src: url(fonts/FreeSans-small.woff);
}

/* These two should never be used in our typesetting */
/* @font-face */
/* { */
/* font-family: FreeSans; */
/* src: url(fonts/FreeSansBold-small.woff); */
/* font-weight: bold; */
/* } */

/* @font-face */
/* { */
/* font-family: FreeSans; */
/* src: url(fonts/FreeSansOblique.woff); */
/* font-style: oblique; */
/* } */

@font-face
{
font-family: FreeSerif;
src: url(fonts/FreeSerif-small.woff);
}

@font-face
{
font-family: FreeSerif;
src: url(fonts/FreeSerifItalic-small.woff);
font-style: italic;
}

@font-face
{
font-family: FreeSerif;
src: url(fonts/FreeSerifBold-small.woff);
font-weight: bold;
}

/* Neither should this one */
/* @font-face */
/* { */
/* font-family: FreeSerif; */
/* src: url(fonts/FreeSerifBoldItalic-small.woff); */
/* font-style: italic; */
/* font-weight: bold; */
/* } */

@font-face
{
font-family: Mononoki;
src: url(fonts/mononoki-Regular.woff2);
}

0 comments on commit 472e7e1

Please sign in to comment.