Comments (3)
The main issue is that we need to open VE, and then select the proper citation. This could be done by open VE with a GET arg, and then by executing Javascript on the open page. However, figuring out where exactly in the linear model the selected citation is might be a bit tricky... see: https://www.mediawiki.org/wiki/VisualEditor/API/Data_Model/Surface Inside VE, we need to know where the selection is in the linear model, and that is generated from the HTML, and I'm not sure how to do this; perhaps it's possible to get from parsoid?
from citationhunt.
Hi @mvolz! I know absolutely nothing about VE, so let's see if I understand your ideas...
This could be done by open VE with a GET arg, and then by executing Javascript on the open page.
I skimmed the documentation a bit, but saw no references to opening VE with a query parameter, or to passing it a script to run. Is this something that's already possible? Can you please point me to the relevant docs?
Inside VE, we need to know where the selection is in the linear model, and that is generated from the HTML
So if we manage to run JS in VE, we'll get access to the linear model through the VE API, and the corresponding HTML will just be the page itself, right?
I suppose the hackish way would be to craft some heuristic to match the snippet as displayed in Citation Hunt with one of the DOM elements in the page (it's always going to be a paragraph and we know what section it's in, we can try some matching based on the text), then look that up in the linear model. Does this make some sense? I'm hand-waving a lot here :)
Thanks for your input!
from citationhunt.
To open VE you just need to do: https://en.wikipedia.org/wiki/SomePage?veaction=edit
And then yes, we'll get access to the linear model and also the whole library because it's all front-end javascript. You can kind of see what interacting with it looks like here: https://www.mediawiki.org/wiki/VisualEditor/Gadgets#Code_snippets
I think actually the easiest/hackish way to do it is just search for the text of the citation in the page. At the bottom of that gadgets link someone has actually written a search and replace gadget so you could probably adapt that code lot: https://en.wikipedia.org/wiki/User:%D7%A2%D7%A8%D7%9F/veReplace.js
Except instead of replacing, you just need to select it and that should open up the dialog.
from citationhunt.
Related Issues (20)
- {link_start} and {link_end} is not translated into link properly in Japanese HOT 5
- Create a custom Citation Hunt from an initial seed article HOT 6
- [Feature Request] Support for adding references to Wikidata.org statments. HOT 2
- [Feature Request] Adding option to select items based on a priority metric HOT 2
- [Feature Request] Adding ability to add citation directly from CitationHunt HOT 4
- Figure out logging with Kubernetes HOT 1
- Filter out User: pages and subpages. HOT 1
- Adding more Wikipedia CEE languages HOT 3
- Log the pages that generated no snippets, for further analysis.
- translations are out of sync (and always fallbacks to English) HOT 7
- Add a favicon. HOT 2
- Exceeded cronjob quota on Toolforge HOT 2
- Dark mode HOT 3
- Language update cronjobs are broken after database replica scheme update.
- Out of jobs quota HOT 2
- Add simplewiki HOT 4
- Citation
- Database Update HOT 7
- Locked articles HOT 3
- Categories in Polish seem to not work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from citationhunt.