mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 09:31:12 +00:00
Fix Mermaid diagram rendering (#3875)
Closes https://github.com/paritytech/polkadot-sdk/issues/2977 The issue appears to stem from the `aquamarine` crate failing to render diagrams in re-exported crates. e.g. as raised [here](https://github.com/paritytech/polkadot-sdk/issues/2977), diagrams would render at `frame_support::traits::Hooks` but not the re-exported doc `frame::traits::Hooks`, even if I added `aquamarine` as a `frame` crate dependency. To resolve this, I followed advice in https://github.com/mersinvald/aquamarine/issues/20 to instead render mermaid diagrams directly using JS by adding an `after-content.js`. --- Also fixes compile warnings, enables `--all-features` and disallows future warnings in CI. --------- Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -91,7 +91,7 @@ build-rustdoc:
|
||||
- .run-immediately
|
||||
variables:
|
||||
SKIP_WASM_BUILD: 1
|
||||
RUSTDOCFLAGS: "--default-theme=ayu --html-in-header ./docs/sdk/headers/header.html --extend-css ./docs/sdk/headers/theme.css"
|
||||
RUSTDOCFLAGS: "-Dwarnings --default-theme=ayu --html-in-header ./docs/sdk/assets/header.html --extend-css ./docs/sdk/assets/theme.css --html-after-content ./docs/sdk/assets/after-content.html"
|
||||
artifacts:
|
||||
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
|
||||
when: on_success
|
||||
@@ -99,8 +99,7 @@ build-rustdoc:
|
||||
paths:
|
||||
- ./crate-docs/
|
||||
script:
|
||||
# FIXME: it fails with `RUSTDOCFLAGS="-Dwarnings"` and `--all-features`
|
||||
- time cargo doc --features try-runtime,experimental --workspace --no-deps
|
||||
- time cargo doc --all-features --workspace --no-deps
|
||||
- rm -f ./target/doc/.lock
|
||||
- mv ./target/doc ./crate-docs
|
||||
# Inject Simple Analytics (https://www.simpleanalytics.com/) privacy preserving tracker into
|
||||
|
||||
@@ -34,7 +34,7 @@ pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Pu
|
||||
.public()
|
||||
}
|
||||
|
||||
/// The extensions for the [`ChainSpec`](crate::ChainSpec).
|
||||
/// The extensions for the [`ChainSpec`].
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Extensions {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
<script> mermaid.init({ startOnLoad: true, theme: "dark" }, "pre.language-mermaid > code");</script>
|
||||
|
||||
@@ -84,6 +84,8 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||
|
||||
<style>
|
||||
body.sdk-docs {
|
||||
nav.side-bar {
|
||||
@@ -0,0 +1,11 @@
|
||||
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
|
||||
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json
|
||||
|
||||
title: Fix Mermaid diagram rendering
|
||||
|
||||
doc:
|
||||
- audience: Runtime Dev
|
||||
description: |
|
||||
Fixes the rendering of some Mermaid diagrams in the documentation.
|
||||
|
||||
crates: [ ]
|
||||
@@ -18,8 +18,7 @@
|
||||
//! # Assets Pallet
|
||||
//!
|
||||
//! A simple, secure module for dealing with sets of assets implementing
|
||||
//! [`fungible`](frame_support::traits::fungible) traits, via
|
||||
//! [`fungibles`](frame_support::traits::fungibles) traits.
|
||||
//! [`fungible`](frame_support::traits::fungible) traits, via [`fungibles`] traits.
|
||||
//!
|
||||
//! The pallet makes heavy use of concepts such as Holds and Freezes from the
|
||||
//! [`frame_support::traits::fungible`] traits, therefore you should read and understand those docs
|
||||
|
||||
Reference in New Issue
Block a user