From 4eb6954c7d7b5327c59dfbd86cebfc3ea10c1033 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 20 Mar 2018 23:41:24 +0100 Subject: various docs improvements - add clickable anchors for headers - add "outdated" warning for archived docs - add "edit on github" button - beautify template --- docs/src/content/_index.md | 1 + docs/src/layouts/_default/single.html | 14 +++--- docs/src/layouts/index.html | 10 ----- docs/src/layouts/partials/add-anchors.html | 1 + docs/src/layouts/partials/edit-on-github.html | 9 ++++ docs/src/layouts/partials/outdated.html | 9 ++++ docs/src/layouts/partials/sidebar.html | 38 ++++++++-------- docs/src/static/logo-docs.png | Bin 9746 -> 9166 bytes docs/src/themes/mitmproxydocs/static/css/style.css | 49 +++++++++++++-------- 9 files changed, 77 insertions(+), 54 deletions(-) delete mode 100644 docs/src/layouts/index.html create mode 100644 docs/src/layouts/partials/add-anchors.html create mode 100644 docs/src/layouts/partials/edit-on-github.html create mode 100644 docs/src/layouts/partials/outdated.html (limited to 'docs/src') diff --git a/docs/src/content/_index.md b/docs/src/content/_index.md index a977e2db..44d41611 100644 --- a/docs/src/content/_index.md +++ b/docs/src/content/_index.md @@ -1,5 +1,6 @@ --- title: "Introduction" +layout: single menu: overview: weight: 1 diff --git a/docs/src/layouts/_default/single.html b/docs/src/layouts/_default/single.html index 4a8baf53..801b6341 100644 --- a/docs/src/layouts/_default/single.html +++ b/docs/src/layouts/_default/single.html @@ -1,10 +1,12 @@ -{{ partial "header.html" . }} -
-
- {{ partial "sidebar.html" . }} +{{ partial "header" . }} +
+ -
- {{.Content}} +
+ {{ partial "outdated" . }} + {{ partial "edit-on-github" . }} + {{ partial "add-anchors" .Content}}
{{ partial "footer.html" . }} diff --git a/docs/src/layouts/index.html b/docs/src/layouts/index.html deleted file mode 100644 index 4a8baf53..00000000 --- a/docs/src/layouts/index.html +++ /dev/null @@ -1,10 +0,0 @@ -{{ partial "header.html" . }} -
-
- {{ partial "sidebar.html" . }} -
-
- {{.Content}} -
-
-{{ partial "footer.html" . }} diff --git a/docs/src/layouts/partials/add-anchors.html b/docs/src/layouts/partials/add-anchors.html new file mode 100644 index 00000000..f7050f7f --- /dev/null +++ b/docs/src/layouts/partials/add-anchors.html @@ -0,0 +1 @@ +{{ . | replaceRE "()(.+?)" "${1}#  ${3}" | safeHTML }} diff --git a/docs/src/layouts/partials/edit-on-github.html b/docs/src/layouts/partials/edit-on-github.html new file mode 100644 index 00000000..d2c3098c --- /dev/null +++ b/docs/src/layouts/partials/edit-on-github.html @@ -0,0 +1,9 @@ +{{ if and .IsPage (not (getenv "DOCS_ARCHIVE")) }} + + Edit on GitHub + +{{ end }} + diff --git a/docs/src/layouts/partials/outdated.html b/docs/src/layouts/partials/outdated.html new file mode 100644 index 00000000..5b3dd6ed --- /dev/null +++ b/docs/src/layouts/partials/outdated.html @@ -0,0 +1,9 @@ +{{- if (getenv "DOCS_ARCHIVE") -}} +
+
+ You are not viewing the most up to date version of the documentation. + Click here + to view the latest version. +
+
+{{- end -}} diff --git a/docs/src/layouts/partials/sidebar.html b/docs/src/layouts/partials/sidebar.html index ef853fc6..5ea41c12 100644 --- a/docs/src/layouts/partials/sidebar.html +++ b/docs/src/layouts/partials/sidebar.html @@ -1,24 +1,22 @@ - \ No newline at end of file + + {{ partial "sidemenu" (dict "ctx" . "menuname" "howto") }} + + + {{ partial "sidemenu" (dict "ctx" . "menuname" "tutes") }} + diff --git a/docs/src/static/logo-docs.png b/docs/src/static/logo-docs.png index b37dbd85..a46016dd 100644 Binary files a/docs/src/static/logo-docs.png and b/docs/src/static/logo-docs.png differ diff --git a/docs/src/themes/mitmproxydocs/static/css/style.css b/docs/src/themes/mitmproxydocs/static/css/style.css index ccd0e3ff..db5a36cf 100644 --- a/docs/src/themes/mitmproxydocs/static/css/style.css +++ b/docs/src/themes/mitmproxydocs/static/css/style.css @@ -6717,9 +6717,17 @@ label.panel-block { background-color: whitesmoke; padding: 3rem 1.5rem 6rem; } -.sidebody { - overflow-x: hidden; - overflow-y: scroll; } +#sidebar { + background-color: #eee; + border-right: 1px solid #c1c1c1; + box-shadow: 0 0 20px rgba(50, 50, 50, 0.2) inset; + padding: 1.75rem; } + #sidebar .brand { + padding: 1rem 0; + text-align: center; } + +#main { + padding: 3rem; } .example { margin-bottom: 1em; } @@ -6730,21 +6738,6 @@ label.panel-block { width: 100%; text-align: right; } -.sidebar { - background-color: #F1F1F1; } - .sidebar .version { - padding: 1em; } - .sidebar .brand { - background-color: #303030; - color: #c0c0c0; - padding: 1em; - top: 0; } - .sidebar .menu { - padding: 1em; } - -.mainbody { - padding: 3em; } - code { color: #1a9f1a; font-size: 0.875em; @@ -6754,5 +6747,25 @@ code { padding-top: 1em; border-top: 1px solid #c0c0c0; } +h1 .anchor, h2 .anchor, h3 .anchor, h4 .anchor, h5 .anchor, h6 .anchor { + display: inline-block; + width: 0; + margin-left: -1.5rem; + margin-right: 1.5rem; + transition: all 100ms ease-in-out; + opacity: 0; } + +h1:hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, h5:hover .anchor, h6:hover .anchor { + opacity: 1; } + +h1:target, h2:target, h3:target, h4:target, h5:target, h6:target { + color: #C93312; } + h1:target .anchor, h2:target .anchor, h3:target .anchor, h4:target .anchor, h5:target .anchor, h6:target .anchor { + opacity: 1; + color: #C93312; } + +.footnotes p { + display: inline; } + figure.has-border img { box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.25); } -- cgit v1.2.3