Moved docs/src/main.rs to docs/src/lib.rs and imported it into the repl. Commented out doc code to avoid it deleting my entire roc project (which happened)

This commit is contained in:
Chadtech 2021-03-21 22:37:39 -04:00
parent 22f77ed966
commit 807250f3e3
7 changed files with 324 additions and 321 deletions

View file

@ -8,11 +8,12 @@ use roc_build::link::LinkType;
use roc_gen::llvm::build::OptLevel;
use roc_load::file::LoadingProblem;
use std::io;
use std::path::Path;
use std::path::{Path, PathBuf};
use std::process;
use std::process::Command;
use target_lexicon::Triple;
pub mod build;
pub mod repl;
@ -76,6 +77,36 @@ pub fn build_app<'a>() -> App<'a> {
.help("(optional) The directory or files to open on launch.")
)
)
.subcommand(
App::new("docs")
.about("Generate documentation for Roc modules")
.arg(Arg::with_name(DIRECTORY_OR_FILES)
.index(1)
.multiple(true)
.required(true)
.help("The directory or files to build documentation for")
)
)
}
pub fn docs(files: Vec<PathBuf>) {
roc_docs::generate(
files,
// vec![
// PathBuf::from(r"./compiler/builtins/docs/Bool.roc"),
// // PathBuf::from(r"../compiler/builtins/docs/Dict.roc"),
// // Not working
// // PathBuf::from(r"../compiler/builtins/docs/List.roc"),
// // Not working
// // PathBuf::from(r"../compiler/builtins/docs/Num.roc"),
// // PathBuf::from(r"../compiler/builtins/docs/Set.roc"),
// // PathBuf::from(r"../compiler/builtins/docs/Str.roc"),
// ],
roc_builtins::std::standard_stdlib(),
Path::new("./"),
// Path::new("./build"),
)
}
pub fn build(target: &Triple, matches: &ArgMatches, run_after_build: bool) -> io::Result<()> {