Skip to content

Commit e5418ec

Browse files
committed
Merge branch 'master' into nhussein11/follow-up-moonbeam-xcm-sdk-contribution
2 parents d9b2532 + c16a9e6 commit e5418ec

File tree

225 files changed

+194882
-47060
lines changed

Some content is hidden

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

225 files changed

+194882
-47060
lines changed

.CONTRIBUTING.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ You may want to spin up a local version of the documentation site to preview you
3030

3131
Building and serving the site requires cloning two repositories:
3232

33-
- **[Polkadot MkDocs](https://github.com/papermoonio/polkadot-mkdocs)** - contains the MkDocs configuration files, theme overrides, and custom CSS for the Polkadot documentation site
33+
- **[Polkadot MkDocs](https://github.com/papermoonio/polkadot-mkdocs)**: Contains the MkDocs configuration files, theme overrides, and custom CSS for the Polkadot documentation site.
3434

35-
- **[Polkadot Docs](https://github.com/polkadot-developers/polkadot-docs)** - the actual content is stored in the `polkadot-docs` repository and pulled into the `polkadot-mkdocs` directory during build
35+
- **[Polkadot Docs](https://github.com/polkadot-developers/polkadot-docs)**: The actual content is stored in the `polkadot-docs` repository and pulled into the `polkadot-mkdocs` directory during build.
3636

3737
For everything to work correctly, the file structure needs to be as follows:
3838

@@ -90,16 +90,16 @@ When adding new pages to the documentation site, it is important to ensure all r
9090

9191
To create a new section of pages, you will first need to create a subdirectory with the desired name of the section. The root directory, and every subdirectory, must contain the following files:
9292

93-
- `.pages` - defines the structure of the documentation site
94-
- `index.md` - a landing page which can be used to provide more context about the content in the section
93+
- **`.pages`**: Defines the structure of the documentation site.
94+
- **`index.md`**: A landing page which can be used to provide more context about the content in the section.
9595

9696
#### Example `.pages` File
9797

9898
```markdown
9999
title: Application Developers
100100
nav:
101101
- index.md
102-
- 'Polkadot SDK': 'polkadot-sdk.md'
102+
- **'Polkadot SDK'**: 'polkadot-sdk.md'
103103
- interact
104104
- tooling
105105
```
@@ -108,10 +108,10 @@ This example would result in adding 'Application Developers' as a section with t
108108

109109
Some important things to note:
110110

111-
- The `title` field at the top of the page represents the display name for the section. This is displayed on the left-side navigation bar when viewing the site
112-
- The `index.md` page should always be the first item in the `nav` list
113-
- Files follow the convention of `'Display Name': 'file-name.md'`
114-
- Sections are listed by their directory name in the source code. For example, the Tooling section will be added to the navigation simply by using the directory name: `tooling`
111+
- The `title` field at the top of the page represents the display name for the section. This is displayed on the left-side navigation bar when viewing the site.
112+
- The `index.md` page should always be the first item in the `nav` list.
113+
- Files follow the convention of `'Display Name': 'file-name.md'`.
114+
- Sections are listed by their directory name in the source code. For example, the Tooling section will be added to the navigation simply by using the directory name: `tooling`.
115115

116116
#### Example `index.md` File
117117

@@ -126,22 +126,22 @@ description: Learn how to build and customize blockchains with Polkadot SDK. Exp
126126

127127
Some important things to note:
128128

129-
- The `title` represents the `<title>` tag and is used for SEO purposes
130-
- The `description` represents the meta-description and is also used for SEO purposes
129+
- The `title` represents the `<title>` tag and is used for SEO purposes.
130+
- The `description` represents the meta-description and is also used for SEO purposes.
131131

132132
### Adding Pages to Existing Section
133133

134134
If you are adding pages to an existing section, the steps are simplified. However, it's essential to ensure you complete these steps to display the new page and its title on the documentation site correctly:
135135
136136
- Add the new markdown page to the appropriate section. Note that the filename becomes part of the URL for this page. See the [style guide](https://github.com/papermoonio/documentation-style-guide/blob/main/style-guide.md#naming-conventions) for additional guidance on naming conventions.
137137
- Ensure the new content page includes the following:
138-
- **`title`** - represents the `<title>` tag and is used for SEO purposes (not displayed on the published site) Titles have a maximum length of 45 characters.
139-
- **`description`** - represents the meta-description and is also used for SEO purposes (not displayed on the published site). Descriptions should be 120-160 characters and should provide a preview into the page topic.
140-
- **Page title** - an H1 heading title to be displayed at the top of the page
138+
- **`title`**: Represents the `<title>` tag and is used for SEO purposes (not displayed on the published site) Titles have a maximum length of 45 characters.
139+
- **`description`**: Represents the meta-description and is also used for SEO purposes (not displayed on the published site). Descriptions should be 120-160 characters and should provide a preview into the page topic.
140+
- **Page title**: An H1 heading title to be displayed at the top of the page.
141141
142-
- **`## Checking Prerequisites` section** - if the guide requires the user to have specific developer tools installed, for example, Docker or MetaMask, it should be listed here
142+
- **`## Checking Prerequisites` section**: If the guide requires the user to have specific developer tools installed, for example, Docker or MetaMask, it should be listed here.
143143
144-
- Add the 'Display Name': 'file-name.md' for the new page to the `.pages` folder in the same subdirectory where you added the new page
144+
- **Add the 'Display Name'**: 'file-name.md' for the new page to the `.pages` folder in the same subdirectory where you added the new page.
145145
146146
An example new content page might look like:
147147
@@ -172,10 +172,10 @@ More resources for [SEO Optimization](#search-engine-optimization-seo) of titles
172172
git checkout -b INSERT_NEW_BRANCH_NAME
173173
```
174174
175-
2. Modify content as desired. Remember to place images and code snippets in the appropriate folders (see the following sections for details)
176-
3. Review the [style guide](https://github.com/papermoonio/documentation-style-guide/blob/main/style-guide.md) to ensure your new content meets the guidelines
177-
3. Once you commit and push all of your changes, open a pull request for the new content branch against the `main` branch
178-
4. Monitor notifications and pull requests for feedback from code owners. At least one approval is required before merging content
175+
2. Modify content as desired. Remember to place images and code snippets in the appropriate folders (see the following sections for details).
176+
3. Review the [style guide](https://github.com/papermoonio/documentation-style-guide/blob/main/style-guide.md) to ensure your new content meets the guidelines.
177+
3. Once you commit and push all of your changes, open a pull request for the new content branch against the `main` branch.
178+
4. Monitor notifications and pull requests for feedback from code owners. At least one approval is required before merging content.
179179
180180
If your additions or modifications are limited to content on an existing page, there is no need to worry about the [`.pages`](#example-pages-file) or [`index.md`](#example-indexmd-file) files, as changes to page content don't affect these files.
181181

@@ -222,11 +222,11 @@ In general, titles should be between 50 and 60 characters and descriptions shoul
222222

223223
There are a few tools you may find useful for proofreading and editing your contributions:
224224

225-
- **[Vale](https://vale.sh/)** - the `polkadot-mkdocs` repository contains configuration for Vale, an open source NLP-powered linter for text. The configuration is a work in progress with a growing custom dictionary tailored toward software engineering, blockchain, and Polkadot terms. Running Vale against your files locally can serve as a first round of feedback to speed up the review process
225+
- **[Vale](https://vale.sh/)**: The `polkadot-mkdocs` repository contains configuration for Vale, an open source NLP-powered linter for text. The configuration is a work in progress with a growing custom dictionary tailored toward software engineering, blockchain, and Polkadot terms. Running Vale against your files locally can serve as a first round of feedback to speed up the review process.
226226

227227
To use Vale locally to screen your work:
228228

229-
1. Visit the Vale site and follow the [installation instructions](https://vale.sh/docs/vale-cli/installation/)
229+
1. Visit the Vale site and follow the [installation instructions](https://vale.sh/docs/vale-cli/installation/).
230230
2. From the `polkadot-mkdocs` directory, run the following in your terminal:
231231

232232
```bash
@@ -237,8 +237,8 @@ To use Vale locally to screen your work:
237237

238238
![Vale sample terminal output](images/contributing/vale-output-01.webp)
239239

240-
3. You can use CMD+click to open the file with the flagged items. This is especially helpful if you run Vale against a directory with multiple files
240+
3. You can use CMD+click to open the file with the flagged items. This is especially helpful if you run Vale against a directory with multiple files.
241241

242-
4. Each flag tells you the line and location of the flagged item, the level of the flag (error, warning, or suggestion), and a suggestion for how to resolve the flag
242+
4. Each flag tells you the line and location of the flagged item, the level of the flag (error, warning, or suggestion), and a suggestion for how to resolve the flag.
243243

244-
5. Once you have addressed the flagged items and made edits as needed, you can complete the normal steps to commit your changes and open a pull request to review for merge
244+
5. Once you have addressed the flagged items and made edits as needed, you can complete the normal steps to commit your changes and open a pull request to review for merge.

.github/scripts/check_dependencies.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,29 @@ def get_latest_pypi_version(package_name):
5757
print(f"Error fetching PyPI package version for {package_name}: {e}")
5858
return None, None
5959

60+
def check_sub_dependencies(name, info, outdated_dependencies):
61+
"""Check sub-dependencies within a repository entry"""
62+
# Check if there's a subdependencies section
63+
subdependencies = info.get("subdependencies", {})
64+
65+
if not subdependencies:
66+
return
67+
68+
for key, current_version in subdependencies.items():
69+
if key.endswith("_version"):
70+
# Extract crate name from the key (remove _version suffix)
71+
crate_name = key.replace("_version", "").replace("_", "-")
72+
latest_version, latest_url = get_latest_crate_version(crate_name)
73+
74+
if latest_version and latest_version != current_version:
75+
outdated_dependencies.append({
76+
"name": f"{name}.{crate_name}",
77+
"category": "sub-dependency",
78+
"current_version": current_version,
79+
"latest_version": latest_version,
80+
"latest_release_url": latest_url,
81+
})
82+
6083
def check_releases(releases_source_file):
6184
try:
6285
with open(releases_source_file, "r") as file:
@@ -88,6 +111,10 @@ def check_releases(releases_source_file):
88111
"latest_version": latest_version,
89112
"latest_release_url": latest_url,
90113
})
114+
115+
# Check sub-dependencies for repositories
116+
if category == "repositories":
117+
check_sub_dependencies(name, info, outdated_dependencies)
91118

92119
return outdated_dependencies
93120

.github/workflows/check-llms.yml

Lines changed: 8 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,13 @@
1-
name: Validate llms.txt
1+
name: Validate llms-full.txt
22

33
on:
44
pull_request:
5-
branches:
6-
- master
5+
branches: [master]
76

87
jobs:
9-
check-llms:
10-
runs-on: ubuntu-latest
11-
12-
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v3
15-
16-
- name: Set up Python
17-
uses: actions/setup-python@v4
18-
with:
19-
python-version: '3.x'
20-
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install pyyaml requests
25-
26-
- name: Get SHA256 hash of the PR's llms.txt file
27-
id: pr_llms_hash
28-
run: |
29-
if [ -f "llms.txt" ]; then
30-
# Calculate SHA256 hash of the llms.txt file in the PR branch (checked out by default)
31-
sha256sum llms.txt | awk '{ print $1 }' > pr_sha256.txt
32-
else
33-
echo "0000" > pr_sha256.txt
34-
fi
35-
cat pr_sha256.txt
36-
37-
- name: Generate llms.txt using the Python script
38-
run: python3 scripts/generate_llms.py
39-
40-
- name: Calculate SHA256 hash of the generated llms.txt
41-
id: generated_llms_hash
42-
run: |
43-
# Full path to the generated llms.txt file
44-
llms_file="/home/runner/work/polkadot-docs/polkadot-docs/llms.txt"
45-
46-
# Check if the file exists before calculating the hash
47-
if [ -f "$llms_file" ]; then
48-
sha256sum "$llms_file" | awk '{ print $1 }' > generated_sha256.txt
49-
else
50-
echo "Error: llms.txt not found at $llms_file"
51-
exit 1
52-
fi
53-
cat generated_sha256.txt
54-
55-
- name: Compare the SHA256 hashes
56-
run: |
57-
generated_hash=$(cat generated_sha256.txt)
58-
pr_hash=$(cat pr_sha256.txt)
59-
60-
if [ "$generated_hash" != "$pr_hash" ]; then
61-
echo "Error: SHA256 hashes do not match. The generated llms.txt file differs from the one in the PR."
62-
echo "You need to run the generate LLMS script:"
63-
echo "python3 scripts/generate_llms.py"
64-
exit 1
65-
else
66-
echo "SHA256 hashes match. The llms.txt file is consistent."
67-
fi
8+
validate:
9+
uses: papermoonio/workflows/.github/workflows/validate-llms.yml@main
10+
with:
11+
llms_filename: "llms-full.txt"
12+
generator_command: "python3 scripts/generate_llms.py"
13+
require_pr_file: false

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
22
.vscode
33
target
4-
.DS_Store
4+
.DS_Store
5+
scripts/__pycache__/*

0 commit comments

Comments
 (0)