Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-reqs and tasks for launching a live version of the docs site #1808

Merged
merged 3 commits into from
Sep 23, 2024
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
11 changes: 11 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM mcr.microsoft.com/devcontainers/rust:1-1-bullseye

USER vscode

# Install nightly toolchain to give access to nightly features for docs-site build.
RUN rustup toolchain install nightly

# Install pre-requisite tools
RUN cargo install \
cargo-watch \
http-server
6 changes: 4 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
{
"name": "Azure SDK for Rust",
"image": "mcr.microsoft.com/devcontainers/rust:1-1-bullseye",
"build": {
"dockerfile": "Dockerfile"
},
"onCreateCommand": ".devcontainer/oncreate",
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {},
Expand All @@ -20,4 +22,4 @@
]
}
}
}
}
2 changes: 2 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
"**/test-resources.bicep",
"**/test-resources.json",
".devcontainer/devcontainer.json",
".devcontainer/Dockerfile",
".devcontainer/oncreate",
".github/CODEOWNERS",
".github/dependabot.yml",
".vscode/cspell.json",
".vscode/extensions.json",
".vscode/tasks.json",
"NOTICE.txt",
"eng/",
"*.dict.txt",
Expand Down
22 changes: 22 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"tasks": [
{
"label": "Start docs site (requires nightly)",
"options": {
"cwd": "${workspaceFolder}"
},
"command": "cargo",
"args": [
"watch",
"-s",
"RUSTDOCFLAGS=\"--cfg=docsrs --enable-index-page -Z unstable-options\" cargo +nightly doc --all-features --workspace --no-deps",
"-s",
"http-server --index --port 8080 ./target/doc"
],
"isBackground": true,
"problemMatcher": [
"$rustc"
]
}
]
}