-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V9: clean wikitext replace for bot-plugins #411
Comments
hey Samantha, this is a great question. I'd like this feature too. Also - I've been waiting for someone to use this library as a wikipedia bot. It makes perfect sense. It would be beautiful if we could make simple edits to a template, then inject it back into the page safely - with a minimal diff. In addition to offsets, are there other features that would make bot-authorship easier? I know it's very hard to do right now. I'm in some breaking-changes on dev, so now is a good time to horeshoe this idea into the library somehow. |
Good to know, thanks for the wonderful library btw Offsets would be a good foundation. Imo, I was just thinking two unenumberable properties on each model. Kind of like I would also need to implement something like:
But the bullets are much smaller/easier to implement on my end too if the offsets are there. That seemed to be the big foundational change that I'd need. |
yep - amazing. PR welcome. You're right that the wikitext is getting tossed-around to each class, and accessing that would be great. Feel-free to change things - especially on (plz branch off of dev - it's green right now, but I may mess-around with some of the templates over the holidays.) Let me know if I can help! |
Okay, don't have a shit ton of time but I'll start taking a stab at trying to add the indexes https://github.com/Cobertos/wtf_wikipedia Noting my findings
|
yep - I've been thinking about this too. |
hey @Cobertos - I haven't got a solution to this, but haven't forgotten. Plan is to do a fuzzy-match on the original wikitext, then allow replacing chunks of it - hard part is that the model isn't built-well for reproducing subsets of the document, like the table use-case you mentioned. I will almost-certainly be over-thinking this over the winter, but should scale-back my promises for it. |
Is there any way to get the original wikitext for a specific model? Not converting it back like
wtf-plugin-wikitext
does, but like astartIndex
,endIndex
into the originally parsed wikitext string?I want to be able to convert back to
wikitext
while keeping the originally desired user formatting, just changing the text in one or two rows of a table.Almost something like
...where
r.originalWikiText()
would basically just, return theIs this even possible? Could the parser decorate the models with this information? Is this something that would be valuable in a PR? Trying to write a Wikipedia bot that updates a table...
The text was updated successfully, but these errors were encountered: