4
4
5
5
The domain https://docs.haskellstack.org hosts online documentation for the
6
6
Stack project, using [ Read the Docs] ( https://readthedocs.org/ ) with
7
- [ MkDocs] ( https://www.mkdocs.org/ ) .
7
+ [ MkDocs] ( https://www.mkdocs.org/ ) and the Material for MkDocs
8
+ [ theme] ( https://squidfunk.github.io/mkdocs-material/ ) .
8
9
9
10
## Read the Docs
10
11
@@ -42,8 +43,8 @@ It specifies a Python requirements file in `doc/requirements.txt`.
42
43
43
44
## MkDocs
44
45
45
- The ` doc/requirements.txt ` pins the version of MkDocs. As at 31 August 2021 it
46
- is set to:
46
+ The ` doc/requirements.txt ` file pins the version of MkDocs. As at
47
+ 2 September 2021 it is set to:
47
48
48
49
mkdocs==1.3.1
49
50
@@ -54,3 +55,65 @@ directory. See https://www.mkdocs.org/user-guide/configuration/.
54
55
are created. This directory is added to the ` .gitignore ` file.
55
56
56
57
MkDocs 1.3.0 replaced the ` pages: ` key with the ` nav: ` key.
58
+
59
+ ## Material for MkDocs
60
+
61
+ Stack moved from the default ` readthedocs ` theme to Material for MkDocs after
62
+ publishing the documentation for Stack 2.7.5. The new theme has extensive online
63
+ documentation and features that the default theme lacked.
64
+
65
+ The Material for MkDocs theme is loaded in the ` doc/requirements.txt ` file:
66
+
67
+ mkdocs-material
68
+
69
+ The theme is specified in the ` mkdocs.yml ` file:
70
+
71
+ ~~~ yaml
72
+ theme :
73
+ name : material
74
+ palette :
75
+ primary : ' deep purple'
76
+ accent : ' deep purple'
77
+ icon :
78
+ logo : material/language-haskell
79
+ ~~~
80
+
81
+ Read the Docs requires [JQuery](https://jquery.com/) for its JavaScript code to
82
+ inject the flyout menu. Material for MkDocs does not come with JQuery. So, the
83
+ following is required in the `mkdocs.yml` file :
84
+
85
+ ~~~yaml
86
+ extra_javascript :
87
+ - ' https://code.jquery.com/jquery-3.6.1.min.js'
88
+ ~~~
89
+
90
+ The Read the Docs flyout is formatted with a `font-size` that is 90% of the
91
+ ` body` ` font-size` . Material for MkDocs has a `body` `font-size` that is
92
+ ` 0.5rem` , which is small. A little additional CSS is added to the `extra.css`
93
+ file, to force the final `font-size` to be `0.7rem`. That size is consistent
94
+ with that of other elements in the theme.
95
+
96
+ ~~~css
97
+ body {
98
+ font-size : 0.777778rem;
99
+ }
100
+ ~~~
101
+
102
+ Material for MkDocs default suggestions for syntax highlighting in code blocks
103
+ are applied. They are specified in the ` mkdocs.yml ` file as:
104
+
105
+ ~~~ yaml
106
+ markdown_extensions :
107
+ - pymdownx.highlight :
108
+ anchor_linenums : true
109
+ - pymdownx.inlinehilite
110
+ - pymdownx.snippets
111
+ - pymdownx.superfences
112
+ ~~~
113
+
114
+ # # Testing
115
+
116
+ Online documentation can be tested by establishing a branch on the respository
117
+ that is then configured on the Read the Docs web site as 'Active' but
118
+ ' Hidden' - for example branch `mkdocs-test`. As the branch is 'Hidden' it does
119
+ not appear in the Read the Docs flyout or search results.
0 commit comments