wpoa / recitation-bot

MediaWiki bot to upload content to Wikimedia projects and update corresponding citations on Wikipedia.
GNU General Public License v3.0
9 stars 3 forks source link

Force re-upload of images for equations/ tables #44

Closed Daniel-Mietchen closed 10 years ago

Daniel-Mietchen commented 10 years ago

Once the upload of images for equations/ tables to Wikisource works, we will need another checkbox in the web form, with the option to force re-upload of these, perhaps separately for tables and figures.

notconfusing commented 10 years ago

at the moment, im treating all images as one, regardless if they go to commons or wikisource. however, we can handle them separately. right now if you check reupload images then all the images will be attempted to reupload.

notconfusing commented 10 years ago

done in d8159c805b109fa6166b941135d9ebffaccca571

Daniel-Mietchen commented 10 years ago

For formulas/ equations formatted like

<disp-formula>
    <graphic xlink:href="pcbi.1000667.e015"/>
</disp-formula>

the wikicode should always specify "frameless|left", and a line break should be added after the embedded image:

[[File:A-Primer-on-Metagenomics-pcbi.1000667.e015.jpg|frameless|left]]<br/>
wrought commented 10 years ago

Might be a fringe case when using the left alignment of formula inside of a table, as formulae are permitted by JATS.

Patch made in JATS-to-mediawiki library with commit http://github.com/wpoa/JATS-to-mediawiki/commit/4e1fd7ac6ca7b2eea1b1e9879e896639dbe5308f

wrought commented 10 years ago

After trying newlines (&c#A;, <br />) and even a css clear (<div style="clear: both;"></div>), turns out the best path is to add a |none value to the [[File:...]] tag, which wraps the file in a div displaying at full size and including a line break via the floatnone class.

See it in action here: https://en.wikisource.org/wiki/Wikisource:WikiProject_Open_Access/Programmatic_import_from_PubMed_Central/A_Primer_on_Metagenomics