Skip to content

Commit

Permalink
Move developer-hub to polkadot-sdk-docs (#2598)
Browse files Browse the repository at this point in the history
This PR is a continuation of
#2102 and part of an
initiative started here https://hackmd.io/@romanp/rJ318ZCEp
What has been done:
- The content under `docs/*` (with the exception of `docs/mermaid`) has
been moved to `docs/contributor/`
- Developer Hub has been renamed to Polkadot SDK Docs, and the crate has
been renamed from `developer-hub` to `polkadot-sdk-docs`
- The content under `developer-hub/*` has been moved to `docs/sdk`

---
Original PR #2565, it has
been close due to too many rebase conflicts

---------

Co-authored-by: Serban Iorga <serban@parity.io>
Co-authored-by: Chevdor <chevdor@users.noreply.github.com>
Co-authored-by: Egor_P <egor@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
  • Loading branch information
5 people authored Dec 5, 2023
1 parent 2f9af78 commit a310df2
Show file tree
Hide file tree
Showing 67 changed files with 153 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-prdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR: ${{ github.event.pull_request.number }}
ENGINE: docker
PRDOC_DOC: https://github.com/paritytech/polkadot-sdk/blob/master/docs/prdoc.md
PRDOC_DOC: https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/prdoc.md

jobs:
check-prdoc:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ bin/node-template/Cargo.lock
nohup.out
polkadot_argument_parsing
polkadot.*
!docs/sdk/src/polkadot_sdk/polkadot.rs
pwasm-alloc/Cargo.lock
pwasm-libc/Cargo.lock
release-artifacts
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ build-rustdoc:
find "$path" -name '*.html' | xargs -I {} -P "$(nproc)" bash -c 'process_file "$@"' _ {}
}
inject_simple_analytics "./crate-docs"
- echo "<meta http-equiv=refresh content=0;url=developer_hub/index.html>" > ./crate-docs/index.html
- echo "<meta http-equiv=refresh content=0;url=polkadot_sdk_docs/index.html>" > ./crate-docs/index.html

build-implementers-guide:
stage: build
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ node-bench-regression-guard:
after_script: [""]

# if this fails run `bot update-ui` in the Pull Request or "./scripts/update-ui-tests.sh" locally
# see ./docs/CONTRIBUTING.md#ui-tests
# see ./docs/contributor/CONTRIBUTING.md#ui-tests
test-frame-ui:
stage: test
extends:
Expand Down
78 changes: 39 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ members = [
"cumulus/test/runtime",
"cumulus/test/service",
"cumulus/xcm/xcm-emulator",
"developer-hub",
"docs/sdk",
"polkadot",
"polkadot/cli",
"polkadot/core-primitives",
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ Below are the primary upstream dependencies utilized in this project:

## Security

The security policy and procedures can be found in [docs/SECURITY.md](./docs/SECURITY.md).
The security policy and procedures can be found in [docs/contributor/SECURITY.md](./docs/contributor/SECURITY.md).

## Contributing & Code of Conduct

Ensure you follow our [contribution guidelines](./docs/CONTRIBUTING.md). In every interaction and contribution, this
project adheres to the [Contributor Covenant Code of Conduct](./docs/CODE_OF_CONDUCT.md).
Ensure you follow our [contribution guidelines](./docs/contributor/CONTRIBUTING.md). In every interaction and
contribution, this project adheres to the [Contributor Covenant Code of Conduct](./docs/contributor/CODE_OF_CONDUCT.md).

## Additional Resources

Expand Down
6 changes: 3 additions & 3 deletions cumulus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This repository contains both the Cumulus SDK and also specific chains implemented on top of this SDK.

If you only want to run a **Polkadot Parachain Node**, check out our [container section](./docs/container.md).
If you only want to run a **Polkadot Parachain Node**, check out our [container section](./docs/contributor/container.md).

## Cumulus SDK

Expand Down Expand Up @@ -34,7 +34,7 @@ A Polkadot [collator](https://wiki.polkadot.network/docs/en/learn-collator) for
`polkadot-parachain` binary (previously called `polkadot-collator`).

You may run `polkadot-parachain` locally after building it or using one of the container option described
[here](./docs/container.md).
[here](./docs/contributor/container.md).

### Relay Chain Interaction
To operate a parachain node, a connection to the corresponding relay chain is necessary. This can be achieved in one of
Expand Down Expand Up @@ -242,7 +242,7 @@ Once the executable is built, launch collators for each parachain (repeat once e
./target/release/polkadot-parachain --chain $CHAIN --validator
```

You can also build [using a container](./docs/container.md).
You can also build [using a container](./docs/contributor/container.md).

### Parachains

Expand Down
66 changes: 0 additions & 66 deletions developer-hub/Cargo.toml

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ We also need [https://docs.substrate.io/](https://docs.substrate.io/) to be upda

## Announce the deprecation and removal

**At minimum they should be noted in the release log.** Please see how to document a PR [here](https://github.com/paritytech/polkadot-sdk/blob/master/docs/CONTRIBUTING.md#documentation).
**At minimum they should be noted in the release log.** Please see how to document a PR [here](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md#documentation).
There you can give instructions based on the audience and tell them what they need to do to upgrade the code.

Some breaking changes have a bigger impact than others. When the impact is big the release note is not enough, though
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
✄ -----------------------------------------------------------------------------

Thank you for your Pull Request! 🙏 Please make sure it follows the contribution guidelines outlined in
[this document](https://github.com/paritytech/polkadot-sdk/blob/master/docs/CONTRIBUTING.md) and fill
[this document](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md) and fill
out the sections below. Once you're ready to submit your PR for review, please
delete this section and leave only the text under the "Description" heading.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/mermaid/IA.mmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flowchart
parity[paritytech.github.io] --> devhub[developer_hub]
parity[paritytech.github.io] --> devhub[polkadot_sdk_docs]

devhub --> polkadot_sdk
devhub --> reference_docs
Expand Down
66 changes: 66 additions & 0 deletions docs/sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[package]
name = "polkadot-sdk-docs"
description = "The one stop shop for developers of the polakdot-sdk"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "paritytech.github.io"
repository.workspace = true
authors.workspace = true
edition.workspace = true
# This crate is not publish-able to crates.io for now because of docify.
publish = false
version = "0.0.1"

[dependencies]
# Needed for all FRAME-based code
parity-scale-codec = { version = "3.0.0", default-features = false }
scale-info = { version = "2.6.0", default-features = false }
frame = { path = "../../substrate/frame", features = ["experimental", "runtime"] }
pallet-examples = { path = "../../substrate/frame/examples" }
pallet-default-config-example = { path = "../../substrate/frame/examples/default-config" }

# How we build docs in rust-docs
simple-mermaid = { git = "https://github.com/kianenigma/simple-mermaid.git", branch = "main" }
docify = "0.2.6"

# Polkadot SDK deps, typically all should only be scope such that we can link to their doc item.
node-cli = { package = "staging-node-cli", path = "../../substrate/bin/node/cli" }
kitchensink-runtime = { path = "../../substrate/bin/node/runtime" }
chain-spec-builder = { package = "staging-chain-spec-builder", path = "../../substrate/bin/utils/chain-spec-builder" }
subkey = { path = "../../substrate/bin/utils/subkey" }

# Substrate
sc-network = { path = "../../substrate/client/network" }
sc-rpc-api = { path = "../../substrate/client/rpc-api" }
sc-rpc = { path = "../../substrate/client/rpc" }
sc-client-db = { path = "../../substrate/client/db" }
sc-cli = { path = "../../substrate/client/cli" }
sc-consensus-aura = { path = "../../substrate/client/consensus/aura" }
sc-consensus-babe = { path = "../../substrate/client/consensus/babe" }
sc-consensus-grandpa = { path = "../../substrate/client/consensus/grandpa" }
sc-consensus-beefy = { path = "../../substrate/client/consensus/beefy" }
sc-consensus-manual-seal = { path = "../../substrate/client/consensus/manual-seal" }
sc-consensus-pow = { path = "../../substrate/client/consensus/pow" }
substrate-wasm-builder = { path = "../../substrate/utils/wasm-builder" }

# Cumulus
cumulus-pallet-aura-ext = { path = "../../cumulus/pallets/aura-ext" }
cumulus-pallet-parachain-system = { path = "../../cumulus/pallets/parachain-system", features = [
"parameterized-consensus-hook",
] }
parachain-info = { package = "staging-parachain-info", path = "../../cumulus/parachains/pallets/parachain-info" }
pallet-aura = { path = "../../substrate/frame/aura", default-features = false }
pallet-timestamp = { path = "../../substrate/frame/timestamp" }

# Primitives
sp-io = { path = "../../substrate/primitives/io" }
sp-api = { path = "../../substrate/primitives/api" }
sp-core = { path = "../../substrate/primitives/core" }
sp-keyring = { path = "../../substrate/primitives/keyring" }
sp-runtime = { path = "../../substrate/primitives/runtime" }

[dev-dependencies]
parity-scale-codec = "3.6.5"
scale-info = "2.9.0"

[features]
experimental = ["pallet-aura/experimental"]
8 changes: 4 additions & 4 deletions developer-hub/headers/toc.html → docs/sdk/headers/toc.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script>
window.addEventListener("DOMContentLoaded", (event) => {
// if the crate is one that starts with `developer_hub`
// if the crate is one that starts with `polkadot_sdk_docs`
let crate_name = document.querySelector("#main-content > div > h1 > a:nth-child(1)");
if (!crate_name.textContent.startsWith("developer_hub")) {
console.log("skipping -- not `developer_hub`");
if (!crate_name.textContent.startsWith("polkadot_sdk_docs")) {
console.log("skipping -- not `polkadot_sdk_docs`");
return;
}

let sidebar = document.querySelector(".sidebar");
let headers = document.querySelectorAll("#main-content h2, #main-content h3, #main-content h4");
console.log(`detected developer_hub: headers: ${headers.length}`);
console.log(`detected polkadot_sdk_docs: headers: ${headers.length}`);

let toc = document.createElement("div");
toc.classList.add("table-of-contents");
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! # Polkadot Developer Hub Guides
//! # Polkadot SDK Docs Guides
//!
//! This crate contains a collection of guides that are foundational to the developers of
//! Polkadot SDK. They common user-journeys that are traversed in the Polkadot ecosystem.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@
//! signature of the function: it takes a generic `T::RuntimeOrigin` and returns a
//! `Result<T::AccountId, _>`. So by the end of this function call, we know that this dispatchable
//! was signed by `who`.
#![doc = docify::embed!("../substrate/frame/system/src/lib.rs", ensure_signed)]
#![doc = docify::embed!("../../substrate/frame/system/src/lib.rs", ensure_signed)]
//!
//!
//! - Where does `mutate`, `get` and `insert` and other storage APIs come from? All of them are
//! explained in the corresponding `type`, for example, for `Balances::<T>::insert`, you can look
//! into [`frame::prelude::StorageMap::insert`].
//!
//! - The return type of all dispatchable functions is [`frame::prelude::DispatchResult`]:
#![doc = docify::embed!("../substrate/frame/support/src/dispatch.rs", DispatchResult)]
#![doc = docify::embed!("../../substrate/frame/support/src/dispatch.rs", DispatchResult)]
//!
//! Which is more or less a normal Rust `Result`, with a custom [`frame::prelude::DispatchError`] as
//! the `Err` variant. We won't cover this error in detail here, but importantly you should know
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions developer-hub/src/lib.rs → docs/sdk/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! # Developer Hub
//! # Polkadot SDK Docs
//!
//! The Polkadot SDK Developer Hub.
//! The Polkadot SDK Developer Documentation.
//!
//! This crate is a *minimal*, but *always-accurate* source of information for those wishing to
//! build on the Polkadot SDK.
Expand All @@ -22,7 +22,7 @@
//! ## Information Architecture
//!
//! This section paints a picture over the high-level information architecture of this crate.
#![doc = simple_mermaid::mermaid!("../../docs/mermaid/IA.mmd")]
#![doc = simple_mermaid::mermaid!("../../mermaid/IA.mmd")]
#![allow(rustdoc::invalid_html_tags)] // TODO: remove later. https://github.com/paritytech/polkadot-sdk-docs/issues/65
#![allow(rustdoc::bare_urls)] // TODO: remove later. https://github.com/paritytech/polkadot-sdk-docs/issues/65
#![warn(rustdoc::broken_intra_doc_links)]
Expand Down
Loading

0 comments on commit a310df2

Please sign in to comment.