This file contains development tasks for the Marmite static site generator.
Build the release binary
cargo build --releaseRebuild after changing embedded assets (toolbar, templates, shortcodes)
touch src/embedded.rs && cargo buildBuild and serve the example site while watching for changes on the example dir
rm -rf ./example/site && cargo run --quiet -- example --serve --watch --force -vvvvBuild and serve the marmite.blog site locally including the CI customizations
.github/prepare_site.sh
python .github/contributors.py marmitesite/content/pages/contributors.md
cargo run --quiet -- marmitesite --serve --watch --force -vvvvBuild and serve with theme_template
rm -rf marmitesite
cp -R example marmitesite
rm -rf marmitesite/content/_hero.md
cargo run --quiet -- marmitesite --serve --watch --force -vvvv --theme theme_templateCheck code formatting and run clippy
set -e
cargo fmt -- --check
cargo clippy -- -D warningsCheck code formatting and run clippy with pedantic warnings
set -e
cargo fmt -- --check
cargo clippy -- -W clippy::pedantic -D warningsFormat the code
cargo fmtFix clippy warnings
cargo clippy --fixFix clippy warnings with pedantic settings
cargo clippy --fix -- -W clippy::pedanticRun all tests (unit and integration)
cargo testRun unit tests only
cargo test --bin marmiteRun integration tests only
cargo test --test '*'Watch for changes on the whole source code and rebuild the example site without serving it.
cargo watch -c -q -x "run example --force -vvvv"Bump version in Cargo.toml
#!/usr/bin/env bash
cargo set-version --version || cargo install cargo-edit@0.13.0
cargo set-version --package marmite --locked "$tag"
cargo generate-lockfile
mask fmt
git add ./Cargo.toml ./Cargo.lock
git commit -m "chore: bump version to $tag"Push a new tag to the repository
#!/usr/bin/env bash
git push
git tag -a "$tag" -m "chore: push $tag"
git push --tagsPublish a new version (bumpversion + pushtag)
mask bumpversion "$tag"
mask pushtag "$tag"Amend changes and retag and push tags again
git push origin :refs/tags/$tag
git commit --amend --no-edit --allow-empty
git tag -f $tag
git push --force-with-lease
git push origin $tagCalculate code coverage and generate cobertura.xml
cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out xmlCalculate coverage using llvm
cargo llvm-cov clean --workspace # remove artifacts that may affect the coverage results
cargo llvm-cov --no-report
rm -rf /tmp/test_blog
rm -rf /tmp/test_site
cargo llvm-cov --no-report run -- example /tmp/test_site
cargo llvm-cov --no-report run -- /tmp/test_blog --init-site
cargo llvm-cov --no-report run -- /tmp/test_blog --start-theme fluffy
cargo llvm-cov --no-report run -- /tmp/test_blog --theme fluffy
cargo llvm-cov --no-report run -- /tmp/test_blog --name foo --tagline bar --toc true --enable-search true --colorscheme gruvbox
cargo llvm-cov report --html # generate report without tests (replace with --lcov for file report)Install git pre-commit hook that runs mask pedantic
#!/usr/bin/env bash
hook=".git/hooks/pre-commit"
cat > "$hook" << 'HOOK'
#!/bin/sh
mask pedantic
HOOK
chmod +x "$hook"
echo "Pre-commit hook installed at $hook"Build Python wheel with maturin
uv run --with "pip,maturin[zig],cffi" maturin build --releaseBuild Python wheel with specific interpreter
uv run --with "pip,maturin[zig],cffi" maturin build --release --strip --interpreter python3Install Python package in development mode
uv run --with "pip,maturin[zig],cffi" maturin develop --releaseBuild Python wheel with uv and maturin
uv run --with pip,maturin[zig],cffi maturin build --releaseBuild source distribution with maturin
uv run --with pip,maturin[zig],cffi maturin sdist