Skip to content
Snippets Groups Projects
Unverified Commit b71f715b authored by bgallois's avatar bgallois
Browse files

move runtime api doc to target artefact

parent 6520a174
No related branches found
No related tags found
1 merge request!254Refac generated documentation
This diff is collapsed.
......@@ -21,7 +21,6 @@
- [docs](./docs/)
- [api](./docs/api/)
- [manual](./docs/api/manual.md)
- [runtime-calls](./docs/api/runtime-calls.md) the calls you can submit through the RPC API
- [dev](./docs/dev/)
- [beginner-walkthrough](./docs/dev/beginner-walkthrough.md)
- [git-conventions](./docs/dev/git-conventions.md)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -43,9 +43,9 @@ where
// consts
const CALLS_DOC_FILEPATH: &str = "docs/api/runtime-calls.md";
const EVENTS_DOC_FILEPATH: &str = "docs/api/runtime-events.md";
const ERRORS_DOC_FILEPATH: &str = "docs/api/runtime-errors.md";
const CALLS_DOC_FILEPATH: &str = "target/doc/runtime-calls.md";
const EVENTS_DOC_FILEPATH: &str = "target/doc/runtime-events.md";
const ERRORS_DOC_FILEPATH: &str = "target/doc/runtime-errors.md";
const TEMPLATES_GLOB: &str = "xtask/res/templates/*.md";
const WEIGHT_FILEPATH: &str = "runtime/common/src/weights/";
......@@ -311,6 +311,18 @@ pub(super) fn gen_doc() -> Result<()> {
let (call_doc, event_doc, error_doc) = print_runtime(runtime);
// Generate docs from rust code
Command::new("cargo")
.args([
"doc",
"--workspace",
"--no-deps",
"--document-private-items",
"--features=runtime-benchmarks",
])
.status()
.expect("cargo doc failed to execute");
let mut file = File::create(CALLS_DOC_FILEPATH)
.with_context(|| format!("Failed to create file '{}'", CALLS_DOC_FILEPATH))?;
file.write_all(call_doc.as_bytes())
......@@ -324,23 +336,6 @@ pub(super) fn gen_doc() -> Result<()> {
file.write_all(error_doc.as_bytes())
.with_context(|| format!("Failed to write to file '{}'", ERRORS_DOC_FILEPATH))?;
// Generate docs from rust code
Command::new("cargo")
.args([
"doc",
"--workspace",
"--document-private-items",
"--features=runtime-benchmarks",
])
.status()
.expect("cargo doc failed to execute");
// Organise folder for deployment
Command::new("cp")
.args(["-r", "./target/doc", "./docs/api/"])
.status()
.expect("failed to build docs folder");
Ok(())
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment