Skip to main content

textlane_html/
lib.rs

1//! Textlane's HTML plugins: parsing, hast transforms, sanitizing and serializing.
2
3mod models {
4    #[cfg(feature = "highlight")]
5    pub(crate) mod highlight;
6    pub(crate) mod namespace;
7    pub(crate) mod options;
8    pub(crate) mod parse_error;
9    pub(crate) mod token;
10}
11mod utils {
12    #[cfg(feature = "highlight")]
13    pub(crate) mod ansi {
14        pub(crate) mod palette;
15        pub(crate) mod parse;
16    }
17    pub(crate) mod builder {
18        pub(crate) mod convert;
19        pub(crate) mod dom;
20        pub(crate) mod feed;
21        pub(crate) mod formatting;
22        pub(crate) mod modes;
23        pub(crate) mod parser;
24    }
25    pub(crate) mod converter {
26        pub(crate) mod state;
27        pub(crate) mod store;
28        pub(crate) mod wrap;
29    }
30    #[cfg(feature = "highlight")]
31    pub(crate) mod notation {
32        pub(crate) mod apply;
33        pub(crate) mod parse;
34    }
35    pub(crate) mod tokenizer {
36        pub(crate) mod entity;
37        pub(crate) mod machine;
38        pub(crate) mod preprocess;
39    }
40}
41mod actions {
42    pub(crate) mod a {
43        pub(crate) mod convert;
44    }
45    #[cfg(feature = "highlight")]
46    pub(crate) mod ansi {
47        pub(crate) mod tokenize;
48    }
49    pub(crate) mod base {
50        pub(crate) mod convert;
51    }
52    pub(crate) mod blockquote {
53        pub(crate) mod convert;
54    }
55    pub(crate) mod br {
56        pub(crate) mod convert;
57    }
58    pub(crate) mod code {
59        pub(crate) mod convert;
60        #[cfg(feature = "highlight")]
61        pub(crate) mod highlight;
62        #[cfg(feature = "highlight")]
63        pub(crate) mod tokenize;
64        #[cfg(feature = "highlight")]
65        pub(crate) mod transform;
66    }
67    pub(crate) mod comment {
68        pub(crate) mod convert;
69    }
70    pub(crate) mod del {
71        pub(crate) mod convert;
72    }
73    pub(crate) mod dl {
74        pub(crate) mod convert;
75    }
76    pub(crate) mod em {
77        pub(crate) mod convert;
78    }
79    pub(crate) mod hast {
80        pub(crate) mod bridge;
81        pub(crate) mod convert;
82        pub(crate) mod external;
83        pub(crate) mod format;
84        #[cfg(feature = "highlight")]
85        pub(crate) mod highlight;
86        pub(crate) mod minify;
87        pub(crate) mod raw;
88        pub(crate) mod sanitize;
89        pub(crate) mod slug;
90        pub(crate) mod stringify;
91        pub(crate) mod toc;
92        #[cfg(feature = "katex")]
93        pub(crate) mod typeset;
94        pub(crate) mod unwrap;
95    }
96    pub(crate) mod heading {
97        pub(crate) mod convert;
98    }
99    pub(crate) mod hr {
100        pub(crate) mod convert;
101    }
102    pub(crate) mod html {
103        pub(crate) mod parse;
104    }
105    pub(crate) mod iframe {
106        pub(crate) mod convert;
107    }
108    pub(crate) mod img {
109        pub(crate) mod convert;
110    }
111    pub(crate) mod inline_code {
112        pub(crate) mod convert;
113    }
114    pub(crate) mod input {
115        pub(crate) mod convert;
116    }
117    pub(crate) mod li {
118        pub(crate) mod convert;
119    }
120    pub(crate) mod list {
121        pub(crate) mod convert;
122    }
123    #[cfg(feature = "katex")]
124    pub(crate) mod math {
125        pub(crate) mod typeset;
126    }
127    pub(crate) mod media {
128        pub(crate) mod convert;
129    }
130    pub(crate) mod p {
131        pub(crate) mod convert;
132    }
133    pub(crate) mod q {
134        pub(crate) mod convert;
135    }
136    pub(crate) mod root {
137        pub(crate) mod convert;
138    }
139    pub(crate) mod select {
140        pub(crate) mod convert;
141    }
142    pub(crate) mod strong {
143        pub(crate) mod convert;
144    }
145    pub(crate) mod table {
146        pub(crate) mod convert;
147    }
148    pub(crate) mod table_cell {
149        pub(crate) mod convert;
150    }
151    pub(crate) mod table_row {
152        pub(crate) mod convert;
153    }
154    pub(crate) mod text {
155        pub(crate) mod convert;
156    }
157    pub(crate) mod textarea {
158        pub(crate) mod convert;
159    }
160    #[cfg(feature = "highlight")]
161    pub(crate) mod theme {
162        pub(crate) mod resolve;
163    }
164    pub(crate) mod unknown {
165        pub(crate) mod convert;
166    }
167    pub(crate) mod wbr {
168        pub(crate) mod convert;
169    }
170}
171mod helpers {
172    pub(crate) mod doctype;
173    pub(crate) mod entities;
174    pub(crate) mod foreign;
175    pub(crate) mod omission;
176    pub(crate) mod phrasing;
177    pub(crate) mod property;
178    pub(crate) mod reason;
179    #[cfg(feature = "highlight")]
180    pub(crate) mod registry;
181    pub(crate) mod schema;
182    pub(crate) mod selected;
183    pub(crate) mod tag;
184    pub(crate) mod text;
185    #[cfg(feature = "highlight")]
186    pub(crate) mod theme_table;
187    pub(crate) mod value;
188}
189mod plugins {
190    pub(crate) mod external_links {
191        pub(crate) mod plugin;
192    }
193    pub(crate) mod extract_toc {
194        pub(crate) mod plugin;
195    }
196    pub(crate) mod format {
197        pub(crate) mod plugin;
198    }
199    #[cfg(feature = "highlight")]
200    pub(crate) mod highlight {
201        pub(crate) mod plugin;
202    }
203    #[cfg(feature = "katex")]
204    pub(crate) mod katex {
205        pub(crate) mod plugin;
206    }
207    pub(crate) mod parse {
208        pub(crate) mod plugin;
209    }
210    pub(crate) mod raw {
211        pub(crate) mod plugin;
212    }
213    pub(crate) mod sanitize {
214        pub(crate) mod plugin;
215    }
216    pub(crate) mod slug {
217        pub(crate) mod plugin;
218    }
219    pub(crate) mod stringify {
220        pub(crate) mod plugin;
221    }
222    pub(crate) mod to_markdown {
223        pub(crate) mod plugin;
224    }
225    pub(crate) mod to_natural_language {
226        pub(crate) mod plugin;
227    }
228    pub(crate) mod unwrap_images {
229        pub(crate) mod plugin;
230    }
231}
232
233// models
234pub use models::options::{
235    AttributeDefinition, Classes, ColorReplacement, ConfiguredTransformer, ExternalLinks,
236    Format, Highlight, HighlightTransformer, Indent, InlineCode, Katex, KatexOutput,
237    KatexStrict, KatexStrictMode, Parse, Primitive, Raw, Sanitize, Slug, Stringify,
238    ToMarkdown, Tokens, TransformerName,
239};
240
241// actions
242pub use actions::hast::bridge::bridge_hast;
243pub use actions::hast::convert::convert_hast;
244pub use actions::hast::external::mark_external_links;
245pub use actions::hast::format::format_hast;
246#[cfg(feature = "highlight")]
247pub use actions::hast::highlight::highlight_hast;
248pub use actions::hast::raw::raw_hast;
249pub use actions::hast::sanitize::sanitize_hast;
250pub use actions::hast::slug::slug_hast;
251pub use actions::hast::stringify::stringify_hast;
252pub use actions::hast::toc::extract_toc;
253#[cfg(feature = "katex")]
254pub use actions::hast::typeset::typeset_hast;
255pub use actions::hast::unwrap::unwrap_images;
256pub use actions::html::parse::parse_html;
257
258// plugins
259pub use plugins::extract_toc::plugin::ExtractToc;
260pub use plugins::to_natural_language::plugin::ToNaturalLanguage;
261pub use plugins::unwrap_images::plugin::UnwrapImages;