wikidot_path/lib.rs
1/*
2 * lib.rs
3 *
4 * wikidot-path - Library to parse Wikidot-like paths.
5 * Copyright (c) 2019-2023 Emmie Maeda
6 *
7 * wikidot-normalize is available free of charge under the terms of the MIT
8 * License. You are free to redistribute and/or modify it under those
9 * terms. It is distributed in the hopes that it will be useful, but
10 * WITHOUT ANY WARRANTY. See the LICENSE file for more details.
11 *
12 */
13
14#![deny(missing_debug_implementations)]
15#![warn(missing_docs)]
16
17//! A library to provide Wikidot-compatible path parsing.
18//!
19//! Wikidot accepts paths in an unusual manner: each argument is submitted as another "directory".
20//! For instance, the path `/scp-xxxx/norender/true/edit/true` is how you access page `scp-xxxx`
21//! with flags "`edit`" and "`norender`" activated.
22//!
23//! URL normalization is performed when parsing.
24//! See the [`wikidot-normalize`](https://crates.io/crates/wikidot-normalize)
25//! crate for more information.
26
27#[cfg(test)]
28#[macro_use]
29extern crate maplit;
30
31#[cfg(feature = "serde-derive")]
32#[macro_use]
33extern crate serde;
34
35mod arguments;
36mod schema;
37mod value;
38
39#[cfg(test)]
40mod test;
41
42pub use self::arguments::PageArguments;
43pub use self::schema::ArgumentSchema;
44pub use self::value::ArgumentValue;
45
46/// A "prelude" for consumers of the `wikidot-path` crate.
47///
48/// This prelude includes all exports from the crate, and is provided
49/// for convenience without requiring programs to do a glob import of
50/// the whole crate.
51pub mod prelude {
52 pub use super::arguments::PageArguments;
53 pub use super::schema::ArgumentSchema;
54 pub use super::value::ArgumentValue;
55}