* docs/reference: Add resources for `docwriter'. Add the required resources (images, JS, CSS) for `docwriter'. * docs/reference/.gitignore: Update to ignore `site' folder and other files generated by docwriter. * docs/reference/README: Add docwriter usage information and troubleshooting tips. * docs/reference/markdown: New directory to hold generated markdown files and other resources.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347
diff --git a/docs/reference/.gitignore b/docs/reference/.gitignore
index 2d19fc7..e245bdc 100644
--- a/docs/reference/.gitignore
+++ b/docs/reference/.gitignore
@@ -1 +1,12 @@
+# Static site folder
+site/
+
+# HTML and Markdown files
*.html
+*.md
+
+# MkDocs Config file
+mkdocs.yml
+
+# Python virtualenv
+env/
diff --git a/docs/reference/README b/docs/reference/README
index 51b04d6..3ffcfc0 100644
--- a/docs/reference/README
+++ b/docs/reference/README
@@ -1,5 +1,35 @@
-After saying `make refdoc' this directory contains the FreeType API
-reference. You need python to make this target.
+After saying `make refdoc' or `make refdoc-venv' the `site/' directory
+contains the FreeType API reference. You need python and pip to make this
+target.
+
+There are two ways to generate the documentation:
+
+1. Using `make refdoc':
+
+ - Ensure `python' and `pip' are available.
+ - Install pip package `docwriter' with `pip install --user docwriter'.
+ - Make target with `make refdoc'.
+ - This target can be run offline once required packages are installed.
+
+2. Using `make refdoc-venv' (requires internet access):
+
+ - Ensure `python', `pip' and python package `virtualenv' are available.
+ - Make target with `make refdoc-venv'.
+ - This may or may not require internet access every time depending on
+ pip and system caching.
This also works with Jam: Just type `jam refdoc' in the main directory.
+Some troubleshooting tips:
+
+* Regularly run `pip install --upgrade docwriter' to check for updates which
+may include bug fixes.
+
+* Ensure that `docwriter' is installed in the same python target that
+`make refdoc' uses (python3/python2/python).
+
+* `pip' and `python' may point to different versions of Python. Check using
+`python --version' and `pip --version'.
+
+* If none of this works, send a mail to `freetype-devel@nongnu.org' or file
+an issue at `https://github.com/freetype/docwriter/issues'.
diff --git a/docs/reference/markdown/images/favico.ico b/docs/reference/markdown/images/favico.ico
new file mode 100644
index 0000000..a1a22ed
Binary files /dev/null and b/docs/reference/markdown/images/favico.ico differ
diff --git a/docs/reference/markdown/javascripts/extra.js b/docs/reference/markdown/javascripts/extra.js
new file mode 100644
index 0000000..00f1670
--- /dev/null
+++ b/docs/reference/markdown/javascripts/extra.js
@@ -0,0 +1,54 @@
+/*
+Internal link topbar offest adjust Javascript
+Code provided by @makshh on GitHub
+
+Bug report on material-mkdocs
+ https://github.com/squidfunk/mkdocs-material/issues/791
+*/
+
+// Offset top helper
+function offsetY(elem) {
+ if(!elem) elem = this;
+ var y = elem.offsetTop;
+ while (elem = elem.offsetParent) {
+ y += elem.offsetTop;
+ }
+ return y;
+}
+
+// If a link on the same page is clicked, calculate the
+// correct offset and scroll to that part of the page.
+//
+var links = document.getElementsByTagName('a');
+for(var i = 0; i < links.length; i++) {
+ links[i].onclick = function (event) {
+ if (this.pathname == window.location.pathname &&
+ this.protocol == window.location.protocol &&
+ this.host == window.location.host) {
+ event.preventDefault();
+ if(this.hash.substr(1)){
+ var o = document.getElementById(this.hash.substr(1));
+ var sT = offsetY(o) - document.getElementsByClassName('md-header')[0].clientHeight;
+ window.location.hash = this.hash;
+ window.scrollTo(0, sT);
+ }
+ }
+ }
+}
+
+// Slugify supplied text
+function slugify(text){
+ text = text.toLowerCase();
+ text = text.replace(" ", "-");
+ return text;
+}
+
+// If there is a hash in the url, slugify it
+// and replace
+if(window.location.hash) {
+ // Fragment exists
+ slug = slugify(window.location.hash);
+ history.replaceState(undefined, undefined, slug)
+ //window.location.hash = slug;
+ document.location.replace(window.location.href);
+}
diff --git a/docs/reference/markdown/stylesheets/extra.css b/docs/reference/markdown/stylesheets/extra.css
new file mode 100644
index 0000000..92850ef
--- /dev/null
+++ b/docs/reference/markdown/stylesheets/extra.css
@@ -0,0 +1,218 @@
+/* Body and page */
+.wy-nav-content {
+ max-width: 90%;
+}
+.md-grid {
+ max-width: 90%;
+}
+.md-sidebar--secondary {
+ margin-left: 90%;
+}
+p {
+ text-align: justify;
+ /* margin: 1.5ex 0 1.5ex 0;
+ */
+}
+/* .md-typeset p{
+ margin: 1em 1em 0 1em;
+}
+*/
+/* code blocks */
+pre.colored {
+ color: blue;
+}
+pre {
+ font-family: monospace;
+ background-color: #D6E8FF;
+ padding: 2ex 0 2ex 1%;
+ overflow-x:auto;
+}
+span.keyword {
+ font-family: monospace;
+ text-align: left;
+ white-space: pre;
+ color: #d73a49;
+}
+/* H4 Heading */
+h4 {
+ background-color: #EEEEFF;
+ font-size: medium;
+ font-style: oblique;
+ font-weight: bold;
+ /* margin: 3ex 0 1.5ex 9%;
+ */
+ padding: 0.3em 0 0.3em 1%;
+}
+/* Fields table */
+table.fields {
+ width: 90%;
+ margin: 1.5ex 0 1.5ex 10%;
+}
+table.fields td.val {
+ font-weight: bold;
+ text-align: right;
+ width: 30%;
+ vertical-align: baseline;
+ padding: 1em 1em 0 0;
+}
+table.fields td.desc {
+ vertical-align: baseline;
+ padding: 1ex 0 0 1em;
+}
+table.fields td.desc p:first-child {
+ margin: 0;
+}
+
+table.fields td.desc p {
+ margin: 1.5ex 0 0 0;
+}
+
+/* START EXPERIMENTAL CODE */
+table.long {
+ display: block;
+ width: 93%;
+}
+table.long thead,
+table.long tbody,
+table.long th,
+table.long td,
+table.long tr {
+ display: block;
+}
+/* Hide table headers (but not display: none;
+, for accessibility) */
+table.long thead tr {
+ position: absolute;
+ top: -9999px;
+ left: -9999px;
+}
+table.long tr {
+ border: 0;
+}
+table.long {
+ margin: 1.5ex 3% 1.5ex 3%;
+}
+table.long td.val {
+ text-align: left;
+}
+table.long td {
+ /* Behave like a "row" */
+ border: none;
+ border-bottom: 0;
+ position: relative;
+ padding-left: 50%;
+}
+table.long td:before {
+ /* Now like a table header */
+ position: absolute;
+ /* Top/left values mimic padding */
+ top: 6px;
+ left: 6px;
+ width: 45%;
+ padding-right: 10px;
+ white-space: nowrap;
+}
+/* END EXPERIMENTAL CODE */
+
+/* Index table */
+table.index {
+ width: 100%;
+ border-collapse: collapse;
+ border: 0;
+ border-spacing: 1em 0.3ex;
+}
+table.index tr {
+ padding: 0;
+}
+table.index td {
+ padding: 0;
+}
+table.index-toc-link {
+ width: 100%;
+ border: 0;
+ border-spacing: 0;
+ margin: 1ex 0 1ex 0;
+}
+table.index-toc-link td.left {
+ padding: 0 0.5em 0 0.5em;
+ font-size: 83%;
+ text-align: left;
+}
+table.index-toc-link td.middle {
+ padding: 0 0.5em 0 0.5em;
+ font-size: 83%;
+ text-align: center;
+}
+table.index-toc-link td.right {
+ padding: 0 0.5em 0 0.5em;
+ font-size: 83%;
+ text-align: right;
+}
+/* toc table */
+table.toc {
+ width: 95%;
+ margin: 1.5ex 0 1.5ex 5%;
+}
+table.toc td.link {
+ width: 30%;
+ text-align: right;
+ vertical-align: baseline;
+ padding: 1ex 1em 1ex 0;
+}
+table.toc td.desc {
+ vertical-align: baseline;
+ padding: 1ex 0 1ex 1em;
+ text-align: left;
+}
+table.toc td.desc p:first-child {
+ margin: 0;
+ text-align: left;
+}
+table.toc td.desc p {
+ margin: 1.5ex 0 0 0;
+ text-align: left;
+}
+div.timestamp {
+ font-size: small;
+}
+/* Max width before this PARTICULAR table gets nasty This query will take effect for any screen smaller than 760px and also iPads specifically. */
+@media only screen and (max-width: 760px), (min-device-width: 768px) and (max-device-width: 1024px) {
+ /* Force table to not be like tables anymore */
+ table, thead, tbody, th, td, tr {
+ display: block;
+ }
+ /* Hide table headers (but not display: none;
+ , for accessibility) */
+ thead tr {
+ position: absolute;
+ top: -9999px;
+ left: -9999px;
+ }
+ tr {
+ border: 0;
+ }
+ table.fields {
+ width: 93%;
+ margin: 1.5ex 3% 1.5ex 3%;
+ }
+ table.fields td.val {
+ text-align: left;
+ }
+ td {
+ /* Behave like a "row" */
+ border: none;
+ border-bottom: 0;
+ position: relative;
+ padding-left: 50%;
+ }
+ td:before {
+ /* Now like a table header */
+ position: absolute;
+ /* Top/left values mimic padding */
+ top: 6px;
+ left: 6px;
+ width: 45%;
+ padding-right: 10px;
+ white-space: nowrap;
+ }
+}