项目作者: w3f

项目描述 :
The source of truth for Polkadot.
高级语言: JavaScript
项目地址: git://github.com/w3f/polkadot-wiki.git
创建时间: 2019-08-26T16:38:48Z
项目社区:https://github.com/w3f/polkadot-wiki

开源协议:GNU General Public License v3.0

下载





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.

Running Locally

  • Make sure python (Python 3.12+), pip and mkdocs are installed and configured in your path
  • It’s recommended to use a virtual environment, as is common practice
  • Ensure you are in the polkadot-wiki directory
  1. Install dependencies

    1. pip install -r requirements.txt
  2. Once installed, run the serve command:

    1. # Set ENABLE_RPC to true if you plan to work with RPC macros
    2. ENABLE_RPC=false mkdocs serve

Build

🟣 Building the Polkadot Wiki:

  1. # Set ENABLE_RPC to true if you plan to work with RPC macros
  2. ENABLE_RPC=false mkdocs build

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 production deployment.

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

After these jobs are successfully completed, the CICD production workflow will automatically deploy
prod to the public site when the PR is merged to master: 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:
  1. def rpc(network, module, call, default_value, is_constant=False, readable="")
  1. Example Usage:
  1. ## Number of Nominators
  2. {{ 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.