Skip to content

Commit

Permalink
Updates local docs theme to match live with material theme (ddev#2840)
Browse files Browse the repository at this point in the history
  • Loading branch information
unn authored Mar 4, 2021
1 parent 027e807 commit 6388092
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/docscheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
- ".spellcheck.yml"
- ".markdownlintrc"
- "mkdocs.yml"
- ".readthedocs.yml"
- "requirements.txt"

jobs:
build:
Expand All @@ -30,5 +32,5 @@ jobs:
- name: Test mkdocs
run: |
sudo pip3 install setuptools
sudo pip3 install mkdocs==0.17.5
sudo pip3 install -r requirements.txt
mkdocs -q build -d /tmp/mkdocsbuild
15 changes: 15 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation with MkDocs
mkdocs:
configuration: mkdocs.yml

python:
version: 3.7
install:
- requirements: requirements.txt
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ markdownlint:
bash -c "$$CMD"; \
fi

# Best to install mkdocs locally with "sudo pip3 install mkdocs"
# Best to install mkdocs locally with "sudo pip3 install -r requirements.txt"
mkdocs:
@echo "mkdocs: "
@CMD="mkdocs -q build -d /tmp/mkdocsbuild"; \
if command -v mkdocs >/dev/null 2>&1; then \
$$CMD ; \
else \
sleep 1 && $(DOCKERTESTCMD) bash -c "$$CMD"; \
echo "Not running mkdocs because it's not installed"; \
fi

# Best to install pyspelling locally with "pip3 install pyspelling pymdown-extensions"
Expand Down
27 changes: 27 additions & 0 deletions docs/assets/extra.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
document.addEventListener("DOMContentLoaded", function() {
load_navpane();
});

function load_navpane() {
var width = window.innerWidth;
if (width <= 1200) {
return;
}

var nav = document.getElementsByClassName("md-nav");
for(var i = 0; i < nav.length; i++) {
if (typeof nav.item(i).style === "undefined") {
continue;
}

if (nav.item(i).getAttribute("data-md-level") && nav.item(i).getAttribute("data-md-component")) {
nav.item(i).style.display = 'block';
nav.item(i).style.overflow = 'visible';
}
}

var nav = document.getElementsByClassName("md-nav__toggle");
for(var i = 0; i < nav.length; i++) {
nav.item(i).checked = true;
}
}
2 changes: 2 additions & 0 deletions docs/assets/jquery-3.5.1.min.js

Large diffs are not rendered by default.

31 changes: 27 additions & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,35 @@ repo_url: https://github.com/drud/ddev
repo_name: GitHub
edit_uri: blob/master/docs/
copyright: DRUD Technology, LLC
theme: readthedocs
theme:
name: 'material'
palette:
primary: 'light-blue'
extra_javascript:
- assets/fix-search.js
- 'assets/fix-search.js'
- 'assets/extra.js'
- 'assets/jquery-3.5.1.min.js'
markdown_extensions:
- markdown.extensions.toc
pages:
- toc:
permalink: true
- admonition
- def_list
- mdx_truly_sane_lists:
nested_indent: 2
truly_sane: true
- nl2br
- pymdownx.details
- pymdownx.superfences
- meta
plugins:
- search
- git-revision-date-localized:
type: timeago
locale: en
google_analytics:
- 'UA-105593079-2'
- 'auto'
nav:
- 'Home': 'index.md'
- 'ddev Basics':
- 'Using the CLI': 'users/cli-usage.md'
Expand Down
31 changes: 31 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This requirements.txt file is exclusively for mkdocs docfile creation, and doesn't have anything
# specifically to do with ddev.
Babel==2.8.0
click==7.1.2
future==0.18.2
gitdb==4.0.5
GitPython==3.1.7
htmlmin==0.1.12
Jinja2==2.11.2
joblib==0.16.0
jsmin==2.2.2
livereload==2.6.2
lunr==0.5.8
Markdown==3.2.2
MarkupSafe==1.1.1
mdx-truly-sane-lists==1.2
mkdocs==1.1.2
mkdocs-git-revision-date-localized-plugin==0.7
mkdocs-material==5.5.7
mkdocs-material-extensions==1.0
mkdocs-minify-plugin==0.3.0
nltk==3.5
Pygments==2.6.1
pymdown-extensions==8.0
pytz==2020.1
PyYAML==5.3.1
regex==2020.7.14
six==1.15.0
smmap==3.0.4
tornado==6.0.4
tqdm==4.48.2

0 comments on commit 6388092

Please sign in to comment.