diff --git a/benches/bench_html.rs b/benches/bench_html.rs index 30d8254c..bd243f14 100644 --- a/benches/bench_html.rs +++ b/benches/bench_html.rs @@ -4,7 +4,7 @@ extern crate criterion; use criterion::{black_box, Criterion}; -use ssg::html::generate_html; +use ssg::modules::html::generate_html; pub fn bench_generate_html(c: &mut Criterion) { let content = "## Hello, world!\n\nThis is a test."; diff --git a/src/compiler.rs b/src/compiler.rs index 263f11e1..db15e5c4 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -6,13 +6,13 @@ use crate::{ data::{FileData, RssData, MetaTagGroups}, file::add, frontmatter::extract, - html::generate_html, human::create_human_data, json::{cname, human, sitemap, tags, txt}, keywords::extract_keywords, macro_cleanup_directories, macro_create_directories, macro_metadata_option,macro_set_rss_data_fields, manifest::create_manifest_data, + modules::html::generate_html, modules::metatags::generate_all_meta_tags, modules::rss::generate_rss, navigation::generate_navigation, diff --git a/src/lib.rs b/src/lib.rs index a5eee7b8..3815bc34 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -176,8 +176,6 @@ pub mod utilities; pub mod file; /// The `frontmatter` module extracts the front matter from files. pub mod frontmatter; -/// The `html` module generates the HTML content. -pub mod html; /// The `human` module generates the human-readable content. pub mod human; /// The `json` module generates the JSON content. diff --git a/src/html.rs b/src/modules/html.rs similarity index 99% rename from src/html.rs rename to src/modules/html.rs index 15cb9210..95417082 100644 --- a/src/html.rs +++ b/src/modules/html.rs @@ -34,7 +34,7 @@ use std::collections::HashMap; /// /// ``` /// -/// use ssg::html::generate_html; +/// use ssg::modules::html::generate_html; /// /// let content = "## Hello, world!\n\nThis is a test."; /// let title = "My Page"; diff --git a/src/modules/mod.rs b/src/modules/mod.rs index 1d2c6cea..4e45df1e 100644 --- a/src/modules/mod.rs +++ b/src/modules/mod.rs @@ -2,8 +2,12 @@ // Copyright © 2023 Shokunin Static Site Generator. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT +/// The `html` module contains functions for generating HTML. +pub mod html; + /// The `metatags` module contains functions for generating meta tags. pub mod metatags; /// The `rss` module contains functions for generating RSS feeds. pub mod rss; + diff --git a/tests/test_compiler.rs b/tests/test_compiler.rs index dbab1058..103c4cb0 100644 --- a/tests/test_compiler.rs +++ b/tests/test_compiler.rs @@ -3,7 +3,8 @@ mod tests { use std::error::Error; use ssg::{ - data::RssData, frontmatter::extract, html::generate_html, + data::RssData, frontmatter::extract, + modules::html::generate_html, modules::rss::generate_rss, }; diff --git a/tests/test_html.rs b/tests/test_html.rs index 88765773..b9d3880b 100644 --- a/tests/test_html.rs +++ b/tests/test_html.rs @@ -2,7 +2,8 @@ mod tests { use regex::Regex; use ssg::{ - html::generate_html, utilities::format_header_with_id_class, + utilities::format_header_with_id_class, + modules::html::generate_html, }; #[test]