diff --git a/docs-gen/themes/learn/README.md b/docs-gen/themes/learn/README.md index 3e0801e..4ac5727 100644 --- a/docs-gen/themes/learn/README.md +++ b/docs-gen/themes/learn/README.md @@ -1,3 +1,11 @@ +THIS PROJECT IS DEPRECATED + +The project is not maintained anymore. Thanks everyone for helping me on building this theme at the time where there were no good Hugo theme for documentation. + +[Consider migrating to another theme](https://github.com/matcornic/hugo-theme-learn/issues/557) such as [Relearn](https://github.com/McShelby/hugo-theme-relearn) which seems to be a good maintained alternative. + +---- + # Hugo Learn Theme This repository contains a theme for [Hugo](https://gohugo.io/), based on great [Grav Learn Theme](https://learn.getgrav.org/). diff --git a/docs-gen/themes/learn/exampleSite/content/basics/installation/_index.en.md b/docs-gen/themes/learn/exampleSite/content/basics/installation/_index.en.md index e53d006..31590a0 100644 --- a/docs-gen/themes/learn/exampleSite/content/basics/installation/_index.en.md +++ b/docs-gen/themes/learn/exampleSite/content/basics/installation/_index.en.md @@ -21,6 +21,10 @@ This theme's repository is: https://github.com/matcornic/hugo-theme-learn.git Alternatively, you can [download the theme as .zip](https://github.com/matcornic/hugo-theme-learn/archive/master.zip) file and extract it in the `themes` directory +{{% notice note %}} +Google Analytics are added to `/layout/partials/custom-footer.html` remove the contents of that file to opt-out. +{{% /notice %}} + ## Basic configuration When building the website, you can set a theme by using `--theme` option. However, we suggest you modify the configuration file (`config.toml`) and set the theme as the default. You can also add the `[outputs]` section to enable the search functionality. diff --git a/docs-gen/themes/learn/exampleSite/content/credits.en.md b/docs-gen/themes/learn/exampleSite/content/credits.en.md index 1a489fc..8942b41 100644 --- a/docs-gen/themes/learn/exampleSite/content/credits.en.md +++ b/docs-gen/themes/learn/exampleSite/content/credits.en.md @@ -12,7 +12,7 @@ Thanks to them for making Open Source Software a be And a special thanks to [@vjeantet](https://github.com/vjeantet) for his work on [docdock](https://github.com/vjeantet/hugo-theme-docdock), a fork of hugo-theme-learn. v2.0.0 of this theme is inspired by his work. ## Packages and libraries -* [mermaid](https://knsv.github.io/mermaid) - generation of diagram and flowchart from text in a similar manner as markdown +* [mermaid](https://mermaid-js.github.io/) - generation of diagram and flowchart from text in a similar manner as markdown * [font awesome](http://fontawesome.io/) - the iconic font and CSS framework * [jQuery](https://jquery.com) - The Write Less, Do More, JavaScript Library * [lunr](https://lunrjs.com) - Lunr enables you to provide a great search experience without the need for external, server-side, search services... diff --git a/docs-gen/themes/learn/exampleSite/content/credits.fr.md b/docs-gen/themes/learn/exampleSite/content/credits.fr.md index 536f093..23a1c3d 100644 --- a/docs-gen/themes/learn/exampleSite/content/credits.fr.md +++ b/docs-gen/themes/learn/exampleSite/content/credits.fr.md @@ -12,7 +12,7 @@ Merci à eux de rendre le monde Open Source meilleu Et un grand merci à [@vjeantet](https://github.com/vjeantet) pour son travail sur [docdock](https://github.com/vjeantet/hugo-theme-docdock), un fork de _hugo-theme-learn_. La v2.0.0 du thème est en grande partie inspirée de son travail. ## Packages et librairies -* [mermaid](https://knsv.github.io/mermaid) - géneration de diagrames et graphiques à partir de texte similaire à Markdown +* [mermaid](https://mermaid-js.github.io/) - géneration de diagrames et graphiques à partir de texte similaire à Markdown * [font awesome](http://fontawesome.io/) - Le framework de polices iconiques * [jQuery](https://jquery.com) - La plus connue des librairies Javascript * [lunr](https://lunrjs.com) - Lunr fournit des fonctions de recherche sans service externe diff --git a/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.en.files/small_file.txt b/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.en.files/small_file.txt new file mode 100644 index 0000000..32fa983 --- /dev/null +++ b/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.en.files/small_file.txt @@ -0,0 +1 @@ +This file was downloaded from Hugo Learn Theme. diff --git a/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.en.md b/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.en.md index 8a2429c..bea1350 100644 --- a/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.en.md +++ b/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.en.md @@ -39,23 +39,23 @@ That's all! |:--|:--|:--| | title | "Attachments" | List's title | | style | "" | Choose between "orange", "grey", "blue" and "green" for nice style | -| pattern | ".*" | A regular expressions, used to filter the attachments by file name.

The **pattern** parameter value must be [regular expressions](https://en.wikipedia.org/wiki/Regular_expression). +| pattern | ".*" | A regular expression, used to filter the attachments by file name. The **pattern** parameter value must be a [regular expression](https://en.wikipedia.org/wiki/Regular_expression). | For example: -* To match a file suffix of 'jpg', use **.*jpg** (not *.jpg). -* To match file names ending in 'jpg' or 'png', use **.*(jpg|png)** +* To match a file suffix of '.jpg', use `.*\.jpg$` (not `*.jpg`). +* To match file names ending in '.jpg' or '.png', use `.*\.(jpg|png)$`. ### Examples #### List of attachments ending in pdf or mp4 - {{%/*attachments title="Related files" pattern=".*(pdf|mp4)"/*/%}} + {{%/*attachments title="Related files" pattern=".*\.(pdf|mp4)$"/*/%}} renders as -{{%attachments title="Related files" pattern=".*(pdf|mp4)"/%}} +{{%attachments title="Related files" pattern=".*\.(pdf|mp4)$"/%}} #### Colored styled box diff --git a/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.fr.files/small_file.txt b/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.fr.files/small_file.txt new file mode 100644 index 0000000..10a3446 --- /dev/null +++ b/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.fr.files/small_file.txt @@ -0,0 +1 @@ +Ce fichier a été téléchargé à partir du Hugo Learn Theme. diff --git a/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.fr.md b/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.fr.md index c240939..49fc51b 100644 --- a/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.fr.md +++ b/docs-gen/themes/learn/exampleSite/content/shortcodes/attachments.fr.md @@ -39,23 +39,23 @@ C'est tout ! |:--|:--|:--| | title | "Pièces jointes" | Titre de la liste | | style | "" | Choisir entre "orange", "grey", "blue" et "green" pour un style plus sympa | -| pattern | ".*" | Une expression régulière, utilisée pour filtrer les pièces jointes par leur nom de fichier.

Le paramètre **pattern** doit être une [expression régulière](https://en.wikipedia.org/wiki/Regular_expression). +| pattern | ".*" | Une expression régulière, utilisée pour filtrer les pièces jointes par leur nom de fichier. Le paramètre **pattern** doit être une [expression régulière](https://en.wikipedia.org/wiki/Regular_expression). | Par exemple: -* Pour trouver les fichiers avec le suffixe 'jpg', utilisez **.*jpg** (pas *.jpg). -* Pour trouver les fichiers avec les suffixe 'jpg' ou 'png', utilisez **.*(jpg|png)** +* Pour trouver les fichiers avec le suffixe '.jpg', utilisez `.*\.jpg$` (pas `*.jpg`). +* Pour trouver les fichiers avec les suffixe '.jpg' ou '.png', utilisez `.*\.(jpg|png)$`. ### Exemples #### Lister les pièces jointes de type pdf ou mp4 - {{%/*attachments title="Fichiers associés" pattern=".*(pdf|mp4)"/*/%}} + {{%/*attachments title="Fichiers associés" pattern=".*\.(pdf|mp4)$"/*/%}} s'affiche comme -{{%attachments title="Fichiers associés" pattern=".*(pdf|mp4)"/%}} +{{%attachments title="Fichiers associés" pattern=".*\.(pdf|mp4)$"/%}} #### Modifier le style diff --git a/docs-gen/themes/learn/exampleSite/content/shortcodes/tabs.en.md b/docs-gen/themes/learn/exampleSite/content/shortcodes/tabs.en.md new file mode 100644 index 0000000..d664eea --- /dev/null +++ b/docs-gen/themes/learn/exampleSite/content/shortcodes/tabs.en.md @@ -0,0 +1,119 @@ +--- +title: Tabbed views +description : "Synchronize selection of content in different tabbed views" +--- + +Choose which content to see across the page. Very handy for providing code +snippets for multiple languages or providing configuration in different formats. + +## Code example + + {{}} + {{%/* tab name="python" */%}} + ```python + print("Hello World!") + ``` + {{%/* /tab */%}} + {{%/* tab name="R" */%}} + ```R + > print("Hello World!") + ``` + {{%/* /tab */%}} + {{%/* tab name="Bash" */%}} + ```Bash + echo "Hello World!" + ``` + {{%/* /tab */%}} + {{}} + +Renders as: + +{{< tabs >}} +{{% tab name="python" %}} +```python +print("Hello World!") +``` +{{% /tab %}} +{{% tab name="R" %}} +```R +> print("Hello World!") +``` +{{% /tab %}} +{{% tab name="Bash" %}} +```Bash +echo "Hello World!" +``` +{{% /tab %}} +{{< /tabs >}} + +Tab views with the same tabs that belong to the same group sychronize their selection: + +{{< tabs >}} +{{% tab name="python" %}} +```python +print("Hello World!") +``` +{{% /tab %}} +{{% tab name="R" %}} +```R +> print("Hello World!") +``` +{{% /tab %}} +{{% tab name="Bash" %}} +```Bash +echo "Hello World!" +``` +{{% /tab %}} +{{< /tabs >}} + +## Config example + + {{}} + {{%/* tab name="json" */%}} + ```json + { + "Hello": "World" + } + ``` + {{%/* /tab */%}} + {{%/* tab name="XML" */%}} + ```xml + World + ``` + {{%/* /tab */%}} + {{%/* tab name="properties" */%}} + ```properties + Hello = World + ``` + {{%/* /tab */%}} + {{}} + +Renders as: + +{{< tabs groupId="config" >}} +{{% tab name="json" %}} +```json +{ + "Hello": "World" +} +``` +{{% /tab %}} +{{% tab name="XML" %}} +```xml +World +``` +{{% /tab %}} +{{% tab name="properties" %}} +```properties +Hello = World +``` +{{% /tab %}} +{{< /tabs >}} + +{{% notice warning %}} +When using tab views with different content sets, make sure to use a common `groupId` for equal sets but distinct +`groupId` for different sets. The `groupId` defaults to `'default'`. +**Take this into account across the whole site!** +The tab selection is restored automatically based on the `groupId` and if it cannot find a tab item because it came + from the `'default'` group on a different page then all tabs will be empty at first. +{{% /notice %}} diff --git a/docs-gen/themes/learn/i18n/ar.toml b/docs-gen/themes/learn/i18n/ar.toml index 66e90e1..4cde5a6 100644 --- a/docs-gen/themes/learn/i18n/ar.toml +++ b/docs-gen/themes/learn/i18n/ar.toml @@ -23,4 +23,13 @@ other = "تعديل هذه الصفحة" other = "المزيد" [Expand-title] -other = "...قم بتوسيع" \ No newline at end of file +other = "...قم بتوسيع" + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" diff --git a/docs-gen/themes/learn/i18n/de.toml b/docs-gen/themes/learn/i18n/de.toml index 55ced7a..d754294 100644 --- a/docs-gen/themes/learn/i18n/de.toml +++ b/docs-gen/themes/learn/i18n/de.toml @@ -23,4 +23,13 @@ other = "Bearbeite diese Seite" other = "Mehr" [Expand-title] -other = "Erweitere mich..." \ No newline at end of file +other = "Erweitere mich..." + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" diff --git a/docs-gen/themes/learn/i18n/en.toml b/docs-gen/themes/learn/i18n/en.toml index 118345f..1d2989b 100644 --- a/docs-gen/themes/learn/i18n/en.toml +++ b/docs-gen/themes/learn/i18n/en.toml @@ -23,4 +23,13 @@ other = "Edit this page" other = "More" [Expand-title] -other = "Expand me..." \ No newline at end of file +other = "Expand me..." + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" diff --git a/docs-gen/themes/learn/i18n/es.toml b/docs-gen/themes/learn/i18n/es.toml index 57b7a33..15ce18a 100644 --- a/docs-gen/themes/learn/i18n/es.toml +++ b/docs-gen/themes/learn/i18n/es.toml @@ -24,3 +24,12 @@ other = "Más" [Expand-title] other = "Expandir..." + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" diff --git a/docs-gen/themes/learn/i18n/fr.toml b/docs-gen/themes/learn/i18n/fr.toml index 106f20d..d993714 100644 --- a/docs-gen/themes/learn/i18n/fr.toml +++ b/docs-gen/themes/learn/i18n/fr.toml @@ -23,4 +23,13 @@ other = "Modifier la page" other = "Aller plus loin" [Expand-title] -other = "Déroulez-moi..." \ No newline at end of file +other = "Déroulez-moi..." + +[Byte-symbol] +other = "o" + +[Kilobyte-symbol] +other = "ko" + +[Megabyte-symbol] +other = "Mo" diff --git a/docs-gen/themes/learn/i18n/hi.toml b/docs-gen/themes/learn/i18n/hi.toml index b0f2515..d853475 100644 --- a/docs-gen/themes/learn/i18n/hi.toml +++ b/docs-gen/themes/learn/i18n/hi.toml @@ -24,3 +24,12 @@ other = "अधिक सामग्री दिखाएं" [Expand-title] other = "विस्तार करे..." + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" diff --git a/docs-gen/themes/learn/i18n/id.toml b/docs-gen/themes/learn/i18n/id.toml index e0aa5ae..7803aa8 100644 --- a/docs-gen/themes/learn/i18n/id.toml +++ b/docs-gen/themes/learn/i18n/id.toml @@ -24,3 +24,12 @@ other = "Lainnya" [Expand-title] other = "Bentangkan..." + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" diff --git a/docs-gen/themes/learn/i18n/ja.toml b/docs-gen/themes/learn/i18n/ja.toml index e7510c3..e9d72d3 100644 --- a/docs-gen/themes/learn/i18n/ja.toml +++ b/docs-gen/themes/learn/i18n/ja.toml @@ -24,3 +24,12 @@ other = "更に" [Expand-title] other = "開く..." + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" diff --git a/docs-gen/themes/learn/i18n/nl.toml b/docs-gen/themes/learn/i18n/nl.toml index cca84b4..bdba64f 100644 --- a/docs-gen/themes/learn/i18n/nl.toml +++ b/docs-gen/themes/learn/i18n/nl.toml @@ -24,3 +24,12 @@ other = "Snelkoppelingen" [Expand-title] other = "Lees meer..." + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" diff --git a/docs-gen/themes/learn/i18n/pt.toml b/docs-gen/themes/learn/i18n/pt.toml index b110533..9622677 100644 --- a/docs-gen/themes/learn/i18n/pt.toml +++ b/docs-gen/themes/learn/i18n/pt.toml @@ -24,3 +24,12 @@ other = "Mais" [Expand-title] other = "Expandir..." + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" diff --git a/docs-gen/themes/learn/i18n/ru.toml b/docs-gen/themes/learn/i18n/ru.toml index 36ad079..e82c31a 100644 --- a/docs-gen/themes/learn/i18n/ru.toml +++ b/docs-gen/themes/learn/i18n/ru.toml @@ -23,4 +23,13 @@ other = "Редактировать" other = "Еще" [Expand-title] -other = "Развернуть..." \ No newline at end of file +other = "Развернуть..." + +[Byte-symbol] +other = "Б" + +[Kilobyte-symbol] +other = "КБ" + +[Megabyte-symbol] +other = "МБ" diff --git a/docs-gen/themes/learn/i18n/tr.toml b/docs-gen/themes/learn/i18n/tr.toml index 17249ed..27cfa21 100644 --- a/docs-gen/themes/learn/i18n/tr.toml +++ b/docs-gen/themes/learn/i18n/tr.toml @@ -24,3 +24,12 @@ other = "Dahası Var" [Expand-title] other = "Genişlet..." + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" diff --git a/docs-gen/themes/learn/i18n/vn.toml b/docs-gen/themes/learn/i18n/vn.toml new file mode 100644 index 0000000..fbd7ee7 --- /dev/null +++ b/docs-gen/themes/learn/i18n/vn.toml @@ -0,0 +1,50 @@ +[Search-placeholder] +other = "Tìm kiếm..." + +[Clear-History] +other = "Xóa lịch sử.." + +[Attachments-label] +other = "Tập tin đính kèm" + +[title-404] +other = "Lỗi" + +[message-404] +other = "Tiếc quá! Có vẻ như trang này không tồn tại ¯\\_(ツ)_/¯." + +[Go-to-homepage] +other = "Đi đến trang chủ" + +[Edit-this-page] +other = "Chỉnh sửa trang này" + +[Shortcuts-Title] +other = "Nội dung khác" + +[Expand-title] +other = "Mở rộng..." + +[BinaryPrefix-kilobyte] +other = "kb" + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" + +[note] +other = "Ghi chú" + +[info] +other = "Thông tin" + +[tip] +other = "Mẹo vặt" + +[warning] +other = "Cảnh báo" diff --git a/docs-gen/themes/learn/i18n/zh-cn.toml b/docs-gen/themes/learn/i18n/zh-cn.toml index e887d3e..4331cb3 100644 --- a/docs-gen/themes/learn/i18n/zh-cn.toml +++ b/docs-gen/themes/learn/i18n/zh-cn.toml @@ -24,3 +24,12 @@ other = "更多" [Expand-title] other = "展开" + +[Byte-symbol] +other = "B" + +[Kilobyte-symbol] +other = "KB" + +[Megabyte-symbol] +other = "MB" diff --git a/docs-gen/themes/learn/layouts/partials/footer.html b/docs-gen/themes/learn/layouts/partials/footer.html index 091f809..3c0e95f 100644 --- a/docs-gen/themes/learn/layouts/partials/footer.html +++ b/docs-gen/themes/learn/layouts/partials/footer.html @@ -67,9 +67,9 @@ {{ if (or (and (ne .Params.disableMermaid nil) (not .Params.disableMermaid)) (not .Site.Params.disableMermaid)) }} - {{ if isset .Params "customMermaidURL" }} + {{ if isset .Params "custommermaidurl" }} - {{ else if isset .Site.Params "customMermaidURL" }} + {{ else if isset .Site.Params "custommermaidurl" }} {{ else }} diff --git a/docs-gen/themes/learn/layouts/partials/header.html b/docs-gen/themes/learn/layouts/partials/header.html index 2f97f76..8ee0334 100644 --- a/docs-gen/themes/learn/layouts/partials/header.html +++ b/docs-gen/themes/learn/layouts/partials/header.html @@ -17,6 +17,7 @@ + {{with .Site.Params.themeVariant}} diff --git a/docs-gen/themes/learn/layouts/partials/logo.html b/docs-gen/themes/learn/layouts/partials/logo.html index b2197c4..7a91bd6 100644 --- a/docs-gen/themes/learn/layouts/partials/logo.html +++ b/docs-gen/themes/learn/layouts/partials/logo.html @@ -1,19 +1,84 @@ - diff --git a/docs-gen/themes/learn/layouts/partials/menu.html b/docs-gen/themes/learn/layouts/partials/menu.html index 1c27c71..6590454 100644 --- a/docs-gen/themes/learn/layouts/partials/menu.html +++ b/docs-gen/themes/learn/layouts/partials/menu.html @@ -119,7 +119,7 @@

{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}

{{ end }} - {{ $numberOfPages := (add (len .Pages) (len .Sections)) }} + {{ $numberOfPages := (add (len ( where .Pages "Params.hidden" "ne" true )) (len ( where .Sections "Params.hidden" "ne" true ))) }} {{ if ne $numberOfPages 0 }} -{{.Inner|safeHTML}} - {{ define "childs" }} {{ range .menu }} {{ if and .Params.hidden (not $.showhidden) }} diff --git a/docs-gen/themes/learn/layouts/shortcodes/tab.html b/docs-gen/themes/learn/layouts/shortcodes/tab.html new file mode 100644 index 0000000..d258e00 --- /dev/null +++ b/docs-gen/themes/learn/layouts/shortcodes/tab.html @@ -0,0 +1,12 @@ +{{ if .Parent }} + {{ $name := trim (.Get "name") " " }} + {{ if not (.Parent.Scratch.Get "tabs") }} + {{ .Parent.Scratch.Set "tabs" slice }} + {{ end }} + {{ with .Inner }} + {{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" . ) }} + {{ end }} +{{ else }} + {{- errorf "[%s] %q: tab shortcode missing its parent" site.Language.Lang .Page.Path -}} +{{ end}} + diff --git a/docs-gen/themes/learn/layouts/shortcodes/tabs.html b/docs-gen/themes/learn/layouts/shortcodes/tabs.html new file mode 100644 index 0000000..417a808 --- /dev/null +++ b/docs-gen/themes/learn/layouts/shortcodes/tabs.html @@ -0,0 +1,21 @@ +{{ with .Inner }}{{/* don't do anything, just call it */}}{{ end }} +{{ $groupId := default "default" (.Get "groupId") }} +
+
+ {{ range $idx, $tab := .Scratch.Get "tabs" }} + + {{ end }} +
+
+ {{ range $idx, $tab := .Scratch.Get "tabs" }} +
+ {{ .content }} +
+ {{ end }} +
+
diff --git a/docs-gen/themes/learn/static/css/hugo-theme.css b/docs-gen/themes/learn/static/css/hugo-theme.css index 741cab1..ae1fe79 100644 --- a/docs-gen/themes/learn/static/css/hugo-theme.css +++ b/docs-gen/themes/learn/static/css/hugo-theme.css @@ -6,33 +6,20 @@ .progress ul { list-style: none; margin: 0; - padding: 0 5px; + padding: 0 15px; } #TableOfContents { font-size: 13px !important; max-height: 85vh; overflow: auto; - padding: 15px !important; + padding: 15px 5px !important; } - -#TableOfContents > ul > li > ul > li > ul li { - margin-right: 8px; -} - -#TableOfContents > ul > li > a { - font-weight: bold; padding: 0 18px; margin: 0 2px; -} - -#TableOfContents > ul > li > ul > li > a { +#TableOfContents > ul > li > a { font-weight: bold; } -#TableOfContents > ul > li > ul > li > ul > li > ul > li > ul > li { - display: none; -} - body { font-size: 16px !important; color: #323232 !important; diff --git a/docs-gen/themes/learn/static/css/tabs.css b/docs-gen/themes/learn/static/css/tabs.css new file mode 100644 index 0000000..2ad2728 --- /dev/null +++ b/docs-gen/themes/learn/static/css/tabs.css @@ -0,0 +1,43 @@ +#body .tab-nav-button { + border-width: 1px 1px 1px 1px !important; + border-color: #ccc !important; + border-radius: 4px 4px 0 0 !important; + background-color: #ddd !important; + float: left; + display: block; + position: relative; + margin-left: 4px; + bottom: -1px; +} +#body .tab-nav-button:first-child { + margin-left: 0px; +} +#body .tab-nav-button.active { + background-color: #fff !important; + border-bottom-color: #fff !important; +} + +#body .tab-panel { + margin-top: 32px; + margin-bottom: 32px; +} +#body .tab-content { + display: block; + clear: both; + padding: 8px; + border-width: 1px; + border-style: solid; + border-color: #ccc; +} +#body .tab-content .tab-item{ + display: none; +} + +#body .tab-content .tab-item.active{ + display: block; +} + +#body .tab-item pre{ + margin-bottom: 0; + margin-top: 0; +} diff --git a/docs-gen/themes/learn/static/js/learn.js b/docs-gen/themes/learn/static/js/learn.js index b0d199d..85e09d5 100644 --- a/docs-gen/themes/learn/static/js/learn.js +++ b/docs-gen/themes/learn/static/js/learn.js @@ -47,6 +47,57 @@ function fallbackMessage(action) { return actionMsg; } +function switchTab(tabGroup, tabId) { + allTabItems = jQuery("[data-tab-group='"+tabGroup+"']"); + targetTabItems = jQuery("[data-tab-group='"+tabGroup+"'][data-tab-item='"+tabId+"']"); + + // if event is undefined then switchTab was called from restoreTabSelection + // so it's not a button event and we don't need to safe the selction or + // prevent page jump + var isButtonEvent = event != undefined; + + if(isButtonEvent){ + // save button position relative to viewport + var yposButton = event.target.getBoundingClientRect().top; + } + + allTabItems.removeClass("active"); + targetTabItems.addClass("active"); + + if(isButtonEvent){ + // reset screen to the same position relative to clicked button to prevent page jump + var yposButtonDiff = event.target.getBoundingClientRect().top - yposButton; + window.scrollTo(window.scrollX, window.scrollY+yposButtonDiff); + + // Store the selection to make it persistent + if(window.localStorage){ + var selectionsJSON = window.localStorage.getItem("tabSelections"); + if(selectionsJSON){ + var tabSelections = JSON.parse(selectionsJSON); + }else{ + var tabSelections = {}; + } + tabSelections[tabGroup] = tabId; + window.localStorage.setItem("tabSelections", JSON.stringify(tabSelections)); + } + } +} + +function restoreTabSelections() { + if(window.localStorage){ + var selectionsJSON = window.localStorage.getItem("tabSelections"); + if(selectionsJSON){ + var tabSelections = JSON.parse(selectionsJSON); + }else{ + var tabSelections = {}; + } + Object.keys(tabSelections).forEach(function(tabGroup) { + var tabItem = tabSelections[tabGroup]; + switchTab(tabGroup, tabItem); + }); + } +} + // for the window resize $(window).resize(function() { setMenuHeight(); @@ -83,6 +134,8 @@ $(window).resize(function() { jQuery(document).ready(function() { + restoreTabSelections(); + jQuery('#sidebar .category-icon').on('click', function() { $( this ).toggleClass("fa-angle-down fa-angle-right") ; $( this ).parent().parent().children('ul').toggle() ; @@ -229,7 +282,7 @@ jQuery(document).ready(function() { e.stopPropagation(); } }); - + jQuery(document).keydown(function(e) { // prev links - left arrow key if(e.which == '37') { @@ -264,7 +317,7 @@ jQuery(document).ready(function() { }); } - /** + /** * Fix anchor scrolling that hides behind top nav bar * Courtesy of https://stackoverflow.com/a/13067009/28106 * @@ -346,7 +399,7 @@ jQuery(document).ready(function() { $(document).ready($.proxy(anchorScrolls, 'init')); })(window.document, window.history, window.location); - + }); jQuery(window).on('load', function() { diff --git a/docs-gen/themes/learn/static/js/search.js b/docs-gen/themes/learn/static/js/search.js index d7b893e..2bf49c4 100644 --- a/docs-gen/themes/learn/static/js/search.js +++ b/docs-gen/themes/learn/static/js/search.js @@ -75,15 +75,18 @@ $( document ).ready(function() { "(?:\\s?(?:[\\w]+)\\s?){0,"+numContextWords+"}" + term+"(?:\\s?(?:[\\w]+)\\s?){0,"+numContextWords+"}"); item.context = text; - return '
' + - '» ' + item.title + - '
' + - (item.context || '') +'
' + - '
'; + var divcontext = document.createElement("div"); + divcontext.className = "context"; + divcontext.innerText = (item.context || ''); + var divsuggestion = document.createElement("div"); + divsuggestion.className = "autocomplete-suggestion"; + divsuggestion.setAttribute("data-term", term); + divsuggestion.setAttribute("data-title", item.title); + divsuggestion.setAttribute("data-uri", item.uri); + divsuggestion.setAttribute("data-context", item.context); + divsuggestion.innerText = '» ' + item.title; + divsuggestion.appendChild(divcontext); + return divsuggestion.outerHTML; }, /* onSelect callback fires when a search suggestion is chosen */ onSelect: function(e, term, item) { diff --git a/docs/404.html b/docs/404.html index e2c07f6..0469b70 100644 --- a/docs/404.html +++ b/docs/404.html @@ -9,15 +9,15 @@ 404 Page not found - - - - - - - + + + + + + + - +