Skip to content

Commit

Permalink
fix(shokunin): moving html.rs to the modules directory
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienrousseau committed Sep 3, 2023
1 parent e4b57c1 commit 590cadd
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion benches/bench_html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down
2 changes: 1 addition & 1 deletion src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/html.rs → src/modules/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 4 additions & 0 deletions src/modules/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

3 changes: 2 additions & 1 deletion tests/test_compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
3 changes: 2 additions & 1 deletion tests/test_html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 590cadd

Please sign in to comment.