Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scpwiki/wikidot-path
Simple library to provide Wikidot-compatible path parsing.
https://github.com/scpwiki/wikidot-path
library nuscp parsing path rust scp-foundation wikidot
Last synced: 2 months ago
JSON representation
Simple library to provide Wikidot-compatible path parsing.
- Host: GitHub
- URL: https://github.com/scpwiki/wikidot-path
- Owner: scpwiki
- License: mit
- Created: 2019-11-29T05:13:20.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-09-29T21:41:25.000Z (over 1 year ago)
- Last Synced: 2024-11-13T04:48:12.278Z (3 months ago)
- Topics: library, nuscp, parsing, path, rust, scp-foundation, wikidot
- Language: Rust
- Homepage:
- Size: 52.7 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## wikidot-path
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`](https://crates.io/crates/wikidot-normalize) crate for more information.
Available under the terms of the MIT License. See [LICENSE.md](LICENSE).
### Compilation
This library targets the latest stable Rust. At time of writing, that is 1.68.2```sh
$ cargo build --release
```### Testing
```sh
$ cargo test
```Add `-- --nocapture` to the end if you want to see test output.