Activities/Wikipedia/HowTo: Difference between revisions
Small redaction changes |
No edit summary |
||
| Line 1: | Line 1: | ||
''"Crear uno, dos, tres... mil Wikipedias" Comandante Ernesto Wales'' | ''"Crear uno, dos, tres... mil Wikipedias" Comandante Ernesto Wales'' | ||
=== How to Create a new wikipedia activity or update | === How to Create a new wikipedia activity or update an existing activity === | ||
This page describes how to generate the data files needed to create a wikipedia activity like | This page describes how to generate the data files needed to create a wikipedia activity like | ||
| Line 96: | Line 96: | ||
and this will show you the content in wiki format of the selected page. | and this will show you the content in wiki format of the selected page. | ||
At this stage, the process will be slow, because | At this stage, the process will be slow, because it needs to search for every template | ||
and do all the templates substitutions. | and do all the templates substitutions. | ||
To have faster results we will apply templates substitutions in all the pages. | To have faster results we will apply templates substitutions in all the pages. | ||
| Line 102: | Line 102: | ||
== Optimze the data and download images == | == Optimze the data and download images == | ||
To expand the templates need go out of the data directory: | To expand the templates you need go out of the data directory: | ||
cd .. | cd .. | ||
./tools2/expandtemplates.py es_lat | ./tools2/expandtemplates.py es_lat | ||
When finish, you need | When finish, you need go back to the data directory: | ||
cd es_lat | cd es_lat | ||
| Line 118: | Line 118: | ||
The option --delete_all is used to remove the old index | The option --delete_all is used to remove the old index | ||
If you want include images in your wikipedia activity can go again to your data directory and do: | If you want to include images in your wikipedia activity, you can go again to your data directory and do: | ||
cd es_lat | cd es_lat | ||
../tools2/download_images.py | ../tools2/download_images.py | ||
This command will download the images included in the pages in favorites.txt | This command will download the images included in the pages in favorites.txt. | ||
If you want include the images in all the pages, should do: | If you want to include the images in all the pages, you should do: | ||
../tools2/download_images.py --all | ../tools2/download_images.py --all | ||
An option --cache_dir=directory is available if you have images already downloaded | |||
in another directory to acelerate the process. | in another directory to acelerate the process. | ||
| Line 140: | Line 140: | ||
to point to your new data files or create a new different file, for example activity_pt.py. | to point to your new data files or create a new different file, for example activity_pt.py. | ||
If you create a new file, you will need modify the file activity/activity.info to point to this new file. | If you create a new file, you will need to modify the file activity/activity.info to point to this new file. | ||
Now, you can test your changes, starting the wikipedia server: | Now, you can test your changes, starting the wikipedia server: | ||
| Line 150: | Line 150: | ||
In any web browser in the same computer you can look to a page, to check if is working: | In any web browser in the same computer you can look to a page, to check if is working: | ||
In this example, look at the page "Energía" pointing to '''http://localhost:8000/wiki/Energía''' | In this example, we look at the page "Energía" pointing to '''http://localhost:8000/wiki/Energía''' | ||
[[File:Wikipedia_test.png]] | [[File:Wikipedia_test.png]] | ||
You can create a new icon too, or modify the existing activity/activity-wikipedia-es.svg file. | You can create a new icon too, or modify the existing activity/activity-wikipedia-es.svg file. | ||