Skip to content

Commit

Permalink
Fixes doc links for procedural crate (#5023)
Browse files Browse the repository at this point in the history
This PR fixes the documentation for FRAME Macros when pointed from
`polkadot_sdk_docs` crate. This is achieved by referring to the examples
in the `procedural` crate, embedded via `docify`.

---------

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
  • Loading branch information
gupnik and kianenigma authored Jul 22, 2024
1 parent 623b68e commit d0d8e29
Show file tree
Hide file tree
Showing 9 changed files with 877 additions and 147 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

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

31 changes: 30 additions & 1 deletion substrate/frame/support/procedural/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ proc-macro = true

[dependencies]
derive-syn-parse = { workspace = true }
docify = { workspace = true }
Inflector = { workspace = true }
cfg-expr = { workspace = true }
itertools = { workspace = true }
Expand All @@ -32,14 +33,42 @@ expander = { workspace = true }
sp-crypto-hashing = { workspace = true }

[dev-dependencies]
codec = { features = [
"derive",
"max-encoded-len",
], workspace = true }
regex = { workspace = true }
sp-metadata-ir = { workspace = true }
scale-info = { features = ["derive"], workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { features = [
"serde",
], workspace = true }
frame-system = { workspace = true }
frame-support = { workspace = true }
pretty_assertions = { workspace = true }
static_assertions = { workspace = true }

[features]
default = ["std"]
std = ["sp-crypto-hashing/std"]
std = [
"codec/std",
"frame-support/std",
"frame-system/std",
"scale-info/std",
"sp-core/std",
"sp-crypto-hashing/std",
"sp-io/std",
"sp-metadata-ir/std",
"sp-runtime/std",
]
no-metadata-docs = []
experimental = []
# Generate impl-trait for tuples with the given number of tuples. Will be needed as the number of
# pallets in a runtime grows. Does increase the compile time!
tuples-96 = []
tuples-128 = []

[[example]]
name = "proc_main"
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#[cfg(test)]
use super::{Config, Runtime};
#[cfg(test)]
use crate::{derive_impl, pallet_prelude::inject_runtime_type};
#[cfg(test)]
use static_assertions::assert_type_eq_all;

#[docify::export]
Expand Down
Loading

0 comments on commit d0d8e29

Please sign in to comment.