Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<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
Expand Down
7 changes: 6 additions & 1 deletion samples/api-reference/docs/theme.toml
Original file line number Diff line number Diff line change
@@ -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"
7 changes: 6 additions & 1 deletion samples/manual/docs/theme.toml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions scripts/fetch-theme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# [theme]
# repo = "aicers/docs-theme"
# template = "manual"
# version = "0.1.0"
# version = "<version>"
#
# With --source the assets are copied from a local docs-theme checkout
# instead of being downloaded, and docs/theme/.meta records
Expand Down Expand Up @@ -78,7 +78,7 @@ SAMPLE_CONFIG = (
' [theme]\n'
' repo = "aicers/docs-theme"\n'
' template = "manual"\n'
' version = "0.1.0"'
' version = "<version>"'
)


Expand Down
14 changes: 7 additions & 7 deletions tests/installer-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ write_config() {
new_project() {
# new_project <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:
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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\""
Expand Down Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion tests/pdf-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ new_project() {
# new_project <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
Expand Down