mainz
clone your own copy | download snapshot

About

workshop.mainz

Restyling any wikipedia articles (for print) with etherpad (collectively).

a burgeon of code made by Amélie Dumont & Doriane Timmermans for a web2print workshop in the University of Applied Science of Mainz that take place on the 1st of April 2023.

install requierement

pip3 install requierement.txt

launch

python3 app.py

you can request any wikipedia page by passing it's name in the url route as such

http://127.0.0.1:5000/Mushroom

the associated pad is automatically created by clicking on the specific pad link

setup documentation

This setup uses a Flask application, in order to dynamically request wikipedia pages using a python module.

Users can enter any route on their localhost (or being connected someone else ip through a local network).

localhost:5000/python

The route is then interpreted as Wikipedia Python API request to get in order to get a specific page, in this example we get back the HTML of the wikipedia page for python.

The styling of the article is entierly reset (removing inline <link> tags, and default browser styles with a reset.css).

You can collectivelly write new CSS styles in a dedicated pad for every different articles. Thoses pads are automatically generated simply by using the wikipedia route/request id in its url.

Furthermore a global pad is created, the CSS styles defined in it is applied to every wikipedia articles.

In order to use the content of pads as stylesheet, we need to do an ajax request and fill in <style> tags through a data-pad attribute, because some browser (?) show a mimetype restriction error (expecting text/css instead of text/plain).

To optimize this system, a cache system has been added. So the wikipedia request can only be done one time for every page.

this is what we can get from the wikipedia api:

https://wikipedia.readthedocs.io/en/latest/

todo

  • local cache system for wikipage
  • not found error template page

Snapshots | iceberg

Log

 

Amélie Dumontcried

— Initial commit

Tuesday, 28th March 2023 - 15:33

 

Amélie Dumontsang

— Super basic Flask app setup to begin

Tuesday, 28th March 2023 - 16:12

 

Doriandiscovered

— small top interface, and starting jinja templates

Tuesday, 28th March 2023 - 17:40

 

Dorianblabbed

— ajax request for the etherstylesheet

Tuesday, 28th March 2023 - 18:00

 

Amélie Dumontbabbled out

— Python script to get the HTML content of Wikipedia page and clean it from inline style (link tags)

Tuesday, 28th March 2023 - 17:41

 

Amélie Dumontadmitted

— Merge branch 'main' of https://gitlab.constantvzw.org/osp/workshop.mainz

Tuesday, 28th March 2023 - 17:42

 

Doriandisclosed

— Merge branch 'main' of gitlab.constantvzw.org:osp/workshop.mainz

Tuesday, 28th March 2023 - 18:00

 

Dorianverbalised

— documenting the little setup in the readme

Tuesday, 28th March 2023 - 18:22

 

Amélie Dumontsang

— Wikipedia pages request connected to the Flask app, 1 page per wikipedia article and iframes in the index

Wednesday, 29th March 2023 - 15:34

 

Dorianunwrapped

— any request in now possible directly from the url + cleaned interface + added one layer of iframe to avoid overridding the interface css from the pads with a custom print function

Thursday, 30th March 2023 - 16:35

 

Dorianexposed

— adding wikipedia links to see the equivalent article on wikedia ;)

Thursday, 30th March 2023 - 16:59

 

Dorianbabbled out

— refresh

Thursday, 30th March 2023 - 17:15

 

Dorianstated

— other module with images test

Saturday, 1st April 2023 - 10:06

 

Dorianrendered

— getting exact page now

Saturday, 1st April 2023 - 11:29

 

Doriandisclosed

— new pagesgit add .

Saturday, 1st April 2023 - 11:47

 

Dorianpublished

— cache system is done & wikipedia links are back

Saturday, 1st April 2023 - 14:36

 

Dorianbabbled out

— adding an iceberg :)

Friday, 30th June 2023 - 17:39