-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: use new docs with mkdocs (#430)
- Loading branch information
Showing
13 changed files
with
9,714 additions
and
3,552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,26 +4,28 @@ on: | |
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'docs/**' | ||
- 'mkdocs.yml' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'docs/**' | ||
- '.github/workflows/docs.yml' | ||
- 'mkdocs.yml' | ||
- 'pixi.*' | ||
workflow_dispatch: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUSTFLAGS: "-D warnings" | ||
RUSTDOCFLAGS: --html-in-header header.html | ||
|
||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow one concurrent deployment | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-and-deploy: | ||
build: | ||
# Don't run on forks | ||
if: github.repository == 'prefix-dev/rattler-build' | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -32,54 +34,42 @@ jobs: | |
with: | ||
submodules: recursive | ||
|
||
- name: Setup mdBook | ||
uses: peaceiris/actions-mdbook@v1 | ||
with: | ||
mdbook-version: 'latest' | ||
|
||
|
||
- uses: dtolnay/rust-toolchain@master | ||
- uses: prefix-dev/[email protected] | ||
with: | ||
toolchain: '1.73.0' | ||
pixi-version: v0.10.0 | ||
cache: true | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
uses: actions/configure-pages@v3 | ||
|
||
# This does the following: | ||
# - Replaces the docs icon with one that clearly denotes it's not the released package on crates.io | ||
# - Adds a meta tag that forces Google not to index any page on the site. | ||
- name: Pre-docs-build | ||
run: | | ||
echo "<meta name=\"robots\" content=\"noindex\">" > header.html | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: Build Documentation | ||
run: cargo doc --workspace --no-deps --all-features | ||
- name: Build Book | ||
run: mdbook build | ||
- name: Build pixi Documentation | ||
run: pixi run build-docs | ||
|
||
# This adds the following: | ||
# - A top level redirect to the bevy crate documentation | ||
# - A robots.txt file to forbid any crawling of the site (to defer to the docs.rs site on search engines). | ||
# - A .nojekyll file to disable Jekyll GitHub Pages builds. | ||
# - Adds installation scripts to the pages webserver. | ||
- name: Finalize documentation | ||
run: | | ||
mkdir final_docs | ||
touch final_docs/.nojekyll | ||
echo "<meta http-equiv=\"refresh\" content=\"0; url=rattler/index.html\">" > target/doc/index.html | ||
mkdir -p final_docs/reference | ||
mv target/doc/* final_docs/reference | ||
touch site/.nojekyll | ||
# cp install/{install.sh,install.ps1} site | ||
mv book/* final_docs/ | ||
echo "User-Agent: *\nDisallow: /" > final_docs/robots.txt | ||
# https://github.com/actions/upload-pages-artifact#file-permissions | ||
- run: chmod -c -R +rX site/ | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: 'final_docs' | ||
path: "site" | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: github.repository == 'prefix-dev/rattler-build' && github.ref == 'refs/heads/main' | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v3 | ||
uses: actions/deploy-pages@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Jinja functions that can be used in the recipe | ||
|
||
`rattler-build` comes with a couple of useful helpers that can be used in the recipe. | ||
|
||
- `${{ compiler('c') }}` | ||
- `${{ pin_subpackage("mypkg", min_pin="x.x", max_pin="x.x.x") }}` creates a pin to another output in the recipe. | ||
|
||
<!-- `pin_compatible` (not implemented yet). --> | ||
|
||
- `${{ hash }}` this is the variant hash and is useful in the build string computation | ||
- `${{ python | version_to_buildstring }}` converts a version from the variant to a build string (removes `.` and takes only the first two elements of the version). | ||
- default jinja filters are available: `lower`, `upper`, indexing into characters: `https://myurl.com/{{ name[0] }}/{{ name | lower }}_${{ version }}.tar.gz`. | ||
A list of all the builtin filters can be found under: [Link](https://docs.rs/minijinja/latest/minijinja/filters/index.html#functions) |
Oops, something went wrong.