#parse-url #path #parser #wikidot #key-value

wikidot-path

Simple library to provide Wikidot-compatible path parsing

14 releases (6 breaking)

0.6.0 Sep 29, 2023
0.5.1 Apr 24, 2023
0.4.1 Apr 17, 2023
0.2.4 Sep 9, 2021
0.1.0 Jan 26, 2020

#3 in #wikidot

Download history 48/week @ 2024-07-14 11/week @ 2024-07-21 48/week @ 2024-07-28 52/week @ 2024-08-04 26/week @ 2024-08-11 22/week @ 2024-08-18 27/week @ 2024-08-25 69/week @ 2024-09-01 70/week @ 2024-09-08 31/week @ 2024-09-15 61/week @ 2024-09-22 70/week @ 2024-09-29 81/week @ 2024-10-06 37/week @ 2024-10-13 75/week @ 2024-10-20 18/week @ 2024-10-27

213 downloads per month
Used in 2 crates (via deepwell)

MIT license

15KB
216 lines

wikidot-path

Rust CI badge docs.rs link

Simple library to provide Wikidot-compatible path parsing.

Wikidot accepts paths in an unusual manner: each argument is submitted as another "directory".

For instance, to access page scp-xxxx with options norender and edit, you would go to /scp-xxxx/norender/true/edit/true.

However this also extends its usage in a few minor ways. For instance, options like edit only make sense when true, but passing that field is always required by Wikidot. Thus the logical URL /scp-xxxx/edit doesn't work, despite it being rather clear to a human what the intent is. This library adjusts this by allowing "solo keys" (those without values).

Additionally URL normalization is performed. See the wikidot-normalize crate for more information.

Available under the terms of the MIT License. See LICENSE.md.

Compilation

This library targets the latest stable Rust. At time of writing, that is 1.68.2

$ cargo build --release

Testing

$ cargo test

Add -- --nocapture to the end if you want to see test output.

Dependencies

~3–4.5MB
~92K SLoC