mirror of
https://github.com/Nutomic/ibis.git
synced 2025-02-04 19:54:41 +00:00
Rename file toc.rs
This commit is contained in:
parent
15b580c65d
commit
5e010fbb28
3 changed files with 5 additions and 5 deletions
|
@ -8,8 +8,7 @@ use crate::common::{
|
||||||
};
|
};
|
||||||
use http::{Method, StatusCode};
|
use http::{Method, StatusCode};
|
||||||
use leptos::{prelude::ServerFnError, server_fn::error::NoCustomError};
|
use leptos::{prelude::ServerFnError, server_fn::error::NoCustomError};
|
||||||
use log::error;
|
use log::{error, info};
|
||||||
use log::info;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::{fmt::Debug, sync::LazyLock};
|
use std::{fmt::Debug, sync::LazyLock};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
|
@ -7,10 +7,11 @@ use markdown_it::{
|
||||||
};
|
};
|
||||||
use math_equation::MathEquationScanner;
|
use math_equation::MathEquationScanner;
|
||||||
use std::sync::OnceLock;
|
use std::sync::OnceLock;
|
||||||
|
use table_of_contents::{TocMarkerScanner, TocScanner};
|
||||||
|
|
||||||
pub mod article_link;
|
pub mod article_link;
|
||||||
pub mod math_equation;
|
pub mod math_equation;
|
||||||
pub mod toc;
|
pub mod table_of_contents;
|
||||||
|
|
||||||
pub fn render_markdown(text: &str) -> String {
|
pub fn render_markdown(text: &str) -> String {
|
||||||
static INSTANCE: OnceLock<MarkdownIt> = OnceLock::new();
|
static INSTANCE: OnceLock<MarkdownIt> = OnceLock::new();
|
||||||
|
@ -77,8 +78,8 @@ fn markdown_parser() -> MarkdownIt {
|
||||||
// Ibis custom extensions
|
// Ibis custom extensions
|
||||||
parser.inline.add_rule::<ArticleLinkScanner>();
|
parser.inline.add_rule::<ArticleLinkScanner>();
|
||||||
parser.inline.add_rule::<MathEquationScanner>();
|
parser.inline.add_rule::<MathEquationScanner>();
|
||||||
parser.inline.add_rule::<toc::TocMarkerScanner>();
|
parser.inline.add_rule::<TocMarkerScanner>();
|
||||||
parser.add_rule::<toc::TocScanner>();
|
parser.add_rule::<TocScanner>();
|
||||||
|
|
||||||
parser
|
parser
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue