Skip to content

Commit b3eee02

Browse files
Merge pull request #249 from permaweb/dpshade/new-docs-updates
Documentation Site Foundations: Build Pipeline and UI Updates
2 parents c2c54a4 + 807e374 commit b3eee02

File tree

198 files changed

+25792
-1336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+25792
-1336
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: 🥘 Build & Deploy Docs HB
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
# Trigger on changes to docs, mkdocs config, or the workflow itself
9+
- "docs/**"
10+
- "mkdocs.yml"
11+
- ".github/workflows/build-deploy-docs.yml"
12+
push:
13+
branches:
14+
- main
15+
paths:
16+
# Trigger on changes to docs, mkdocs config, or the workflow itself
17+
- "docs/**"
18+
- "mkdocs.yml"
19+
- ".github/workflows/build-deploy-docs.yml"
20+
21+
# Perform a release using a workflow dispatch
22+
workflow_dispatch:
23+
24+
defaults:
25+
run:
26+
shell: bash
27+
28+
jobs:
29+
# Run the build as part of PRs to confirm the site properly builds
30+
check_build:
31+
if: ${{ startsWith(github.ref, 'refs/pull/') }}
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: ⬇️ Checkout repo
35+
uses: actions/checkout@v3
36+
37+
# Setup Python environment
38+
- name: 🐍 Set up Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: '3.x' # Use a recent Python 3 version
42+
43+
# Install pip dependencies and cache them
44+
- name: 📦 Install Python dependencies
45+
run: |
46+
python -m pip install --upgrade pip
47+
pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin
48+
49+
- name: 🛠 Build Docs
50+
run: |
51+
./docs/build-all.sh
52+
53+
# Build and deploy the artifacts to Arweave via ArDrive
54+
deploy:
55+
if: github.ref == 'refs/heads/main'
56+
runs-on: ubuntu-latest
57+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
58+
# However, do NOT cancel in-progress runs as we want to allow these deployments to complete.
59+
concurrency:
60+
group: deploy
61+
cancel-in-progress: false
62+
steps:
63+
- name: ⬇️ Checkout repo
64+
uses: actions/checkout@v3
65+
66+
# Setup Python environment
67+
- name: 🐍 Set up Python
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: '3.x'
71+
72+
# Install pip dependencies and cache them
73+
- name: 📦 Install Python dependencies
74+
run: |
75+
python -m pip install --upgrade pip
76+
pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin
77+
78+
# Setup Node.js (needed for npx deploy command)
79+
- name: ⎔ Setup Node
80+
uses: actions/setup-node@v3
81+
with:
82+
node-version: 22 # Or your preferred version
83+
# cache: yarn # Caching might not be needed just for npx
84+
85+
- name: 👀 Env
86+
run: |
87+
echo "Event name: ${{ github.event_name }}"
88+
echo "Git ref: ${{ github.ref }}"
89+
echo "GH actor: ${{ github.actor }}"
90+
echo "SHA: ${{ github.sha }}"
91+
VER=`node --version`; echo "Node ver: $VER"
92+
VER=`npm --version`; echo "npm ver: $VER"
93+
94+
- name: 🛠 Build Docs
95+
id: build_artifacts
96+
run: |
97+
./docs/build-all.sh
98+
touch mkdocs-site/.nojekyll
99+
100+
echo "artifacts_output_dir=mkdocs-site" >> $GITHUB_OUTPUT
101+
102+
- name: 💾 Publish to Arweave
103+
id: publish_artifacts
104+
run: |
105+
npx permaweb-deploy \
106+
--ant-process=${ANT_PROCESS} \
107+
--undername=${UNDERNAME} \
108+
--deploy-folder=${ARTIFACTS_OUTPUT_DIR}
109+
env:
110+
DEPLOY_KEY: ${{ secrets.CI_WALLET }}
111+
ARTIFACTS_OUTPUT_DIR: ${{ steps.build_artifacts.outputs.artifacts_output_dir }}
112+
ANT_PROCESS: HY021r2MQL9Zi0qSNFAQ9QRshIc2mNPYf65pZBP04cE
113+
UNDERNAME: docs

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ logs
1919
*.iml
2020
rebar3.crashdump
2121
*~
22+
/venv
2223

2324
*.json
2425
!.vscode/*
@@ -37,4 +38,6 @@ cache-*
3738
*.svg
3839

3940
cu/
40-
mkdocs-site/
41+
mkdocs-site/
42+
mkdocs-site-id.txt
43+
mkdocs-site-manifest.csv

README.md

Lines changed: 91 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -278,19 +278,29 @@ guide.
278278

279279
HyperBEAM uses [MkDocs](https://www.mkdocs.org/) with the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) theme to build its documentation site.
280280

281-
Building the documentation requires Python 3, pip, and the following packages:
281+
Building the documentation requires Python 3 and pip. It's recommended to use a virtual environment:
282+
282283
```bash
283-
pip3 install mkdocs mkdocs-material
284+
# Create and activate a virtual environment (optional but recommended)
285+
python3 -m venv venv
286+
source venv/bin/activate # (macOS/Linux) On Windows use `venv\Scripts\activate`
287+
288+
# Install required packages
289+
pip3 install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin
290+
291+
# Deactivate the virtual environment when done
292+
# deactivate
284293
```
285294

286295
- **Source Files:** All documentation source files (Markdown `.md`, images, CSS) are located in the `docs/` directory.
287296
- **Source Code Docs:** Erlang source code documentation is generated using `rebar3 edoc` (with the `edown_doclet` plugin) into the `docs/source-code-docs/` directory as Markdown files. These are then incorporated into the main MkDocs site.
288297
- **Build Script:** The entire process (compiling, generating edoc, processing source docs, building the site) is handled by the `./docs/build-all.sh` script.
289298

290-
To build and view the documentation locally:
299+
To build the documentation locally:
291300

292301
1. Ensure you are in the project root directory.
293-
2. Run the build script:
302+
2. If using a virtual environment, make sure it's activated.
303+
3. Run the build script:
294304
```bash
295305
./docs/build-all.sh
296306
```
@@ -299,9 +309,82 @@ This script performs the following steps:
299309
- Compiles the Erlang project (`rebar3 compile`).
300310
- Generates Markdown documentation from source code comments (`rebar3 edoc`) into `docs/source-code-docs/`.
301311
- Processes the generated source code Markdown files (updates index, cleans up TOCs).
302-
- Builds the MkDocs site into the `dist/mkdocs` directory (`mkdocs build`).
303-
- Starts a local development server (`mkdocs serve`) to view the site at `http://127.0.0.1:8000/`.
312+
- Builds the MkDocs site into the `mkdocs-site` directory (`mkdocs build`).
304313

305-
Press `Ctrl+C` in the terminal where the script is running to stop the local server.
314+
To view the built documentation locally:
306315

307-
The final static site is generated in the `dist/mkdocs` directory, as configured in `mkdocs.yml` (`site_dir: dist/mkdocs`).
316+
1. Navigate to the site directory:
317+
```bash
318+
cd mkdocs-site
319+
```
320+
2. Start a simple Python HTTP server:
321+
```bash
322+
python3 -m http.server 8000
323+
```
324+
3. Open your web browser and go to `http://127.0.0.1:8000/`.
325+
326+
Press `Ctrl+C` in the terminal where the server is running to stop it.
327+
328+
The final static site is generated in the `mkdocs-site` directory, as configured in `mkdocs.yml` (`site_dir: mkdocs-site`).
329+
330+
### Contributing to the Documentation
331+
332+
To contribute documentation to HyperBEAM, follow these steps:
333+
334+
1. **Fork the Repository**
335+
- Fork the [HyperBEAM repository](https://github.com/permaweb/HyperBEAM) to your GitHub account
336+
337+
2. **Choose the Right Location**
338+
- Review the existing documentation structure in `./docs/` to determine the appropriate location for your content
339+
- Documentation is organized into several main sections:
340+
- `overview/`: High-level concepts and architecture
341+
- `installation-core/`: Setup and configuration guides
342+
- `components/`: Detailed component documentation
343+
- `usage/`: Tutorials and usage guides
344+
- `resources/`: Reference materials and source code documentation
345+
- `community/`: Contribution guidelines and community resources
346+
347+
3. **Create Your Documentation**
348+
- Create a new Markdown file (`.md`) in the appropriate directory
349+
- Follow the existing documentation style and format
350+
- Use proper Markdown syntax and include:
351+
- Clear headings and subheadings
352+
- Code blocks with appropriate language specification
353+
- Links to related documentation
354+
- Images (if needed) in the `docs/assets/` directory
355+
356+
4. **Update the Navigation**
357+
- Edit `mkdocs.yml` to add your documentation to the navigation
358+
- Place your entry in the appropriate section under the `nav:` configuration
359+
- Follow the existing indentation and format
360+
361+
5. **Test Your Changes**
362+
- Set up a local development environment:
363+
```bash
364+
python3 -m venv venv
365+
source venv/bin/activate
366+
pip3 install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin
367+
```
368+
- Run the build script to verify your changes:
369+
```bash
370+
./docs/build-all.sh
371+
```
372+
- View the documentation locally at `http://127.0.0.1:8000/`
373+
374+
6. **Submit a Pull Request**
375+
- Create a new branch for your documentation changes
376+
- Commit your changes with a descriptive message
377+
- Submit a PR with:
378+
- A clear title describing the documentation addition
379+
- A detailed description explaining:
380+
- The purpose of the new documentation
381+
- Why it should be added to the official docs
382+
- Any related issues or discussions
383+
- Screenshots of the rendered documentation (if applicable)
384+
385+
7. **Review Process**
386+
- The HyperBEAM team will review your PR
387+
- Be prepared to make adjustments based on feedback
388+
- Once approved, your documentation will be merged into the main repository
389+
390+
For more detailed contribution guidelines, see the [Community Guidelines](./docs/community/guidelines.md) and [Development Setup](./docs/community/setup.md) documentation.

docs/assets/images/back-rocks.avif

106 KB
Binary file not shown.

docs/assets/images/bg-low.avif

591 KB
Binary file not shown.

docs/assets/images/bg-med.avif

1.07 MB
Binary file not shown.

docs/assets/images/bg.avif

2.61 MB
Binary file not shown.

docs/assets/images/chroma-sky.avif

992 KB
Binary file not shown.

docs/assets/images/favicon.png

17.1 KB
Loading
74.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)