From 10c9c4cf23e5023bea64553fb8c302ea7c5359b5 Mon Sep 17 00:00:00 2001 From: oleibman Date: Mon, 15 Feb 2021 11:50:20 -0800 Subject: [PATCH] Make Documentation Updates Easier and More Accurate (#1573) I made a documentation change and noticed that the result when browsed locally did not quite match what is seen when browsing from the web. After some research, I found https://github.com/mkdocs/mkdocs/issues/2028 That described my situation well and suggested adding an extra javascript script to the configuration. This worked exactly as desired on my local machine. This accounts for the presence of extrajs.js and mkdocs.yml in this request. In addition to the display problem, "mkdocs build" generates the documentation into a directory which is not ignored by git. I added that directory to .gitignore as part of this request. Finally, since I don't know how exactly the documentation makes it to production, I made an insignificant change to one doc file as a sanity check. --- .gitignore | 3 +++ docs/extra/extrajs.js | 5 +++++ docs/index.md | 2 +- mkdocs.yml | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 docs/extra/extrajs.js diff --git a/.gitignore b/.gitignore index 0723541d7a..eac08567d9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ *.project /.settings /.idea + +## mkdocs output +/site diff --git a/docs/extra/extrajs.js b/docs/extra/extrajs.js new file mode 100644 index 0000000000..9ad135e838 --- /dev/null +++ b/docs/extra/extrajs.js @@ -0,0 +1,5 @@ +document.addEventListener("DOMContentLoaded", function() { + document.querySelectorAll("table").forEach(function(table) { + table.classList.add("docutils"); + }); +}); \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index b1207d530b..42acedf97b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -89,7 +89,7 @@ php vendor/phpoffice/phpspreadsheet/samples/Basic/01_Simple.php ## Learn by documentation -For more in-depth documentation, you may read about an [overview of the +For more documentation in depth, you may read about an [overview of the architecture](./topics/architecture.md), [creating a spreadsheet](./topics/creating-spreadsheet.md), [worksheets](./topics/worksheets.md), diff --git a/mkdocs.yml b/mkdocs.yml index cf87a142a3..f79acb69cd 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,3 +5,5 @@ edit_uri: edit/master/docs/ theme: readthedocs extra_css: - extra/extra.css +extra_javascript: + - extra/extrajs.js