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 decorate;
62        #[cfg(feature = "highlight")]
63        pub(crate) mod highlight;
64        #[cfg(feature = "highlight")]
65        pub(crate) mod tokenize;
66        #[cfg(feature = "highlight")]
67        pub(crate) mod transform;
68    }
69    pub(crate) mod comment {
70        pub(crate) mod convert;
71    }
72    pub(crate) mod del {
73        pub(crate) mod convert;
74    }
75    pub(crate) mod dl {
76        pub(crate) mod convert;
77    }
78    pub(crate) mod em {
79        pub(crate) mod convert;
80    }
81    pub(crate) mod hast {
82        pub(crate) mod bridge;
83        pub(crate) mod convert;
84        pub(crate) mod external;
85        pub(crate) mod format;
86        #[cfg(feature = "highlight")]
87        pub(crate) mod highlight;
88        pub(crate) mod minify;
89        pub(crate) mod raw;
90        pub(crate) mod sanitize;
91        pub(crate) mod slug;
92        pub(crate) mod stringify;
93        pub(crate) mod toc;
94        #[cfg(feature = "katex")]
95        pub(crate) mod typeset;
96        pub(crate) mod unwrap;
97    }
98    pub(crate) mod heading {
99        pub(crate) mod convert;
100    }
101    pub(crate) mod hr {
102        pub(crate) mod convert;
103    }
104    pub(crate) mod html {
105        pub(crate) mod parse;
106    }
107    pub(crate) mod iframe {
108        pub(crate) mod convert;
109    }
110    pub(crate) mod img {
111        pub(crate) mod convert;
112    }
113    pub(crate) mod inline_code {
114        pub(crate) mod convert;
115    }
116    pub(crate) mod input {
117        pub(crate) mod convert;
118    }
119    pub(crate) mod li {
120        pub(crate) mod convert;
121    }
122    pub(crate) mod list {
123        pub(crate) mod convert;
124    }
125    #[cfg(feature = "katex")]
126    pub(crate) mod math {
127        pub(crate) mod typeset;
128    }
129    pub(crate) mod media {
130        pub(crate) mod convert;
131    }
132    pub(crate) mod p {
133        pub(crate) mod convert;
134    }
135    pub(crate) mod q {
136        pub(crate) mod convert;
137    }
138    pub(crate) mod root {
139        pub(crate) mod convert;
140    }
141    pub(crate) mod select {
142        pub(crate) mod convert;
143    }
144    pub(crate) mod strong {
145        pub(crate) mod convert;
146    }
147    pub(crate) mod table {
148        pub(crate) mod convert;
149    }
150    pub(crate) mod table_cell {
151        pub(crate) mod convert;
152    }
153    pub(crate) mod table_row {
154        pub(crate) mod convert;
155    }
156    pub(crate) mod text {
157        pub(crate) mod convert;
158    }
159    pub(crate) mod textarea {
160        pub(crate) mod convert;
161    }
162    #[cfg(feature = "highlight")]
163    pub(crate) mod theme {
164        pub(crate) mod resolve;
165    }
166    pub(crate) mod unknown {
167        pub(crate) mod convert;
168    }
169    pub(crate) mod wbr {
170        pub(crate) mod convert;
171    }
172}
173mod helpers {
174    pub(crate) mod doctype;
175    pub(crate) mod entities;
176    pub(crate) mod foreign;
177    pub(crate) mod omission;
178    pub(crate) mod phrasing;
179    pub(crate) mod property;
180    pub(crate) mod reason;
181    #[cfg(feature = "highlight")]
182    pub(crate) mod registry;
183    pub(crate) mod schema;
184    pub(crate) mod selected;
185    pub(crate) mod tag;
186    pub(crate) mod text;
187    #[cfg(feature = "highlight")]
188    pub(crate) mod theme_table;
189    pub(crate) mod value;
190}
191mod plugins {
192    pub(crate) mod external_links {
193        pub(crate) mod plugin;
194    }
195    pub(crate) mod extract_toc {
196        pub(crate) mod plugin;
197    }
198    pub(crate) mod format {
199        pub(crate) mod plugin;
200    }
201    #[cfg(feature = "highlight")]
202    pub(crate) mod highlight {
203        pub(crate) mod plugin;
204    }
205    #[cfg(feature = "katex")]
206    pub(crate) mod katex {
207        pub(crate) mod plugin;
208    }
209    pub(crate) mod parse {
210        pub(crate) mod plugin;
211    }
212    pub(crate) mod raw {
213        pub(crate) mod plugin;
214    }
215    pub(crate) mod sanitize {
216        pub(crate) mod plugin;
217    }
218    pub(crate) mod slug {
219        pub(crate) mod plugin;
220    }
221    pub(crate) mod stringify {
222        pub(crate) mod plugin;
223    }
224    pub(crate) mod to_markdown {
225        pub(crate) mod plugin;
226    }
227    pub(crate) mod to_natural_language {
228        pub(crate) mod plugin;
229    }
230    pub(crate) mod unwrap_images {
231        pub(crate) mod plugin;
232    }
233}
234
235// models
236pub use models::options::{
237    AttributeDefinition, Classes, ColorReplacement, ConfiguredTransformer, ExternalLinks,
238    ExtractToc, Format, Highlight, HighlightTransformer, Indent, InlineCode, Katex,
239    KatexOutput, KatexStrict, KatexStrictMode, Parse, Primitive, Raw, Sanitize, Slug,
240    Stringify, ToMarkdown, Tokens, TransformerName,
241};
242
243// actions
244pub use actions::hast::bridge::bridge_hast;
245pub use actions::hast::convert::convert_hast;
246pub use actions::hast::external::mark_external_links;
247pub use actions::hast::format::format_hast;
248#[cfg(feature = "highlight")]
249pub use actions::hast::highlight::highlight_hast;
250pub use actions::hast::raw::raw_hast;
251pub use actions::hast::sanitize::sanitize_hast;
252pub use actions::hast::slug::slug_hast;
253pub use actions::hast::stringify::stringify_hast;
254pub use actions::hast::toc::extract_toc;
255#[cfg(feature = "katex")]
256pub use actions::hast::typeset::typeset_hast;
257pub use actions::hast::unwrap::unwrap_images;
258pub use actions::html::parse::parse_html;
259
260// plugins
261pub use plugins::to_natural_language::plugin::ToNaturalLanguage;
262pub use plugins::unwrap_images::plugin::UnwrapImages;