Skip to content

Commit 4b3e615

Browse files
committed
Update workflow
1 parent 9c613a1 commit 4b3e615

File tree

2 files changed

+50
-11
lines changed

2 files changed

+50
-11
lines changed

.CONTRIBUTING.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
> **📋 Essential**: All contributions must follow the [PaperMoon Style Guide](https://github.com/papermoonio/documentation-style-guide).
44
55
## Contents
6+
67
- [Quick Start](#quick-start)
78
- [Fix or Improve Existing Content](#fix-or-improve-existing-content)
89
- [Add a New Page](#add-a-new-page)
@@ -16,24 +17,30 @@
1617
## Quick Start
1718

1819
1. **Fork and Create Branch**
20+
1921
```bash
2022
git clone https://github.com/your-username/polkadot-docs.git
2123
cd polkadot-docs
2224
git checkout -b your-feature-branch
2325
```
2426

2527
2. **Make Your Changes**
28+
2629
- Follow the [PaperMoon Style Guide](https://github.com/papermoonio/documentation-style-guide)
2730
- Test your changes locally (see [Running Polkadot Docs Locally](../README.md#run-polkadot-docs-locally))
2831

2932
3. **Update AI Documentation**
30-
After making content changes, regenerate the AI-ready documentation files:
33+
34+
After making content changes, regenerate the AI-ready documentation files.
35+
36+
Set up your Python environment following the [Set Up Python Environment](./README.md#set-up-python-environment) section of the README, then run:
3137
```bash
3238
python3 scripts/generate_llms.py
3339
```
3440
**Note**: Run this script on every PR once all changes are committed.
3541

3642
4. **Create Pull Request**
43+
3744
- Push your branch and create a pull request
3845
- Use the PR template to indicate your review preference
3946

@@ -56,6 +63,7 @@ To add a page to an existing section:
5663
1. **Create your markdown file** following [naming conventions](https://github.com/papermoonio/documentation-style-guide/blob/main/style-guide.md#naming-conventions)
5764

5865
2. **Include required frontmatter**:
66+
5967
```markdown
6068
---
6169
title: Page Title (max 60 chars for SEO)
@@ -76,6 +84,7 @@ To add a page to an existing section:
7684
- [Google's description recommendations](https://developers.google.com/search/docs/advanced/appearance/snippet?hl=en)
7785

7886
3. **Update navigation** - Add your page to the `.nav.yml` file in the same directory:
87+
7988
```yaml
8089
- 'Your Page Display Name': 'your-file-name.md'
8190
```
@@ -85,6 +94,7 @@ To add a page to an existing section:
8594
To create an entirely new section of documentation:
8695
8796
1. **Create directory structure**:
97+
8898
```
8999
your-new-section/
90100
├── .nav.yml
@@ -93,6 +103,7 @@ To create an entirely new section of documentation:
93103
```
94104

95105
2. **Create `.nav.yml`**:
106+
96107
```yaml
97108
title: Section Display Name
98109
nav:
@@ -125,13 +136,15 @@ tutorials/
125136
```
126137
127138
### Set Up Directory Structure
139+
128140
```
129141
tutorials/[section]/[subsection]/[tutorial-name].md
130142
images/tutorials/[section]/[subsection]/[tutorial-name]/
131143
.snippets/code/tutorials/[section]/[subsection]/[tutorial-name]/
132144
```
133145
134146
### Use the Tutorial Template
147+
135148
```markdown
136149
---
137150
title: Tutorial Title (max 60 chars)
@@ -159,6 +172,7 @@ Related tutorials
159172
```
160173

161174
### Tutorial Requirements
175+
162176
- All code examples must be tested and functional
163177
- Always specify dependency versions (e.g., `npm install [email protected]`)
164178
- Use action-oriented section titles
@@ -171,11 +185,13 @@ Related tutorials
171185
**Where to store**: `images/<path-matching-doc-structure>/`
172186

173187
**Requirements**:
188+
174189
- Format: `.webp`
175190
- Desktop screenshots: 1512px width, variable height
176191
- Browser extension screenshots: 400x600px
177192

178193
**How to use**:
194+
179195
```markdown
180196
![Alt text description](/docs/images/<subdirectory>/<image-file-name>.webp)
181197
```

README.md

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The documentation source files are written in [Markdown](https://daringfireball.
66

77
## Run Polkadot Docs Locally
88

9-
You may want to spin up a local version of the documentation site to preview your changes. This guide will cover the steps needed to serve a local version.
9+
Follow these steps to run the documentation site locally and preview your changes.
1010

1111
### Clone Repositories
1212

@@ -40,34 +40,57 @@ To set up the structure, follow these steps:
4040
git clone https://github.com/polkadot-developers/polkadot-docs.git
4141
```
4242

43-
### Install Dependencies and Serve Site
43+
### Set Up Python Environment
4444

45-
1. Now that the repositories are cloned and properly nested, use the [pip](https://pypi.org/project/pip/) package installer to install [mkdocs](https://www.mkdocs.org/) and other required dependencies by running the command:
45+
Navigate to the `polkadot-mkdocs` directory and create a Python virtual environment:
4646

47-
```bash
48-
pip install -r requirements.txt
49-
```
47+
```bash
48+
cd polkadot-mkdocs
49+
python -m venv venv
50+
source venv/bin/activate # On Windows: venv\Scripts\activate
51+
pip install -r requirements.txt
52+
```
5053

51-
This command will install all dependencies listed in the `requirements.txt` file.
54+
### Install Dependencies and Serve Site
5255

53-
2. Switch to the `polkadot-docs` directory and use [npm](https://docs.npmjs.com/about-npm) to install dependencies:
56+
1. Install Node.js dependencies:
5457

5558
```bash
56-
cd polkadot-docs && npm install
59+
cd polkadot-docs && npm install && cd ..
5760
```
5861

59-
3. Navigate back to the `polkadot-mkdocs` folder, then build the site:
62+
2. Serve the site:
6063

6164
```bash
6265
mkdocs serve
6366
```
6467

6568
After a successful build, the site should be available at http://127.0.0.1:8000.
6669

70+
### Deactivating the Virtual Environment
71+
72+
When you're done working on the documentation, you can deactivate the virtual environment by running:
73+
74+
```bash
75+
deactivate
76+
```
77+
78+
### Next Time You Work on the Docs
79+
80+
When you return to work on the documentation:
81+
82+
1. Navigate to the `polkadot-mkdocs` directory
83+
2. Activate the virtual environment:
84+
- macOS/Linux: `source venv/bin/activate`
85+
- Windows: `venv\Scripts\activate`
86+
3. Run `mkdocs serve` to start the development server
87+
6788
## Contributing
6889
6990
See [.CONTRIBUTING.md](./CONTRIBUTING.md) for how to contribute to this repository.
7091
92+
We're excited to have you contribute to the **Polkadot Docs** and help improve our ecosystem! 🚀 Every contribution, whether it's fixing a typo, improving documentation, or adding new content, helps make Polkadot more accessible to developers worldwide. Thank you for being part of our community! 🙏✨
93+
7194
## Disclaimer
7295
7396
### Licensing Disclaimer

0 commit comments

Comments
 (0)