Giter Site home page Giter Site logo

agryaznov / polkadot-wiki Goto Github PK

View Code? Open in Web Editor NEW

This project forked from w3f/polkadot-wiki

0.0 0.0 0.0 332.87 MB

The source of truth for Polkadot.

License: GNU General Public License v3.0

JavaScript 97.37% Ruby 0.08% CSS 2.54% Shell 0.01%

polkadot-wiki's Introduction

GPLv3 license made-with-Markdown PRs Welcome Polkadot Prod Kusama Prod

Polkadot Wiki Kusama Guide

Polkadot Wiki

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 Wiki is an open source project and we will review all issues and pull-requests created in this repository. If you notice typos or grammatical errors, please feel free to directly create pull requests with these corrections.

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

Both the Polkadot Wiki and the Kusama Guide are built from the source files in this repository. After cloning the source locally, you can start the websites with each of these respective commands (ensure you run yarn at the root of the repository first to install dependencies):

The site is built using Docusaurus: you may need to install Docusaurus before running the Wiki locally. Using yarn, run yarn upgrade @docusaurus/core@latest @docusaurus/preset-classic@latest.

# For the Polkadot Wiki:
yarn polkadot:start
# For the Kusama Guide:
yarn kusama:start

Building IPFS

  • Run yarn kusama:build
  • Run yarn polkadot:build

Running GitHub Pages

  • Run yarn kusama:publish-gh-pages
  • Run yarn polkadot:publish-gh-pages

Style Guide

Use the style guide from the Substrate Knowledge Base

Formatting

Use pretty-quick as a pre-commit formatting tool.

There is an automatic pretty-quick check that occurs pre-commit to format your changed/staged files.

To format markdown pages, run the following in the docs folder:

npx pretty-quick --staged

To run pretty on the whole project, npx pretty-quick.

Static Site Generator

The Wiki's latest version uses the Docusaurus static website generator to convert the Markdown docs into a documentation website.

Search Engine

Algolia DocSearch is the search engine that is used, which is built into Docusaurus. Indexing via Algolia provides faster lookup; the actual configuration for lookup is located in another repository that's maintained by Algolia DocSearch.

We have enabled searching on the Wiki by declaring the algolia section in the siteConfig.js file in scripts, and defining an API key and index name that are provided by DocSearch.

  algolia: {
    apiKey: "53c6a4ab0d77c0755375a971c9b7cc3d",
    indexName: "kusama_guide",
    algoliaOptions: {
      facetFilters: ["language:LANGUAGE"],
    }, // Optional, if provided by Algolia
  }

If you would like to access and modify this, you can re-submit the documentation url via DocSearch Program, where they will send a JavaScript snippet that you can re-integrate into the configuration, similar to the one shown above.

Automated Deployments

The Polkadot wiki is built on the gh-pages branch and automatically deployed to GitHub Pages. The Kusama wiki is also deployed to GitHub Pages (via a separate repository).

Development servers exist at https://staging.polkadot.network and https://staging.kusama.network. The servers will reflect the latest master commit or PR put up against the master branch by a member of the Technical Education team. The latest version of master is staged and checked by the team. If all is well, the new commits on master are transferred into the production branch,prod, by rebasing master on prod. The CICD production workflow will deploy prod to the public sites: Polkadot Wiki and Kusama Guide, respectively.

Mirror Pages

A limitation of Docusaurus is that pages can only be included in one sidebar at any given time. Thus, our Kusama section will either hijack some content it shares with the rest of the wiki, or lack that content.

To solve this, the repo mirrors some pages and includes them in additional sidebars. The scripts folder contains a mirror.js script that creates a copy of the pages to duplicate across sidebars. The new pages are prefixed with mirror and first need to be declared in mirror.js, then added to the relevant sidebar section. To run the script:

yarn mirror

Note: This command runs automatically when using polkadot:start or kusama:start development scripts, so you don't need to worry about running it manually if you start the development site with one of these commands.

Conditional Rendering

The two wikis support conditional rendering depending on which wiki is being deployed. This is useful for mirrored pages that have most content in common, but some minor differences. To use this functionality, surround Kusama specific content with {{ kusama: :kusama }}, and polkadot specific content with {{ polkadot: :polkadot }}. Example:

If the treasury ends a budget period without spending all of its funds, it suffers a burn of a
percentage of its funds -- thereby causing deflationary pressure.
{{ polkadot: This percentage is currently at 1%
on Polkadot. :polkadot }} {{ kusama: This percentage is currently 0.2% on Kusama, with the amount currently going to
[Society](https://guide.kusama.network/docs/en/maintain-guides-society-kusama) rather than being
burned. :kusama }}

To test the resolution, run polkadot:build and kusama:build, then polkadot:inject and kusama:inject, respectively. Inspect the built files in the corresponding build folder under website or kusama-guide.

Internationalization

We are using Crowdin to manage all different translations. You can go to the project page and select the language you would like to translate to start.
All translated content through Crowdin will regularly submit a pull request to this repository.

If you do not see the language you would like to translate, please let us know via Riot.

License

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

polkadot-wiki's People

Contributors

a-jwc avatar ansonla3 avatar benwhitejam avatar bustanit avatar ccris02 avatar dependabot-preview[bot] avatar dependabot[bot] avatar drw3rk avatar fgimenez avatar jakehemmerle avatar joepetrowski avatar krichard410 avatar laboon avatar lamafab avatar lsaether avatar majellah avatar michalisfr avatar midegdugarova avatar nam-hle avatar noc2 avatar nukemandan avatar polkadot-wiki-deploy avatar rmnprkrl avatar salmad3 avatar suragsheth avatar swader avatar w3fbot avatar web3foundation avatar whitesunset avatar wpank avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.