Skip to content
Snippets Groups Projects

Refac generated documentation

Merged Benjamin Gallois requested to merge 183-refac-doc into master
2 files
+ 20
0
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 19
0
@@ -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(())
}
}
Loading