diff options
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | build.rs | 2 | ||||
-rw-r--r-- | riki.md (renamed from rikiwiki.md) | 48 | ||||
-rw-r--r-- | src/bin/riki.rs (renamed from src/bin/rikiwiki.rs) | 16 | ||||
-rw-r--r-- | subplot/riki.rs (renamed from subplot/rikiwiki.rs) | 12 | ||||
-rw-r--r-- | subplot/riki.yaml (renamed from subplot/rikiwiki.yaml) | 4 | ||||
-rw-r--r-- | tests/subplot.rs | 2 |
8 files changed, 44 insertions, 44 deletions
@@ -921,7 +921,7 @@ dependencies = [ ] [[package]] -name = "rikiwiki" +name = "riki" version = "0.1.0" dependencies = [ "anyhow", @@ -1,5 +1,5 @@ [package] -name = "rikiwiki" +name = "riki" version = "0.1.0" edition = "2021" @@ -1,4 +1,4 @@ fn main() { - subplot_build::codegen("rikiwiki.md") + subplot_build::codegen("riki.md") .expect("failed to generate code with Subplot"); } @@ -1,20 +1,20 @@ --- -title: rikiwiki statis site generator +title: riki statis site generator subtitle: Subset of ikiwiki rewritten in Rust bindings: -- subplot/rikiwiki.yaml +- subplot/riki.yaml - lib/files.yaml - lib/runcmd.yaml impls: rust: - - subplot/rikiwiki.rs + - subplot/riki.rs ... [ikiwiki]: http://ikiwiki.info/ # Introduction -`rikiwiki` is a small subset of [ikiwiki][] rewritten in Rust, for +`riki` is a small subset of [ikiwiki][] rewritten in Rust, for speed. # Verification scenarios @@ -27,9 +27,9 @@ _Requirement: Given an empty input Markdown file, the output must be an empty HTML file._ ~~~scenario -given an installed rikiwiki +given an installed riki given file site/empty.mdwn from empty -when I run rikiwiki site output +when I run riki site output then AST of site/empty.mdwn matches that of output/empty.html ~~~ @@ -43,9 +43,9 @@ _Requirement: Given a Markdown file with plain text, the output must be an HTML file with the same text, without extra elements._ ~~~scenario -given an installed rikiwiki +given an installed riki given file site/page.mdwn from para -when I run rikiwiki site output +when I run riki site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -63,9 +63,9 @@ _Requirement: Given a Markdown file with an indented code block, the output must have a pre element. ~~~scenario -given an installed rikiwiki +given an installed riki given file site/page.mdwn from indented-code -when I run rikiwiki site output +when I run riki site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -81,9 +81,9 @@ _Requirement: Given a Markdown file with a fenced code block, the output must have a pre element. ~~~scenario -given an installed rikiwiki +given an installed riki given file site/page.mdwn from fenced-code -when I run rikiwiki site output +when I run riki site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -102,9 +102,9 @@ _Requirement: Given a Markdown file linking to an image, the output must have an img element. ~~~scenario -given an installed rikiwiki +given an installed riki given file site/page.mdwn from image-link -when I run rikiwiki site output +when I run riki site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -119,9 +119,9 @@ _Requirement: Inline markup for emphasis must result in an em element in HTML output._ ~~~scenario -given an installed rikiwiki +given an installed riki given file site/page.mdwn from emph -when I run rikiwiki site output +when I run riki site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -136,9 +136,9 @@ _Requirement: Inline markup for strong emphasis must result in a strong element in HTML output._ ~~~scenario -given an installed rikiwiki +given an installed riki given file site/page.mdwn from strong -when I run rikiwiki site output +when I run riki site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -153,9 +153,9 @@ _Requirement: Inline markup for strike through must result in a del element in HTML output._ ~~~scenario -given an installed rikiwiki +given an installed riki given file site/page.mdwn from strike -when I run rikiwiki site output +when I run riki site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -170,9 +170,9 @@ _Requirement: Given a Markdown file with top level heading, the output must be an HTML file with one h1 element, without extra elements._ ~~~scenario -given an installed rikiwiki +given an installed riki given file site/page.mdwn from h1 -when I run rikiwiki site output +when I run riki site output then AST of site/page.mdwn matches that of output/page.html ~~~ @@ -187,9 +187,9 @@ _Requirement: Inline code markup with backticks must result in a code element in HTML output._ ~~~scenario -given an installed rikiwiki +given an installed riki given file site/page.mdwn from backticks -when I run rikiwiki site output +when I run riki site output then AST of site/page.mdwn matches that of output/page.html ~~~ diff --git a/src/bin/rikiwiki.rs b/src/bin/riki.rs index 0a0d287..0c08cb6 100644 --- a/src/bin/rikiwiki.rs +++ b/src/bin/riki.rs @@ -1,15 +1,15 @@ use log::{debug, error, info}; -use rikiwiki::html::{Content, HtmlPage}; -use rikiwiki::parse::parse; -use rikiwiki::wikitext::WikiPage; -use rikiwiki::Site; -use rikiwiki::SiteError; +use riki::html::{Content, HtmlPage}; +use riki::parse::parse; +use riki::wikitext::WikiPage; +use riki::Site; +use riki::SiteError; use std::error::Error; use std::fs::read; use std::path::PathBuf; use structopt::StructOpt; -const ENVLOG: &str = "RIKIWIKI_LOG"; +const ENVLOG: &str = "RIKI_LOG"; #[derive(StructOpt)] struct Opt { @@ -36,7 +36,7 @@ fn real_main() -> Result<(), SiteError> { } pretty_env_logger::init_custom_env(ENVLOG); - info!("rikiwiki starts"); + info!("riki starts"); let opt = Opt::from_args(); let srcdir = opt @@ -82,6 +82,6 @@ fn real_main() -> Result<(), SiteError> { } } - info!("rikiwiki ends OK"); + info!("riki ends OK"); Ok(()) } diff --git a/subplot/rikiwiki.rs b/subplot/riki.rs index f6aea97..2b9cb7e 100644 --- a/subplot/rikiwiki.rs +++ b/subplot/riki.rs @@ -5,11 +5,11 @@ use subplotlib::steplibrary::datadir::Datadir; #[step] #[context(Runcmd)] -fn install_rikiwiki(context: &ScenarioContext) { - // The RIKIWIKI_DIR variable can be set to test an installed - // rikiwiki rather than the one built from the source tree. - if let Some(bindir) = std::env::var_os("RIKIWIKI_DIR") { - println!("Found RIKIWIKI_DIR environment variable, using that"); +fn install_riki(context: &ScenarioContext) { + // The RIKI_DIR variable can be set to test an installed riki + // rather than the one built from the source tree. + if let Some(bindir) = std::env::var_os("RIKI_DIR") { + println!("Found RIKI_DIR environment variable, using that"); context.with_mut( |rc: &mut Runcmd| { rc.prepend_to_path(bindir); @@ -18,7 +18,7 @@ fn install_rikiwiki(context: &ScenarioContext) { false, )?; } else { - let target_exe = env!("CARGO_BIN_EXE_rikiwiki"); + let target_exe = env!("CARGO_BIN_EXE_riki"); let target_path = Path::new(target_exe); let target_path = target_path.parent().ok_or("No parent?")?; diff --git a/subplot/rikiwiki.yaml b/subplot/riki.yaml index 15181af..a95ec57 100644 --- a/subplot/rikiwiki.yaml +++ b/subplot/riki.yaml @@ -1,7 +1,7 @@ -- given: "an installed rikiwiki" +- given: "an installed riki" impl: rust: - function: install_rikiwiki + function: install_riki - then: "AST of {first} matches that of {second}" impl: diff --git a/tests/subplot.rs b/tests/subplot.rs index 7916728..e930b00 100644 --- a/tests/subplot.rs +++ b/tests/subplot.rs @@ -1 +1 @@ -include!(concat!(env!("OUT_DIR"), "/rikiwiki.rs")); +include!(concat!(env!("OUT_DIR"), "/riki.rs")); |