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

add rust doc generation

parent 1b39ab2a
No related branches found
No related tags found
1 merge request!254Refac generated documentation
...@@ -30,3 +30,4 @@ tmp ...@@ -30,3 +30,4 @@ tmp
# Autogenerated docs # Autogenerated docs
docs/api/runtime*.md docs/api/runtime*.md
docs/api/doc
...@@ -21,6 +21,7 @@ use scale_info::form::PortableForm; ...@@ -21,6 +21,7 @@ use scale_info::form::PortableForm;
use serde::Serialize; use serde::Serialize;
use std::collections::HashMap; use std::collections::HashMap;
use std::path::Path; use std::path::Path;
use std::process::Command;
use std::{ use std::{
fs::File, fs::File,
io::{Read, Write}, io::{Read, Write},
...@@ -319,6 +320,24 @@ pub(super) fn gen_doc() -> Result<()> { ...@@ -319,6 +320,24 @@ pub(super) fn gen_doc() -> Result<()> {
file.write_all(error_doc.as_bytes()) file.write_all(error_doc.as_bytes())
.with_context(|| format!("Failed to write to file '{}'", ERRORS_DOC_FILEPATH))?; .with_context(|| format!("Failed to write to file '{}'", ERRORS_DOC_FILEPATH))?;
// 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");
// Organise folder for deployment
Command::new("cp")
.args(["-r", "./target/doc", "./docs/api/"])
.status()
.expect("failed to build docs folder");
Ok(()) Ok(())
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment