Collection of scripts used to convert the Cataclysm-DDA json files to media wiki content.
CDDA main repository: https://github.com/CleverRaven/Cataclysm-DDA
CDDA Wiki: http://cddawiki.chezzo.com/cdda_wiki/index.php?title=Main_Page
Uses python 2.7
Some scripts do not directly add content to the wiki. Only converts the json files. Need to be manually copy pasted in.
Other scripts use pywikibot ( https://www.mediawiki.org/wiki/Manual:Pywikibot ) to automatically upload information to the wiki.
Get python 2.7
Copy the most recent json files into data/json
Get Microsoft Visual C++ Compiler for Python 2.7 (note to self, why? Sorry this documentation is a bit incomplete, also install Pywikibot )
Windows:
Download and install https://www.microsoft.com/en-in/download/details.aspx?id=44266
pip install --upgrade setuptools
pip install ez_setup
pip install requests
If it's still not working, maybe pip didn't install/upgrade setup_tools properly so you might want to try
easy_install -U setuptools
pip install --upgrade setuptools
pip install requests (again)
pip.exe install -U requests[security]
Configure pywikibot: Copy the pywikibot_config\cddawiki_family.py to [location of pywikibotinstall]\pywikibot\families
In the [location of pywikibotinstall] run python .\pwb.py generate_user_files
setup your userfiles, and the account used by the bot to connect to the wiki.
Data can be automatically copied to the wiki bionic pages. Usage: python [location of pywikibotinstall]\pwb.py bionics.py Either input 'all' or 'ALL', and then your password, and wait for the pages to be updated. Or: Input a bionic ID from 'data/json/bionics.json' to get the position of that bionic in the data list. Or: Input an integer, which will print the generate page of that bionic on screen, and copy it to the clipboard. Doesn't work on bionics that are not defined in 'data\json\bionics.json'
Data is copied to clipboard, used for the http://cddawiki.chezzo.com/cdda_wiki/index.php?title=Materials page
Data can be automatically copied to the wiki monster pages. Usage: python [location of pywikibotinstall]\pwb.py monsters.py Either input 'all' or 'ALL', and then your password, and wait for the pages to be updated. Or: Input a monster ID (for example 'mon_zombie') from one of the files in list_monster_files to get the position of that monster in the data list. Or: Input an integer, which will print the generated page of that monster on screen, and copy it to the clipboard. Or: Input '_idtotal', which will print the total number of monsters. (note: the monster id numbers starts to count at 0, and the _idtotal starts counting at 1. Input 'exit' to exit If the monster id/integer shares the name with other monsters, and all those various monsters will be merged into one page for the wiki.
Data can be automatically copied to the wiki mutation pages. Usage: python [location of pywikibotinstall]\pwb.py trait.py Either input 'all' or 'ALL', and then your password, and wait for the pages to be updated. Or: Input a mutation ID to get the mutations location in the array. These are supposed to be permanent ID's. Or: Input an integer, which will print the generated page of that mutation on screen, and copy it to the clipboard. input 'exit' to exit
The following scripts simply use pywikibot to upload content to the pages automatically.
Seems they fixed the bug. (According to the documentation the 'http' protocol value is not allowed).
In some rare cases people used a ’ instead of a ' or a ` this can cause some issues. You prob need to manually edit the json files and change the ’ into a '. Prob also best to make a PR to fix the wrong character in the main json files.