mediawiki_rust
mediawiki_rust copied to clipboard
Add {{nobots}} helper function
The specification is documented at https://en.wikipedia.org/wiki/Template:Bots
I'd expect a function signature of
fn bot_may_edit(wikitext: &str, bot: &str) -> bool { ... }
This probably warrants going in its own module, maybe behind a feature since it'll probably add a dependency on regex
.
Also, this would tie the crate to Wikipedia/Wikimedia, where until here it's mostly agnostic...
I've seen it used on other wikis, it's more of a template specification than anything else. In any case, https://gitlab.com/mwbot-rs/mwbot/-/blob/master/mwbot/src/utils.rs is what I implemented using Parsoid HTML.