Skip to content
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

polkadot-sdk-docs: Use command_macro! #6194

Open
kianenigma opened this issue Oct 23, 2024 · 7 comments
Open

polkadot-sdk-docs: Use command_macro! #6194

kianenigma opened this issue Oct 23, 2024 · 7 comments
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. T11-documentation This PR/Issue is related to documentation.

Comments

@kianenigma
Copy link
Contributor

kianenigma commented Oct 23, 2024

to have a better docify version of commands. IN other words, find all instances of #[docify::export] process:Command, and replace with https://github.com/krdln/command-macros.

@kianenigma kianenigma added the T11-documentation This PR/Issue is related to documentation. label Oct 23, 2024
@kianenigma kianenigma mentioned this issue Oct 23, 2024
2 tasks
@kianenigma kianenigma added C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. labels Oct 23, 2024
@programskillforverification
Copy link
Contributor

What do you think of replacing with https://github.com/rust-shell-script/rust_cmd_lib? command_macro! hasn't been maintained for a long time.

@kianenigma
Copy link
Contributor Author

If it delivers the same outcome, then yes it indeed seems better.

@iulianbarbu
Copy link
Contributor

Adding some context from my investigations around testing commands that appear in crate-level docs, so that they also look similar to what one would run in a shell: #5954 (comment).

@bennethxyz
Copy link

Taking this one ☝️

@michalkucharczyk
Copy link
Contributor

michalkucharczyk commented Nov 15, 2024

Taking this one ☝️

Great! This is a good reference entry point showing how to do it:

<!-- docify::embed!("tests/test.rs", cmd_create_default) -->

@ndkazu
Copy link
Contributor

ndkazu commented Nov 23, 2024

to have a better docify version of commands. IN other words, find all instances of #[docify::export] process:Command, and replace with https://github.com/krdln/command-macros.

Let me re-frame this to see if I correctly understand the assignment:

  • Within all tests using #[docify::export], select those using process:Command, and replace the use of process:Command by command_macro!.
    Is that right?
    See the corresponding PR: polkadot-sdk-docs: Use command_macro! #6624

@ndkazu
Copy link
Contributor

ndkazu commented Nov 23, 2024

I would like to add that I also tried using cmd_lib instead of command_macro!, but I also get a crate related error in this case 😞

Compiling chain-spec-guide-runtime v0.0.0 (/home/kazu/Polkadot/polkadot-sdk/docs/sdk/src/reference_docs/chain_spec_runtime)
  error[E0433]: failed to resolve: could not find `unix` in `os`
    --> /home/kazu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/os_pipe-1.2.1/src/unix.rs:6:14
     |
  6  | use std::os::unix::prelude::*;
     |              ^^^^ could not find `unix` in `os`
     |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. T11-documentation This PR/Issue is related to documentation.
Projects
None yet
Development

No branches or pull requests

6 participants