From a64978b55d077cc654edb2c7c3ddfe2003b0f042 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Wed, 9 Feb 2022 12:16:42 -0500 Subject: [PATCH] Upgrade material-mkdocs to major version 8 (#4705) * update from mkdocs 7.3.1 to 8.1.10 Signed-off-by: Carlos Santana * add GIT_SLUG to make easier to test with user forks Signed-off-by: Carlos Santana * fix warning banner Signed-off-by: Carlos Santana --- blog/mkdocs.yml | 3 ++- docs/stylesheets/extra.css | 10 +++++----- hack/build.sh | 5 +++-- mkdocs.yml | 3 ++- requirements.txt | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/blog/mkdocs.yml b/blog/mkdocs.yml index f5aa97e12..e961475bf 100644 --- a/blog/mkdocs.yml +++ b/blog/mkdocs.yml @@ -32,7 +32,8 @@ markdown_extensions: - attr_list - meta - pymdownx.superfences - - pymdownx.tabbed + - pymdownx.tabbed: + alternate_style: true - pymdownx.details - pymdownx.snippets: base_path: docs/snippets diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index 2dd18ee55..22f822cf0 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -65,20 +65,20 @@ } /* bit of a hack to stop the banner taking space when empty */ -.md-announce .md-announce__inner { +.md-banner .md-banner__inner { margin: 0 auto; padding: 0; } -.md-announce { +.md-banner { background: #fff5b5; } -.md-announce .versionwarning h1 { +.md-banner .versionwarning h1 { font-weight: bold; } -.md-announce .versionwarning p { +.md-banner .versionwarning p { color: black; } -.md-announce a { +.md-banner a { color: blue; text-decoration: underline; } diff --git a/hack/build.sh b/hack/build.sh index a32672642..20048ecdf 100755 --- a/hack/build.sh +++ b/hack/build.sh @@ -21,6 +21,7 @@ RELEASE_BRANCHES=("knative-v1.2.0" "knative-v1.1.0" "knative-v1.0.0" "v0.26.0") DOCS_BRANCHES=("release-${VERSIONS[0]}" "release-${VERSIONS[1]}" "release-${VERSIONS[2]}" "release-${VERSIONS[3]}") latest=${VERSIONS[0]} previous=("${VERSIONS[@]:1}") +GIT_SLUG="knative/docs" readonly TEMP="$(mktemp -d)" readonly SITE=$PWD/site @@ -37,7 +38,7 @@ else pushd "$TEMP/docs-main"; mkdocs build -f mkdocs.yml -d $SITE/development; popd # Latest release branch to /docs - git clone --depth 1 -b ${DOCS_BRANCHES[0]} https://github.com/knative/docs "$TEMP/docs-$latest" + git clone --depth 1 -b ${DOCS_BRANCHES[0]} https://github.com/${GIT_SLUG} "$TEMP/docs-$latest" curl -f -L --show-error https://raw.githubusercontent.com/knative/serving/${RELEASE_BRANCHES[0]}/docs/serving-api.md -s > "$TEMP/docs-$latest/docs/reference/api/serving-api.md" curl -f -L --show-error https://raw.githubusercontent.com/knative/eventing/${RELEASE_BRANCHES[0]}/docs/eventing-api.md -s > "$TEMP/docs-$latest/docs/reference/api/eventing-api.md" pushd "$TEMP/docs-$latest"; KNATIVE_VERSION=${RELEASE_BRANCHES[0]} SAMPLES_BRANCH="${DOCS_BRANCHES[0]}" mkdocs build -d $SITE/docs; popd @@ -49,7 +50,7 @@ else versionjson+="{\"version\": \"v$version-docs\", \"title\": \"v$version\", \"aliases\": [\"\"]}," echo "Building for previous version $version" - git clone --depth 1 -b ${DOCS_BRANCHES[$i+1]} https://github.com/knative/docs "$TEMP/docs-$version" + git clone --depth 1 -b ${DOCS_BRANCHES[$i+1]} https://github.com/${GIT_SLUG} "$TEMP/docs-$version" curl -f -L --show-error https://raw.githubusercontent.com/knative/serving/${RELEASE_BRANCHES[i+1]}/docs/serving-api.md -s > "$TEMP/docs-$version/docs/reference/api/serving-api.md" curl -f -L --show-error https://raw.githubusercontent.com/knative/eventing/${RELEASE_BRANCHES[i+1]}/docs/eventing-api.md -s > "$TEMP/docs-$version/docs/reference/api/eventing-api.md" pushd "$TEMP/docs-$version"; KNATIVE_VERSION=${RELEASE_BRANCHES[i+1]//knative-} SAMPLES_BRANCH="${DOCS_BRANCHES[i+1]}" VERSION_WARNING=true mkdocs build -d "$SITE/v$version-docs"; popd diff --git a/mkdocs.yml b/mkdocs.yml index 566479616..7bcf997a9 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -29,7 +29,8 @@ markdown_extensions: - attr_list - meta - pymdownx.superfences - - pymdownx.tabbed + - pymdownx.tabbed: + alternate_style: true - pymdownx.details - pymdownx.snippets: base_path: docs/snippets diff --git a/requirements.txt b/requirements.txt index cb3b9a67d..28095d100 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -mkdocs-material==7.3.1 +mkdocs-material==8.1.10 mkdocs-exclude>=1.0 mkdocs-macros-plugin>=0.5.12 mkdocs-awesome-pages-plugin>=2.5