more doc comments
This commit is contained in:
parent
9b6c43a951
commit
061611d09d
|
@ -1,3 +1,5 @@
|
||||||
|
#![warn(missing_docs)]
|
||||||
|
|
||||||
//! # nyf
|
//! # nyf
|
||||||
//!
|
//!
|
||||||
//! _glyph's static site generator_
|
//! _glyph's static site generator_
|
||||||
|
@ -20,7 +22,7 @@
|
||||||
//! `./site` directory (preserving the sub-directory structure). The contents of the `<h2>`
|
//! `./site` directory (preserving the sub-directory structure). The contents of the `<h2>`
|
||||||
//! element are spliced into the `[[ title ]]` tag of the base HTML template for each
|
//! element are spliced into the `[[ title ]]` tag of the base HTML template for each
|
||||||
//! sub-directory template.
|
//! sub-directory template.
|
||||||
//!
|
|
||||||
use std::{fs, io, path::Path};
|
use std::{fs, io, path::Path};
|
||||||
|
|
||||||
// define the path for the template directory
|
// define the path for the template directory
|
||||||
|
@ -28,6 +30,7 @@ const TEMPLATE_DIR: &str = "./templates";
|
||||||
// define the path for the generated site output
|
// define the path for the generated site output
|
||||||
const SITE_DIR: &str = "./site";
|
const SITE_DIR: &str = "./site";
|
||||||
|
|
||||||
|
/// Run (with the) `nyf`.
|
||||||
pub fn run() -> Result<(), &'static str> {
|
pub fn run() -> Result<(), &'static str> {
|
||||||
// read the base html template to a string
|
// read the base html template to a string
|
||||||
let base = format!("{}/base.html", TEMPLATE_DIR);
|
let base = format!("{}/base.html", TEMPLATE_DIR);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
use std::process;
|
use std::process;
|
||||||
|
|
||||||
|
/// Begin the `nyf` run. Catch any application errors, print them to `stderr` and return an error
|
||||||
|
/// exit code (`1`).
|
||||||
fn main() {
|
fn main() {
|
||||||
if let Err(e) = nyf::run() {
|
if let Err(e) = nyf::run() {
|
||||||
eprintln!("{}", e);
|
eprintln!("{}", e);
|
||||||
|
|
Loading…
Reference in New Issue