diff --git a/README.md b/README.md index 1bc7551..03acc23 100644 --- a/README.md +++ b/README.md @@ -162,9 +162,13 @@ fetch and would only produce an empty-diff bump pull request. [theme] repo = "aicers/docs-theme" template = "manual" - version = "0.1.0" + version = "" ``` + Use the tag of the release you want to pin to; the + [releases page](https://github.com/aicers/docs-theme/releases) lists + them. + 3. Run the installer with no arguments: ```sh diff --git a/samples/api-reference/docs/theme.toml b/samples/api-reference/docs/theme.toml index 7778608..42d4491 100644 --- a/samples/api-reference/docs/theme.toml +++ b/samples/api-reference/docs/theme.toml @@ -1,4 +1,9 @@ +# install-samples.sh always installs with --source, from this checkout +# rather than from a release, so `version` is never used to resolve +# anything. It is deliberately not kept in step with the tags: a real +# number here would go stale at every release and read as a claim the +# sample does not make. [theme] repo = "aicers/docs-theme" template = "api-reference" -version = "0.1.0" +version = "0.0.0" diff --git a/samples/manual/docs/theme.toml b/samples/manual/docs/theme.toml index 8ef7f6b..f450f85 100644 --- a/samples/manual/docs/theme.toml +++ b/samples/manual/docs/theme.toml @@ -1,4 +1,9 @@ +# install-samples.sh always installs with --source, from this checkout +# rather than from a release, so `version` is never used to resolve +# anything. It is deliberately not kept in step with the tags: a real +# number here would go stale at every release and read as a claim the +# sample does not make. [theme] repo = "aicers/docs-theme" template = "manual" -version = "0.1.0" +version = "0.0.0" diff --git a/scripts/fetch-theme.sh b/scripts/fetch-theme.sh index 7a95353..2d12872 100755 --- a/scripts/fetch-theme.sh +++ b/scripts/fetch-theme.sh @@ -10,7 +10,7 @@ # [theme] # repo = "aicers/docs-theme" # template = "manual" -# version = "0.1.0" +# version = "" # # With --source the assets are copied from a local docs-theme checkout # instead of being downloaded, and docs/theme/.meta records @@ -78,7 +78,7 @@ SAMPLE_CONFIG = ( ' [theme]\n' ' repo = "aicers/docs-theme"\n' ' template = "manual"\n' - ' version = "0.1.0"' + ' version = ""' ) diff --git a/tests/installer-test.sh b/tests/installer-test.sh index 976e06c..aa3db0c 100755 --- a/tests/installer-test.sh +++ b/tests/installer-test.sh @@ -31,7 +31,7 @@ write_config() { new_project() { # new_project [template] [version] local project="$1" - write_config "$project" "${2:-manual}" "${3:-0.1.0}" + write_config "$project" "${2:-manual}" "${3:-1.2.3}" cat > "$project/mkdocs.yml" <<'EOF' site_name: Fixture Project extra_css: @@ -74,7 +74,7 @@ command -v mkdocs >/dev/null || die "mkdocs is required to run this test" project="$WORK/alpha" new_project "$project" install_into "$project" --source "$REPO_ROOT" > "$WORK/install.log" -grep -q "^Installed docs-theme 0.1.0 (manual, local)" "$WORK/install.log" \ +grep -q "^Installed docs-theme 1.2.3 (manual, local)" "$WORK/install.log" \ || die "first install did not report what it installed" for entry in \ @@ -102,7 +102,7 @@ for key in repo version template digest source; do [ -n "$(meta_value "$project" "$key")" ] || die ".meta has no $key" done [ "$(meta_value "$project" repo)" = "aicers/docs-theme" ] || die "wrong repo" -[ "$(meta_value "$project" version)" = "0.1.0" ] || die "wrong version" +[ "$(meta_value "$project" version)" = "1.2.3" ] || die "wrong version" [ "$(meta_value "$project" template)" = "manual" ] || die "wrong template" [ "$(meta_value "$project" source)" = "local" ] || die "--source is not local" ok ".meta records repo, version, template, digest, and source" @@ -173,7 +173,7 @@ ok "reinstalling the same source reproduces the digest" # --- theme.toml drives version and template --------------------------- -write_config "$project" api-reference 0.1.0 +write_config "$project" api-reference 1.2.3 install_into "$project" --source "$REPO_ROOT" > "$WORK/template.log" grep -q "^Installed" "$WORK/template.log" \ || die "a template change did not reinstall" @@ -210,7 +210,7 @@ expect_failure "$WORK/no-config" "docs/theme.toml" \ "a missing docs/theme.toml names the file" --source "$REPO_ROOT" mkdir -p "$WORK/no-key/docs" -printf '[theme]\nrepo = "aicers/docs-theme"\nversion = "0.1.0"\n' \ +printf '[theme]\nrepo = "aicers/docs-theme"\nversion = "1.2.3"\n' \ > "$WORK/no-key/docs/theme.toml" expect_failure "$WORK/no-key" "theme.template" \ "a missing key names the key" --source "$REPO_ROOT" @@ -296,7 +296,7 @@ chmod +x "$WORK/bin/gh" new_project "$WORK/delta" (cd "$WORK/delta" && PATH="$WORK/bin:$PATH" "$FETCH") > "$WORK/release.log" -grep -q "^Installed docs-theme 0.1.0 (manual, release)" "$WORK/release.log" \ +grep -q "^Installed docs-theme 1.2.3 (manual, release)" "$WORK/release.log" \ || die "the release path did not install" [ "$(meta_value "$WORK/delta" source)" = "release" ] \ || die "a downloaded install did not record source = \"release\"" @@ -325,7 +325,7 @@ chmod +x "$WORK/nogh/gh" new_project "$WORK/epsilon" (cd "$WORK/epsilon" && PATH="$WORK/nogh:$PATH" "$FETCH" --source "$REPO_ROOT") \ > "$WORK/nogh.log" -grep -q "^Installed docs-theme 0.1.0 (manual, local)" "$WORK/nogh.log" \ +grep -q "^Installed docs-theme 1.2.3 (manual, local)" "$WORK/nogh.log" \ || die "--source did not install with a failing gh first on PATH" ok "--source installs without invoking gh" diff --git a/tests/pdf-test.sh b/tests/pdf-test.sh index 7db4e5a..e662e02 100755 --- a/tests/pdf-test.sh +++ b/tests/pdf-test.sh @@ -31,7 +31,7 @@ new_project() { # new_project local project="$1" mkdir -p "$project/docs" - printf '[theme]\nrepo = "aicers/docs-theme"\ntemplate = "manual"\nversion = "0.1.0"\n' \ + printf '[theme]\nrepo = "aicers/docs-theme"\ntemplate = "manual"\nversion = "1.2.3"\n' \ > "$project/docs/theme.toml" cat > "$project/docs/index.md" <<'EOF' # Fixture Chapter