Skip to content

Commit 6b76cff

Browse files
authored
Merge pull request #1400 from o1-labs/dw/website-more-doc
Website: improve documentation
2 parents 0341fff + 81ca232 commit 6b76cff

File tree

13 files changed

+1732
-77
lines changed

13 files changed

+1732
-77
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,23 @@ jobs:
205205
- name: Release build
206206
run: make build-release
207207

208+
- name: Verify build-info command
209+
run: |
210+
echo "Testing build-info command..."
211+
./target/release/mina build-info
212+
213+
# Verify required fields are present
214+
./target/release/mina build-info | grep -E "Version:|Build time:|Commit SHA:|Commit branch:|Rustc version:"
215+
216+
# Verify version format (should be a short commit hash)
217+
VERSION=$(./target/release/mina build-info | grep "Version:" | awk '{print $2}')
218+
if [[ ! "$VERSION" =~ ^[0-9a-f]{7}$ ]]; then
219+
echo "Error: Version should be a 7-character commit hash, got: $VERSION"
220+
exit 1
221+
fi
222+
223+
echo "Build info verification passed!"
224+
208225
- name: Upload binaries
209226
if: matrix.os == 'ubuntu-22.04'
210227
uses: actions/upload-artifact@v4

.github/workflows/docker.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,44 @@ jobs:
197197
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
198198
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
199199
additional_tags: ${{ env.ADDITIONAL_TAGS }}
200+
201+
# Test Docker image build-info
202+
test-docker-build-info:
203+
runs-on: ubuntu-latest
204+
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release')
205+
needs:
206+
- push-node-image
207+
steps:
208+
- name: Set up environment variables
209+
run: |
210+
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
211+
echo "DOCKER_TAG=develop" >> $GITHUB_ENV
212+
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
213+
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
214+
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
215+
TAG="${GITHUB_REF#refs/tags/}"
216+
echo "DOCKER_TAG=${TAG}" >> $GITHUB_ENV
217+
elif [[ "${{ github.ref }}" == refs/heads/release/* ]]; then
218+
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
219+
VERSION="${BRANCH_NAME#release/}"
220+
echo "DOCKER_TAG=${VERSION}" >> $GITHUB_ENV
221+
fi
222+
223+
- name: Test build-info command in Docker image
224+
run: |
225+
echo "Testing build-info for Docker image ${{ env.REGISTRY_NODE_IMAGE }}:${{ env.DOCKER_TAG }}"
226+
227+
# Run build-info command
228+
docker run --rm ${{ env.REGISTRY_NODE_IMAGE }}:${{ env.DOCKER_TAG }} build-info
229+
230+
# Verify required fields are present
231+
docker run --rm ${{ env.REGISTRY_NODE_IMAGE }}:${{ env.DOCKER_TAG }} build-info | grep -E "Version:|Build time:|Commit SHA:|Commit branch:|Rustc version:"
232+
233+
# Verify version format
234+
VERSION=$(docker run --rm ${{ env.REGISTRY_NODE_IMAGE }}:${{ env.DOCKER_TAG }} build-info | grep "Version:" | awk '{print $2}')
235+
if [[ ! "$VERSION" =~ ^[0-9a-f]{7}$ ]]; then
236+
echo "Error: Version should be a 7-character commit hash, got: $VERSION"
237+
exit 1
238+
fi
239+
240+
echo "Docker image build-info verification passed!"

CLAUDE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,21 @@ files.
245245
- Maintain proper capitalization for proper nouns and technical terms
246246
- Apply this style consistently across all documentation files
247247

248+
**Docusaurus admonitions (:::note, :::caution, :::info, etc.):**
249+
250+
- Always wrap Docusaurus admonitions with `<!-- prettier-ignore-start -->` and
251+
`<!-- prettier-ignore-stop -->` comments
252+
- This prevents prettier from reformatting the admonition blocks
253+
- Example:
254+
255+
```mdx
256+
<!-- prettier-ignore-start -->
257+
258+
:::note Content of the note here :::
259+
260+
<!-- prettier-ignore-stop -->
261+
```
262+
248263
### Documentation Script Testing
249264

250265
When modifying developer setup scripts in `website/docs/developers/scripts/`,

Makefile

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ NETWORK ?= devnet
3030
VERBOSITY ?= info
3131
GIT_COMMIT := $(shell git rev-parse --short=8 HEAD)
3232

33+
# Documentation server port
34+
DOCS_PORT ?= 3000
35+
3336
OPAM_PATH := $(shell command -v opam 2>/dev/null)
3437

3538
ifdef OPAM_PATH
@@ -41,6 +44,16 @@ endif
4144

4245
.PHONY: help
4346
help: ## Ask for help!
47+
@echo "Mina Rust Makefile - Common Variables:"
48+
@echo " DOCS_PORT=<port> Set documentation server port (default: 3000)"
49+
@echo " NETWORK=<network> Set network (default: devnet)"
50+
@echo " VERBOSITY=<level> Set logging verbosity (default: info)"
51+
@echo ""
52+
@echo "Examples:"
53+
@echo " make docs-serve DOCS_PORT=8080 # Start docs server on port 8080"
54+
@echo " make run-node NETWORK=mainnet # Run node on mainnet"
55+
@echo ""
56+
@echo "Available targets:"
4457
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
4558

4659
.PHONY: build
@@ -470,13 +483,13 @@ docs-build: docs-integrate-rust docs-install ## Build the documentation website
470483
.PHONY: docs-serve
471484
docs-serve: docs-integrate-rust docs-install ## Serve the documentation website locally with Rust API docs
472485
@echo "Starting documentation server with Rust API documentation..."
473-
@echo "Documentation will be available at: http://localhost:3000"
474-
@cd website && npm start
486+
@echo "Documentation will be available at: http://localhost:$(DOCS_PORT)"
487+
@cd website && npm start -- --port $(DOCS_PORT)
475488

476489
.PHONY: docs-build-serve
477490
docs-build-serve: docs-build ## Build and serve the documentation website locally with Rust API docs
478-
@echo "Serving built documentation with Rust API documentation at: http://localhost:3000"
479-
@cd website && npm run serve
491+
@echo "Serving built documentation with Rust API documentation at: http://localhost:$(DOCS_PORT)"
492+
@cd website && npm run serve -- --port $(DOCS_PORT)
480493

481494
.PHONY: docs-build-only
482495
docs-build-only: docs-install ## Build the documentation website without Rust API docs
@@ -488,8 +501,8 @@ docs-build-only: docs-install ## Build the documentation website without Rust AP
488501
.PHONY: docs-serve-only
489502
docs-serve-only: docs-install ## Serve the documentation website locally without Rust API docs
490503
@echo "Starting documentation server (without Rust API docs)..."
491-
@echo "Documentation will be available at: http://localhost:3000"
492-
@cd website && npm start
504+
@echo "Documentation will be available at: http://localhost:$(DOCS_PORT)"
505+
@cd website && npm start -- --port $(DOCS_PORT)
493506

494507
.PHONY: docs-rust
495508
docs-rust: ## Generate Rust API documentation

0 commit comments

Comments
 (0)