-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add documentation around FRAME Origin #3362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
1ffe06c
add origin related articles
kianenigma bb3dffe
make it build
kianenigma 39fac87
add macro docs as well
kianenigma c863d75
add diagram
kianenigma acad0ea
fix mmd path
kianenigma 8d047fb
Master.into()
kianenigma 552ba03
Apply suggestions from code review
kianenigma 26a9dfa
prettify the docs page a bit
kianenigma e2a24bc
Merge branch 'kiz-origin-docs' of github.com:paritytech/polkadot-sdk …
kianenigma f71e3a7
fmt
kianenigma 0fc5df9
fmt agian
kianenigma 9ae0336
Merge branch 'master' into kiz-origin-docs
kianenigma ba1d800
Apply suggestions from code review
kianenigma e5bcfef
fix
kianenigma 83a936f
Merge branch 'master' of github.com:paritytech/polkadot-sdk into kiz-…
kianenigma bc00706
Update docs/sdk/src/reference_docs/mod.rs
kianenigma b817e84
fmt
kianenigma e9746a9
Merge branch 'kiz-origin-docs' of github.com:paritytech/polkadot-sdk …
kianenigma 1c90dba
Merge branch 'master' into kiz-origin-docs
kianenigma 6cd3f4d
Merge branch 'master' into kiz-origin-docs
kianenigma c09b833
Update docs/sdk/src/reference_docs/frame_origin.rs
kianenigma 95ccf8e
Update docs/sdk/src/reference_docs/mod.rs
kianenigma 4e18167
Update docs/sdk/src/reference_docs/frame_origin.rs
kianenigma 7e99fb8
Update docs/sdk/src/reference_docs/frame_origin.rs
kianenigma 51feebe
Merge branch 'master' into kiz-origin-docs
kianenigma 86750f3
Merge branch 'master' into kiz-origin-docs
kianenigma 4d60745
fix test
kianenigma f300f0b
fmt
kianenigma bd52990
try and fix rustdocs build
kianenigma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| flowchart LR | ||
| RuntimeCall --"TryInto"--> PalletCall | ||
| PalletCall --"Into"--> RuntimeCall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| <script> | ||
| function createToC() { | ||
| let sidebar = document.querySelector(".sidebar"); | ||
| let headers = document.querySelectorAll("#main-content h2, #main-content h3, #main-content h4"); | ||
| console.log(`detected polkadot_sdk_docs: headers: ${headers.length}`); | ||
|
|
||
| let toc = document.createElement("div"); | ||
| toc.classList.add("sidebar-table-of-contents"); | ||
| toc.appendChild(document.createElement("h2").appendChild(document.createTextNode("Table of Contents")).parentNode); | ||
|
|
||
| let modules = document.querySelectorAll("main .item-table a.mod"); | ||
|
|
||
| // the first two headers are always junk | ||
| headers.forEach(header => { | ||
| let link = document.createElement("a"); | ||
| link.href = "#" + header.id; | ||
| link.textContent = header.textContent; | ||
| link.className = header.tagName.toLowerCase(); | ||
|
|
||
| toc.appendChild(link); | ||
|
|
||
| if (header.id == "modules" && header.textContent == "Modules") { | ||
| modules.forEach(module => { | ||
| let link = document.createElement("a"); | ||
| link.href = module.href; | ||
| link.textContent = module.textContent; | ||
| link.className = "h3"; | ||
|
|
||
| toc.appendChild(link); | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| // insert toc as the second child in sidebar | ||
| let sidebar_children = sidebar.children; | ||
| if (sidebar_children.length > 1) { | ||
| sidebar.insertBefore(toc, sidebar_children[1]); | ||
| } else { | ||
| sidebar.appendChild(toc); | ||
| } | ||
| } | ||
|
|
||
| function hideSidebarElements() { | ||
| // Create the 'Expand for More' button | ||
| var expandButton = document.createElement('button'); | ||
| expandButton.innerText = 'Expand More Items'; | ||
| expandButton.classList.add('expand-button'); | ||
|
|
||
| // Insert the button at the top of the sidebar or before the '.sidebar-elems' | ||
| var sidebarElems = document.querySelector('.sidebar-elems'); | ||
| sidebarElems.parentNode.insertBefore(expandButton, sidebarElems); | ||
|
|
||
| // Initially hide the '.sidebar-elems' | ||
| sidebarElems.style.display = 'none'; | ||
|
|
||
| // Add click event listener to the button | ||
| expandButton.addEventListener('click', function() { | ||
| // Toggle the display of the '.sidebar-elems' | ||
| if (sidebarElems.style.display === 'none') { | ||
| sidebarElems.style.display = 'block'; | ||
| expandButton.innerText = 'Collapse'; | ||
| } else { | ||
| sidebarElems.style.display = 'none'; | ||
| expandButton.innerText = 'Expand for More'; | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| window.addEventListener("DOMContentLoaded", (event) => { | ||
| // 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("polkadot_sdk_docs")) { | ||
| console.log("skipping -- not `polkadot_sdk_docs`"); | ||
| return; | ||
| } | ||
|
|
||
| createToC(); | ||
| hideSidebarElements(); | ||
|
|
||
| console.log("updating page based on being `polkadot_sdk_docs` crate"); | ||
| }); | ||
| </script> | ||
|
|
||
| <style> | ||
|
|
||
| nav.side-bar { | ||
| width: 300px; | ||
| } | ||
|
|
||
| .sidebar-table-of-contents { | ||
| margin-bottom: 1em; | ||
| padding: 0.5em; | ||
| } | ||
|
|
||
| .sidebar-table-of-contents a { | ||
| display: block; | ||
| margin: 0.2em 0; | ||
| } | ||
|
|
||
| .sidebar-table-of-contents .h2 { | ||
| font-weight: bold; | ||
| margin-left: 0; | ||
| } | ||
|
|
||
| .sidebar-table-of-contents .h3 { | ||
| margin-left: 1em; | ||
| } | ||
|
|
||
| .sidebar-table-of-contents .h4 { | ||
| margin-left: 2em; | ||
| } | ||
|
|
||
| .sidebar h2.location { | ||
| display: none; | ||
| } | ||
|
|
||
| .sidebar-elems { | ||
| display: none; | ||
| } | ||
|
|
||
| /* Center the 'Expand for More' button */ | ||
| .expand-button { | ||
| display: inline-block; /* Use inline-block for sizing */ | ||
| margin: 10px auto; /* Auto margins for horizontal centering */ | ||
| padding: 5px 10px; | ||
| background-color: #007bff; | ||
| color: white; | ||
| text-align: center; | ||
| cursor: pointer; | ||
| border: none; | ||
| border-radius: 5px; | ||
| width: auto; | ||
| /* Centering the button within its parent container */ | ||
| position: relative; | ||
| left: 50%; | ||
| transform: translateX(-50%); | ||
| } | ||
|
|
||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| :root { | ||
| --polkadot-pink: #E6007A ; | ||
| --polkadot-green: #56F39A ; | ||
| --polkadot-lime: #D3FF33 ; | ||
| --polkadot-cyan: #00B2FF ; | ||
| --polkadot-purple: #552BBF ; | ||
| } | ||
|
|
||
| body > nav.sidebar > div.sidebar-crate > a > img { | ||
| /* logo width, given that the sidebar width is 200px; */ | ||
| width: 190px; | ||
| } | ||
|
|
||
| body nav.sidebar { | ||
| flex: 0 0 250px; | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.