Skip to main content

euv_docs/
lib.rs

1//! euv-docs
2//!
3//! Cross-platform documentation viewer, static HTML/SVG generator, and
4//! multi-locale zero-JS/zero-CSS WebAssembly site builder powered by
5//! euv and euv-ui.
6
7#[cfg(not(target_arch = "wasm32"))]
8mod bundle;
9mod generator;
10mod model;
11mod parser;
12mod viewer;
13
14#[cfg(test)]
15#[path = "../tests/mod.rs"]
16mod tests;
17
18#[cfg(not(target_arch = "wasm32"))]
19pub use bundle::*;
20pub use {generator::*, model::*, parser::*, viewer::*};
21
22pub(crate) use parser::{
23    deduplicate_slug, heading_level_num, load_doc_site_excluding, section_sort_rank,
24    should_skip_dir, slugify,
25};
26
27#[cfg(target_arch = "wasm32")]
28use std::cell::{RefCell, RefMut};
29use std::{
30    borrow::Cow,
31    cell::Cell,
32    cmp::Ordering,
33    collections::{BTreeMap, BTreeSet, HashMap},
34    f32::consts::{FRAC_PI_2, PI, TAU},
35    ffi::{OsStr, OsString},
36    fmt::{self, Write},
37    fs::{self, DirEntry},
38    io::{self, Error, ErrorKind},
39    iter::Peekable,
40    mem::take,
41    path::{Components, Path, PathBuf},
42    rc::Rc,
43    str::Chars,
44};
45#[cfg(not(target_arch = "wasm32"))]
46use std::{
47    env,
48    process::{Command, ExitStatus},
49};
50use {
51    chrono::{DateTime, Utc},
52    euv::*,
53    euv_ui::*,
54    lombok_macros::{Data, Getter, New},
55    pulldown_cmark::{
56        Alignment, BlockQuoteKind, CodeBlockKind, CowStr, Event, HeadingLevel, Options, Parser,
57        Tag, TagEnd,
58    },
59    serde::{Deserialize, Serialize},
60    serde_json::{Value, to_string, to_string_pretty},
61    serde_yaml::from_str,
62};
63#[cfg(target_arch = "wasm32")]
64use {
65    js_sys::{Function, Promise, Reflect},
66    wasm_bindgen::{JsCast, JsValue},
67    wasm_bindgen_futures::{JsFuture, spawn_local},
68    web_sys::{HtmlCanvasElement, Window, window},
69};