mkdocs-semiliterate/tests/sites.bash
Glen Whitney 9d75fefb81
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
feat: Add extract_on_copy option
Previously, mkdocs_semiliterate would always attempt to extract documentation
  from a file, even if it matched the `include_extensions` pattern for files to
  be copied to the documentation site verbatim.

  Now, by default, such files are not considered candidates for extraction,
  even if they match a semiliterate pattern.

  Adds a configuration option `extract_on_copy` which can be set to `true` to
  restore the prior behavior. Also adds tests for the behavior with and without
  `extract_on_copy` and makes all `mkdocs build` commands in the tests strict,
  which they always should have been.

  Resolves #17.
2022-07-12 12:14:41 -07:00

20 lines
607 B
Bash

set -e
shopt -s globstar
startdir=$PWD
for file in tests/fixtures/*
do
cd "$startdir/$file"
mkdocs -v build -s
# unfortunately MkDocs writes the run date in the last few lines of index
# and has version numbers in some of the scripts that are irrelevant:
for hml in **/*.html
do
grep -v MkDocs.version $hml | grep -v Build.Date.UTC | grep -v '[</]script[ >]' | grep -v '[</]link' > "$hml.cropped"
rm $hml
done
diff -r -x img -x fonts -x js -x '*.xml*' refsite site
echo "Site in $file built successfully"
rm -r site
done
echo "All site tests passed."