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    pub(crate) mod visit;
11}
12mod utils {
13    #[cfg(feature = "highlight")]
14    pub(crate) mod ansi {
15        pub(crate) mod palette;
16        pub(crate) mod parse;
17    }
18    pub(crate) mod builder {
19        pub(crate) mod convert;
20        pub(crate) mod dom;
21        pub(crate) mod feed;
22        pub(crate) mod formatting;
23        pub(crate) mod modes;
24        pub(crate) mod parser;
25    }
26    pub(crate) mod converter {
27        pub(crate) mod state;
28        pub(crate) mod store;
29        pub(crate) mod wrap;
30    }
31    #[cfg(feature = "highlight")]
32    pub(crate) mod notation {
33        pub(crate) mod apply;
34        pub(crate) mod parse;
35    }
36    pub(crate) mod tokenizer {
37        pub(crate) mod entity;
38        pub(crate) mod machine;
39        pub(crate) mod preprocess;
40    }
41}
42mod actions {
43    pub(crate) mod a {
44        pub(crate) mod convert;
45    }
46    pub(crate) mod attribute {
47        pub(crate) mod read;
48        pub(crate) mod remove;
49        pub(crate) mod write;
50    }
51    #[cfg(feature = "highlight")]
52    pub(crate) mod ansi {
53        pub(crate) mod tokenize;
54    }
55    pub(crate) mod base {
56        pub(crate) mod convert;
57    }
58    pub(crate) mod blockquote {
59        pub(crate) mod convert;
60    }
61    pub(crate) mod br {
62        pub(crate) mod convert;
63    }
64    pub(crate) mod code {
65        pub(crate) mod convert;
66        #[cfg(feature = "highlight")]
67        pub(crate) mod decorate;
68        #[cfg(feature = "highlight")]
69        pub(crate) mod highlight;
70        #[cfg(feature = "highlight")]
71        pub(crate) mod tokenize;
72        #[cfg(feature = "highlight")]
73        pub(crate) mod transform;
74    }
75    pub(crate) mod comment {
76        pub(crate) mod convert;
77    }
78    pub(crate) mod del {
79        pub(crate) mod convert;
80    }
81    pub(crate) mod dl {
82        pub(crate) mod convert;
83    }
84    pub(crate) mod em {
85        pub(crate) mod convert;
86    }
87    pub(crate) mod hast {
88        pub(crate) mod autolink;
89        pub(crate) mod bridge;
90        pub(crate) mod convert;
91        pub(crate) mod external;
92        pub(crate) mod format;
93        pub(crate) mod gemoji;
94        #[cfg(feature = "highlight")]
95        pub(crate) mod highlight;
96        pub(crate) mod linkify;
97        pub(crate) mod math;
98        pub(crate) mod minify;
99        pub(crate) mod path;
100        pub(crate) mod raw;
101        pub(crate) mod sanitize;
102        pub(crate) mod slug;
103        pub(crate) mod stringify;
104        pub(crate) mod toc;
105        #[cfg(feature = "katex")]
106        pub(crate) mod typeset;
107        pub(crate) mod unwrap;
108        pub(crate) mod visit;
109    }
110    pub(crate) mod heading {
111        pub(crate) mod convert;
112    }
113    pub(crate) mod hr {
114        pub(crate) mod convert;
115    }
116    pub(crate) mod html {
117        pub(crate) mod parse;
118    }
119    pub(crate) mod iframe {
120        pub(crate) mod convert;
121    }
122    pub(crate) mod img {
123        pub(crate) mod convert;
124    }
125    pub(crate) mod inline_code {
126        pub(crate) mod convert;
127    }
128    pub(crate) mod input {
129        pub(crate) mod convert;
130    }
131    pub(crate) mod li {
132        pub(crate) mod convert;
133    }
134    pub(crate) mod list {
135        pub(crate) mod convert;
136    }
137    pub(crate) mod math {
138        pub(crate) mod convert;
139        #[cfg(feature = "katex")]
140        pub(crate) mod typeset;
141    }
142    pub(crate) mod media {
143        pub(crate) mod convert;
144    }
145    pub(crate) mod p {
146        pub(crate) mod convert;
147    }
148    pub(crate) mod q {
149        pub(crate) mod convert;
150    }
151    pub(crate) mod root {
152        pub(crate) mod convert;
153    }
154    pub(crate) mod select {
155        pub(crate) mod convert;
156    }
157    pub(crate) mod strong {
158        pub(crate) mod convert;
159    }
160    pub(crate) mod table {
161        pub(crate) mod convert;
162    }
163    pub(crate) mod table_cell {
164        pub(crate) mod convert;
165    }
166    pub(crate) mod table_row {
167        pub(crate) mod convert;
168    }
169    pub(crate) mod text {
170        pub(crate) mod convert;
171    }
172    pub(crate) mod textarea {
173        pub(crate) mod convert;
174    }
175    #[cfg(feature = "highlight")]
176    pub(crate) mod theme {
177        pub(crate) mod resolve;
178    }
179    pub(crate) mod unknown {
180        pub(crate) mod convert;
181    }
182    pub(crate) mod wbr {
183        pub(crate) mod convert;
184    }
185}
186mod helpers {
187    pub(crate) mod doctype;
188    pub(crate) mod entities;
189    pub(crate) mod foreign;
190    pub(crate) mod omission;
191    pub(crate) mod phrasing;
192    pub(crate) mod property;
193    pub(crate) mod prose;
194    pub(crate) mod reason;
195    #[cfg(feature = "highlight")]
196    pub(crate) mod registry;
197    pub(crate) mod schema;
198    pub(crate) mod selected;
199    pub(crate) mod tag;
200    pub(crate) mod text;
201    #[cfg(feature = "highlight")]
202    pub(crate) mod theme_table;
203    pub(crate) mod value;
204}
205mod plugins {
206    pub(crate) mod external_links {
207        pub(crate) mod plugin;
208    }
209    pub(crate) mod extract_toc {
210        pub(crate) mod plugin;
211    }
212    pub(crate) mod format {
213        pub(crate) mod plugin;
214    }
215    pub(crate) mod gemoji {
216        pub(crate) mod plugin;
217    }
218    pub(crate) mod linkify {
219        pub(crate) mod plugin;
220    }
221    pub(crate) mod math {
222        pub(crate) mod plugin;
223    }
224    #[cfg(feature = "highlight")]
225    pub(crate) mod highlight {
226        pub(crate) mod plugin;
227    }
228    #[cfg(feature = "katex")]
229    pub(crate) mod katex {
230        pub(crate) mod plugin;
231    }
232    pub(crate) mod parse {
233        pub(crate) mod plugin;
234    }
235    pub(crate) mod path_rewrite {
236        pub(crate) mod plugin;
237    }
238    pub(crate) mod raw {
239        pub(crate) mod plugin;
240    }
241    pub(crate) mod sanitize {
242        pub(crate) mod plugin;
243    }
244    pub(crate) mod slug {
245        pub(crate) mod plugin;
246    }
247    pub(crate) mod stringify {
248        pub(crate) mod plugin;
249    }
250    pub(crate) mod to_markdown {
251        pub(crate) mod plugin;
252    }
253    pub(crate) mod to_natural_language {
254        pub(crate) mod plugin;
255    }
256    pub(crate) mod unwrap_images {
257        pub(crate) mod plugin;
258    }
259}
260
261// models
262pub use models::options::{
263    AttributeDefinition, Autolink, AutolinkBehavior, AutolinkOptions, Classes,
264    ColorReplacement, ConfiguredTransformer, ExternalLinks, ExtractToc, Format, Gemoji,
265    Highlight, HighlightTransformer, Indent, InlineCode, Katex, KatexOutput, KatexStrict,
266    KatexStrictMode, LineMark, Linkify, Math, Minify, MinifyOptions, PROSE_IGNORE, Parse,
267    PathRewrite, Primitive, Raw, Sanitize, Slug, Stringify, TagNames, ToMarkdown, Tokens,
268    TransformerName,
269};
270
271// actions
272pub use actions::attribute::read::read_attribute;
273pub use actions::attribute::remove::remove_attribute;
274pub use actions::attribute::write::write_attribute;
275pub use actions::hast::bridge::bridge_hast;
276pub use actions::hast::convert::convert_hast;
277pub use actions::hast::external::mark_external_links;
278pub use actions::hast::format::format_hast;
279pub use actions::hast::gemoji::replace_shortcodes;
280#[cfg(feature = "highlight")]
281pub use actions::hast::highlight::highlight_hast;
282pub use actions::hast::linkify::link_urls;
283pub use actions::hast::math::mark_math;
284pub use actions::hast::path::rewrite_paths;
285pub use actions::hast::raw::raw_hast;
286pub use actions::hast::sanitize::sanitize_hast;
287pub use actions::hast::slug::slug_hast;
288pub use actions::hast::stringify::stringify_hast;
289pub use actions::hast::toc::extract_toc;
290#[cfg(feature = "katex")]
291pub use actions::hast::typeset::typeset_hast;
292pub use actions::hast::unwrap::unwrap_images;
293pub use actions::hast::visit::visit_elements;
294pub use actions::html::parse::parse_html;
295pub use helpers::text::read_text;
296pub use models::visit::Visit;
297
298// plugins
299pub use plugins::to_natural_language::plugin::ToNaturalLanguage;
300pub use plugins::unwrap_images::plugin::UnwrapImages;