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 codec;
10mod generator;
11mod model;
12mod parser;
13mod viewer;
14
15#[cfg(test)]
16#[path = "../tests/mod.rs"]
17mod tests;
18
19#[cfg(not(target_arch = "wasm32"))]
20pub use bundle::*;
21pub use {codec::*, generator::*, model::*, parser::*, viewer::*};
22
23pub(crate) use parser::{
24    deduplicate_slug, heading_level_num, load_doc_site_excluding, section_sort_rank,
25    should_skip_dir, slugify,
26};
27
28#[cfg(target_arch = "wasm32")]
29use std::cell::{RefCell, RefMut};
30#[cfg(test)]
31use std::time::{Duration, SystemTime, UNIX_EPOCH};
32use std::{
33    borrow::Cow,
34    cell::Cell,
35    cmp::{Ordering, Reverse},
36    collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap},
37    f32::consts::{FRAC_PI_2, PI, TAU},
38    ffi::{OsStr, OsString},
39    fmt::{self, Write},
40    fs::{self, DirEntry},
41    io::{self, Error, ErrorKind},
42    iter::Peekable,
43    mem::take,
44    path::{self, Components, Path, PathBuf},
45    rc::Rc,
46    str::Chars,
47};
48#[cfg(not(target_arch = "wasm32"))]
49use std::{
50    env,
51    process::{Command, ExitStatus},
52};
53use {
54    chrono::{DateTime, Utc},
55    euv::*,
56    euv_ui::*,
57    lombok_macros::{Data, Getter, New},
58    pulldown_cmark::{
59        Alignment, BlockQuoteKind, CodeBlockKind, CowStr, Event, HeadingLevel, Options, Parser,
60        Tag, TagEnd,
61    },
62    serde::{Deserialize, Serialize},
63    serde_json::{Value, to_string, to_string_pretty},
64    serde_yaml::from_str,
65};
66#[cfg(target_arch = "wasm32")]
67use {
68    js_sys::{Function, Promise, Reflect},
69    wasm_bindgen::{JsCast, JsValue, closure::Closure},
70    wasm_bindgen_futures::{JsFuture, spawn_local},
71    web_sys::{Document, HtmlCanvasElement, MediaQueryList, Window, window},
72};