5 个版本
0.1.4 | 2024年7月9日 |
---|---|
0.1.3 | 2024年4月11日 |
0.1.2 | 2023年12月26日 |
0.1.1 | 2023年7月1日 |
0.1.0 | 2023年4月18日 |
#2167 in 网页编程
715KB
18K SLoC
encre-css-typography
一个插件,提供一系列您可以使用来为任何不受您控制的纯 HTML 添加美观的排版默认值的
prose
类,例如从 Markdown 渲染的 HTML 或从 CMS 拉取的 HTML。
入门指南
要将 encre-css-typography
集成到 encre-css
,请在您的 Cargo.toml
中添加它
[dependencies]
encre-css-typography = "0.1.3"
然后,使用对 Config
结构的可变引用调用 register
函数
use encre_css::Config;
let mut config = Config::from_file("encre-css.toml")?;
// Or let mut config = Config::default();
encre_css_typography::register(&mut config);
let _css = encre_css::generate(
[r#"<div class="prose prose-headings:text-blue-500 prose-slate lg:prose-lg dark:prose-invert"></div>"#],
&config,
);
// Do something with the CSS
lib.rs
:
为不受您控制的 HTML 定义美观的排版默认值。
依赖关系
~0.9–1.6MB
~33K SLoC