Skip to content

A staging/experimental repository for migrating the Polkadot Wiki from Docusaurus to Mkdocs

Notifications You must be signed in to change notification settings

w3f/polkadot-wiki-mkdocs

Repository files navigation

Polkadot Wiki

The Source of Truth for Polkadot


GPLv3 license made-with-Markdown PRs Welcome


The Polkadot Wiki is the central source of truth for Polkadot. It is a community-focused initiative led by Web3 Foundation to keep an up-to-date resource on the best information for learning, building, or maintaining on Polkadot.

Contributing to Documentation

The Technical Education team at Web3 Foundation are the primary maintainers of the Wiki and will review all issues and pull requests created on this repository. If you notice typos or grammatical errors, please feel free to create pull requests with these corrections directly. Larger contributions may start as issues to test the waters on the subject with the maintainers. It is generally preferable to create a pull request over an issue to propose a change to the Wiki content.

The Wiki belongs to the community, help generate its identity.

identity.mp4

📥 There will be an upcoming initiative that will promote and encourage contributions towards Polkadot-based content and documentation. In the meantime, feel free to share any ideas or feedback you may have for the Wiki by opening a Feature Request issue.

Keep engaged by checking out these common Polkadot ecosystem resources.

Running Locally

  • Make sure python (Python 3.12) and pip are installed and in your path
  • It's recommended to use a virtual environment, as is common practice
  1. Enter a virtual environment:
# Create the env
python -m venv venv
# Enter the env
source venv/bin/activate
  1. Install dependencies (make sure you're in the project's directory)
pip install -r requirements.txt
  1. Once installed, run the serve command:
# If you're in a virtual env (set to false if you're not editing RPC commands, otherwise it will take time to load)
ENABLE_RPC=false mkdocs serve
# If you're not in a virtual env
python -m mkdocs build

Build

🟣 Building the Polkadot Wiki:

# If you're in a virtual env (set to false if you're not editing RPC commands, otherwise it will take time to load)
ENABLE_RPC=false mkdocs build
# If you're not in a virtual env
python -m mkdocs build

Style and Configuration Guide

Use the style guide from the Substrate Knowledge Base

Formatting

See the Conditional Rendering and Mkdocs Macros sections for additional details regarding how to properly format syntax for elements outside of the standard markdown library.

Automation

Deployments

The Polkadot Wiki is built in a CI job, where it is then deployed on Netlify. Each commit to master triggers a new build and subsequent deployment.

Pull request previews are enabled, meaning a temporary deployment via Netlify is generated per PR.

After these jobs are completed, the CICD production workflow will automatically deploy prod to the public site: Polkadot Wiki.

GitHub Actions

Job Description Frequency
Audit Links Test all links in the docs for broken references and opens a new issue displaying results if any are found. Monthly or Workflow Dispatch
Code QL Analysis Tests for vulnerabilities across the codebase Weekly, Push to master or Pull Request to master
Dependabot Helps keep packages up-to-date with latest release. Daily
Build and Deploy to Netlify Builds and deploys the site to Netlify. If it is a PR, it generates a preview. If it is a push to master, it will deploy on the production URL.
Status Badges Update the commit history of various open source projects in the ecosystem. Weekly or Workflow Dispatch

Conditional Rendering

The Polkadot Wiki does not support conditional rendering. If needed, represent multiple chains (i.e, Polkadot and Kusama) using the tab layout specified here on the Mkdocs Material documentation.

Mkdocs Macros

Mkdocs macros allow the use of Jinja2 templates and custom Python functions to allow for custom data fetching and rendering within Mkdocs. All current macros can be found in: macros/.

RPC Macro Example

For example, the rpc macro can be used in the following manner, with each field representing the input for the function signature respectively.

  1. rpc macro function signature:
def rpc(network, module, call, default_value, is_constant=False, readable="")
  1. Example Usage:
## Number of Nominators
{{ rpc("polkadot", "Staking", "CounterForNominators", 36793, is_constant=false) }}
  1. Different types of readable, depending on usage and network:
    • Percentage
    • Human Readable / Human Readable Kusama (rounds to nearest 100)
    • Blocks to days (converts blocks to days)
    • Precise DOT / KSM (returns an unrounded number with full precision)

Internationalization

❗ The Wiki is currently being reorganized and updated. Work will resume on translations after the Wiki revamp is completed.

License

The Polkadot Wiki is licensed under the GPL-3.0 free software license.

About

A staging/experimental repository for migrating the Polkadot Wiki from Docusaurus to Mkdocs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published