From 70b34f01f7355fc0850333ac08668a70c3faae2d Mon Sep 17 00:00:00 2001 From: Peter Mosses <18308236+pdmosses@users.noreply.github.com> Date: Mon, 4 Jul 2022 21:15:10 +0200 Subject: [PATCH] Combination (#578) This PR combines (and resolves conflicts between) #448, #463, #466, #494, #495, #496, #498, and #572. The main aim is to facilitate use of several of the implemented features _together_, when using the fork as a remote theme. It should also simplify merging the included PRs into a future release. The branch [combination-rec-nav](https://github.com/pdmosses/just-the-docs/tree/combination-rec-nav) adds [multi-level navigation](https://github.com/pmarsceill/just-the-docs/pull/462) and (NEW:) [sibling links](https://github.com/pmarsceill/just-the-docs/pull/394) to the branch used for this PR. It includes updated [documentation for the navigation structure](https://pdmosses.github.io/just-the-docs/docs/navigation-structure/), and reorganised and extended [navigation tests](https://pdmosses.github.io/just-the-docs/tests/navigation/). The documentation and the tests can be browsed at the (temporary) [website published from the combination-rec-nav branch](https://pdmosses.github.io/just-the-docs/). _Caveat:_ The changes to v0.3.3 in this PR and #462 have not yet been reviewed or approved, and may need updating before merging into a release of the theme. If you use a branch from a PR as a remote theme, there is a risk of such updates affecting your website. Moreover, these branches are likely to be deleted after they have been merged. To avoid such problems, you could copy the branch that you want to use to your own fork of the theme. Co-authored-by: Matt Wang --- 404.html | 2 +- _config.yml | 10 +- _includes/css/callouts.scss.liquid | 93 ++++++++ _includes/css/just-the-docs.scss.liquid | 3 +- _includes/nav.html | 34 ++- _layouts/default.html | 52 +++-- _sass/code.scss | 207 ----------------- _sass/color_schemes/dark.scss | 17 +- _sass/color_schemes/light.scss | 208 ++++++++++++++++++ _sass/content.scss | 2 +- _sass/custom/custom.scss | 4 + _sass/navigation.scss | 22 +- _sass/typography.scss | 2 - _sass/vendor/OneDarkJekyll/LICENSE | 21 ++ _sass/vendor/OneDarkJekyll/README.md | 25 +++ _sass/vendor/OneDarkJekyll/colors.less | 30 +++ .../OneDarkJekyll/syntax-firewatch-green.scss | 65 ++++++ .../OneDarkJekyll/syntax-firewatch.scss | 65 ++++++ .../OneDarkJekyll/syntax-one-dark-vivid.scss | 64 ++++++ .../vendor/OneDarkJekyll/syntax-one-dark.scss | 64 ++++++ .../OneDarkJekyll/syntax-variables.less | 56 +++++ _sass/vendor/OneDarkJekyll/syntax.less | 93 ++++++++ assets/js/just-the-docs.js | 17 +- assets/js/zzzz-search-data.json | 6 +- docs/configuration.md | 84 ++++++- docs/index-test.md | 51 +++++ docs/navigation-structure.md | 13 +- docs/tests/index.md | 22 -- docs/tests/navigation/disambiguation/a.md | 14 -- docs/tests/navigation/disambiguation/b.md | 14 -- docs/tests/navigation/disambiguation/ca.md | 16 -- docs/tests/navigation/disambiguation/cb.md | 16 -- docs/tests/navigation/disambiguation/dca.md | 16 -- docs/tests/navigation/disambiguation/dcb.md | 16 -- docs/tests/navigation/disambiguation/index.md | 14 -- docs/tests/navigation/exclusion/0.md | 13 -- docs/tests/navigation/exclusion/00.md | 15 -- docs/tests/navigation/exclusion/000.md | 17 -- docs/tests/navigation/exclusion/001.md | 17 -- docs/tests/navigation/exclusion/01.md | 15 -- docs/tests/navigation/exclusion/010.md | 17 -- docs/tests/navigation/exclusion/011.md | 17 -- docs/tests/navigation/exclusion/1.md | 13 -- docs/tests/navigation/exclusion/10.md | 15 -- docs/tests/navigation/exclusion/100.md | 17 -- docs/tests/navigation/exclusion/101.md | 17 -- docs/tests/navigation/exclusion/11.md | 15 -- docs/tests/navigation/exclusion/110.md | 17 -- docs/tests/navigation/exclusion/111.md | 17 -- docs/tests/navigation/exclusion/excluded.md | 11 - docs/tests/navigation/exclusion/index.md | 36 --- docs/tests/navigation/exclusion/untitled.md | 6 - docs/tests/navigation/index.md | 8 - docs/tests/navigation/order/default/10.md | 14 -- docs/tests/navigation/order/default/2.md | 14 -- docs/tests/navigation/order/default/a.md | 14 -- .../navigation/order/default/aa-lower.md | 14 -- docs/tests/navigation/order/default/aa.md | 14 -- docs/tests/navigation/order/default/index.md | 15 -- docs/tests/navigation/order/floats/-1.1.md | 16 -- docs/tests/navigation/order/floats/0.0.md | 16 -- docs/tests/navigation/order/floats/10.0.md | 16 -- docs/tests/navigation/order/floats/2.2222.md | 16 -- docs/tests/navigation/order/floats/index.md | 13 -- docs/tests/navigation/order/index.md | 16 -- docs/tests/navigation/order/integers/-1.md | 16 -- docs/tests/navigation/order/integers/0.md | 16 -- docs/tests/navigation/order/integers/10.md | 16 -- docs/tests/navigation/order/integers/2.md | 16 -- docs/tests/navigation/order/integers/index.md | 13 -- docs/tests/navigation/order/mixture/-1.1.md | 16 -- docs/tests/navigation/order/mixture/-1.md | 16 -- docs/tests/navigation/order/mixture/0.0.md | 16 -- docs/tests/navigation/order/mixture/0.md | 16 -- docs/tests/navigation/order/mixture/10.0.md | 16 -- docs/tests/navigation/order/mixture/10.md | 14 -- docs/tests/navigation/order/mixture/2.2222.md | 16 -- docs/tests/navigation/order/mixture/2.md | 14 -- docs/tests/navigation/order/mixture/a.md | 14 -- .../navigation/order/mixture/aa-lower.md | 16 -- docs/tests/navigation/order/mixture/aa.md | 16 -- docs/tests/navigation/order/mixture/index.md | 11 - docs/tests/navigation/order/order.md | 7 - docs/tests/navigation/order/strings/10.md | 16 -- docs/tests/navigation/order/strings/2.md | 16 -- docs/tests/navigation/order/strings/a.md | 16 -- .../navigation/order/strings/aa-lower.md | 16 -- docs/tests/navigation/order/strings/aa.md | 16 -- docs/tests/navigation/order/strings/index.md | 13 -- docs/tests/styling/dl.md | 83 ------- docs/tests/styling/index.md | 8 - docs/tests/styling/ol.md | 65 ------ docs/tests/styling/ul.md | 65 ------ docs/ui-components/callouts.md | 104 +++++++++ just-the-docs.gemspec | 4 +- lib/tasks/search.rake | 2 +- 96 files changed, 1137 insertions(+), 1451 deletions(-) create mode 100644 _includes/css/callouts.scss.liquid create mode 100644 _sass/vendor/OneDarkJekyll/LICENSE create mode 100644 _sass/vendor/OneDarkJekyll/README.md create mode 100644 _sass/vendor/OneDarkJekyll/colors.less create mode 100644 _sass/vendor/OneDarkJekyll/syntax-firewatch-green.scss create mode 100644 _sass/vendor/OneDarkJekyll/syntax-firewatch.scss create mode 100644 _sass/vendor/OneDarkJekyll/syntax-one-dark-vivid.scss create mode 100644 _sass/vendor/OneDarkJekyll/syntax-one-dark.scss create mode 100644 _sass/vendor/OneDarkJekyll/syntax-variables.less create mode 100644 _sass/vendor/OneDarkJekyll/syntax.less delete mode 100644 docs/tests/index.md delete mode 100644 docs/tests/navigation/disambiguation/a.md delete mode 100644 docs/tests/navigation/disambiguation/b.md delete mode 100644 docs/tests/navigation/disambiguation/ca.md delete mode 100644 docs/tests/navigation/disambiguation/cb.md delete mode 100644 docs/tests/navigation/disambiguation/dca.md delete mode 100644 docs/tests/navigation/disambiguation/dcb.md delete mode 100644 docs/tests/navigation/disambiguation/index.md delete mode 100644 docs/tests/navigation/exclusion/0.md delete mode 100644 docs/tests/navigation/exclusion/00.md delete mode 100644 docs/tests/navigation/exclusion/000.md delete mode 100644 docs/tests/navigation/exclusion/001.md delete mode 100644 docs/tests/navigation/exclusion/01.md delete mode 100644 docs/tests/navigation/exclusion/010.md delete mode 100644 docs/tests/navigation/exclusion/011.md delete mode 100644 docs/tests/navigation/exclusion/1.md delete mode 100644 docs/tests/navigation/exclusion/10.md delete mode 100644 docs/tests/navigation/exclusion/100.md delete mode 100644 docs/tests/navigation/exclusion/101.md delete mode 100644 docs/tests/navigation/exclusion/11.md delete mode 100644 docs/tests/navigation/exclusion/110.md delete mode 100644 docs/tests/navigation/exclusion/111.md delete mode 100644 docs/tests/navigation/exclusion/excluded.md delete mode 100644 docs/tests/navigation/exclusion/index.md delete mode 100644 docs/tests/navigation/exclusion/untitled.md delete mode 100644 docs/tests/navigation/index.md delete mode 100644 docs/tests/navigation/order/default/10.md delete mode 100644 docs/tests/navigation/order/default/2.md delete mode 100644 docs/tests/navigation/order/default/a.md delete mode 100644 docs/tests/navigation/order/default/aa-lower.md delete mode 100644 docs/tests/navigation/order/default/aa.md delete mode 100644 docs/tests/navigation/order/default/index.md delete mode 100644 docs/tests/navigation/order/floats/-1.1.md delete mode 100644 docs/tests/navigation/order/floats/0.0.md delete mode 100644 docs/tests/navigation/order/floats/10.0.md delete mode 100644 docs/tests/navigation/order/floats/2.2222.md delete mode 100644 docs/tests/navigation/order/floats/index.md delete mode 100644 docs/tests/navigation/order/index.md delete mode 100644 docs/tests/navigation/order/integers/-1.md delete mode 100644 docs/tests/navigation/order/integers/0.md delete mode 100644 docs/tests/navigation/order/integers/10.md delete mode 100644 docs/tests/navigation/order/integers/2.md delete mode 100644 docs/tests/navigation/order/integers/index.md delete mode 100644 docs/tests/navigation/order/mixture/-1.1.md delete mode 100644 docs/tests/navigation/order/mixture/-1.md delete mode 100644 docs/tests/navigation/order/mixture/0.0.md delete mode 100644 docs/tests/navigation/order/mixture/0.md delete mode 100644 docs/tests/navigation/order/mixture/10.0.md delete mode 100644 docs/tests/navigation/order/mixture/10.md delete mode 100644 docs/tests/navigation/order/mixture/2.2222.md delete mode 100644 docs/tests/navigation/order/mixture/2.md delete mode 100644 docs/tests/navigation/order/mixture/a.md delete mode 100644 docs/tests/navigation/order/mixture/aa-lower.md delete mode 100644 docs/tests/navigation/order/mixture/aa.md delete mode 100644 docs/tests/navigation/order/mixture/index.md delete mode 100644 docs/tests/navigation/order/order.md delete mode 100644 docs/tests/navigation/order/strings/10.md delete mode 100644 docs/tests/navigation/order/strings/2.md delete mode 100644 docs/tests/navigation/order/strings/a.md delete mode 100644 docs/tests/navigation/order/strings/aa-lower.md delete mode 100644 docs/tests/navigation/order/strings/aa.md delete mode 100644 docs/tests/navigation/order/strings/index.md delete mode 100644 docs/tests/styling/dl.md delete mode 100644 docs/tests/styling/index.md delete mode 100644 docs/tests/styling/ol.md delete mode 100644 docs/tests/styling/ul.md create mode 100644 docs/ui-components/callouts.md diff --git a/404.html b/404.html index 5fde96683254..a2d250a53cf9 100644 --- a/404.html +++ b/404.html @@ -8,4 +8,4 @@

Page not found

-

The page you requested could not be found. Try using the navigation {% if site.search_enabled != false %}or search {% endif %}to find what you're looking for or go to this site's home page.

+

The page you requested could not be found. Try using the navigation {% if site.search_enabled != false %}or search {% endif %}to find what you're looking for or go to this site's home page.

diff --git a/_config.yml b/_config.yml index dbe742f2f739..e5908211459f 100644 --- a/_config.yml +++ b/_config.yml @@ -19,15 +19,7 @@ baseurl: "/just-the-docs" # the subpath of your site, e.g. /blog url: "https://just-the-docs.github.io" # the base hostname & protocol for your site, e.g. http://example.com permalink: pretty -exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "package.json", "package-lock.json", "script/", "LICENSE.txt", "lib/", "bin/", "README.md", "Rakefile" -, "docs/tests/" -] - -# Regression tests -# By default, the pages in /docs/tests are excluded when the ste is built. -# To include them, comment-out the relevant line above. -# Uncommenting the following line doesn't work - see https://github.com/jekyll/jekyll/issues/4791 -# include: ["docs/tests/"] +exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "package.json", "package-lock.json", "script/", "LICENSE.txt", "lib/", "bin/", "README.md", "Rakefile"] # Set a path/url to a logo that will be displayed instead of the title #logo: "/assets/images/just-the-docs.png" diff --git a/_includes/css/callouts.scss.liquid b/_includes/css/callouts.scss.liquid new file mode 100644 index 000000000000..e99600e51b3d --- /dev/null +++ b/_includes/css/callouts.scss.liquid @@ -0,0 +1,93 @@ +{%- comment -%} + {% include css/callouts.scss.liquid color_scheme = string %} + produces SCSS for all the callouts in site.callouts. For the "dark" + color scheme, the levels of the text and background colors are reversed. +{%- endcomment -%} + +{%- assign callout_background_hue = "000" -%} +{%- assign callout_color_hue = "300" -%} +{%- if site.callouts_level == "loud" or include.color_scheme == "dark" and site.callouts_level != "quiet" -%} + {%- assign callout_background_hue = "300" -%} + {%- assign callout_color_hue = "000" -%} +{%- endif -%} + +div.opaque { + background-color: $body-background-color; +} + +{%- for callout in site.callouts %} + +{%- assign callout_opacity = callout[1].opacity | default: site.callouts_opacity | default: 0.2 -%} + +p.{{ callout[0] }}, blockquote.{{ callout[0] }} { + background: rgba(${{ callout[1].color }}-{{ callout_background_hue }}, {{ callout_opacity }}); + border-left: $border-radius solid ${{ callout[1].color }}-{{ callout_color_hue }}; + border-radius: $border-radius; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08); + padding: .8rem; + {% if callout[1].title %} + &::before { + color: ${{ callout[1].color }}-{{ callout_color_hue }}; + content: "{{ callout[1].title }}"; + display: block; + font-weight: bold; + text-transform: uppercase; + font-size: .75em; + padding-bottom: .125rem; + } + {% endif %} + > .{{ callout[0] }}-title { + color: ${{ callout[1].color }}-{{ callout_color_hue }}; + display: block; + font-weight: bold; + text-transform: uppercase; + font-size: .75em; + padding-bottom: .125rem; + } +} + +p.{{ callout[0] }}-title, blockquote.{{ callout[0] }}-title { + background: rgba(${{ callout[1].color }}-{{ callout_background_hue }}, {{ callout_opacity }}); + border-left: $border-radius solid ${{ callout[1].color }}-{{ callout_color_hue }}; + border-radius: $border-radius; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08); + padding: .8rem; + > p:first-child { + margin-top: 0; + margin-bottom: 0; + color: ${{ callout[1].color }}-{{ callout_color_hue }}; + display: block; + font-weight: bold; + text-transform: uppercase; + font-size: .75em; + padding-bottom: .125rem; + } +} + +blockquote.{{ callout[0] }} { + margin-left: 0; + margin-right: 0; + + > p:first-child { + margin-top: 0; + } + + > p:last-child { + margin-bottom: 0; + } +} + +blockquote.{{ callout[0] }}-title { + margin-left: 0; + margin-right: 0; + + > p:nth-child(2) { + margin-top: 0; + } + + > p:last-child { + margin-bottom: 0; + } +} + +{% endfor -%} diff --git a/_includes/css/just-the-docs.scss.liquid b/_includes/css/just-the-docs.scss.liquid index 495cd6dd902a..29d569026244 100644 --- a/_includes/css/just-the-docs.scss.liquid +++ b/_includes/css/just-the-docs.scss.liquid @@ -1,7 +1,8 @@ {% if site.logo %} -$logo: "{{ site.logo | absolute_url }}"; +$logo: "{{ site.logo | relative_url }}"; {% endif %} @import "./support/support"; @import "./color_schemes/{{ include.color_scheme }}"; @import "./modules"; {% include css/custom.scss.liquid %} +{% include css/callouts.scss.liquid color_scheme = include.color_scheme %} diff --git a/_includes/nav.html b/_includes/nav.html index 325a68c88404..accfd891688e 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -60,11 +60,11 @@ {%- for node in pages_list -%} {%- if node.parent == nil -%} {%- unless node.nav_exclude -%} -