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

add rust doc generation

parent e4f12024
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !254. Comments created here will be created in the context of that merge request.
...@@ -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.
Finish editing this message first!
Please register or to comment