SMW Queries: Difference between revisions
Andre Castro (talk | contribs) (Created page with "=DO BEFORE= Write metadata of the documents you uploaded to the itchwiki, see how to in <nowiki>Help:Metadata</nowiki> You can see what documents you uploaded in the <n...") |
Andre Castro (talk | contribs) No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 33: | Line 33: | ||
QUERYING MATERIAL THROUGH PYTHON SCRIPT | QUERYING MATERIAL THROUGH PYTHON SCRIPT | ||
<pre>python3 query2html.py --conditions '[[Date::>=1970/01/01]][[Date::<=1979/12/31]]'</pre> | |||
<pre>python3 query2html.py --conditions '[[Creator::~*task force*]]'</pre> | |||
Line 41: | Line 41: | ||
Note: to avoid confusion or problems is better to leave the `--printouts` `--sort` `--order` arguments as the default. | Note: to avoid confusion or problems is better to leave the `--printouts` `--sort` `--order` arguments as the default. | ||
Otherwise document parts will start to get grouped not according to their Title, hence creating documents made from different original parts. | Otherwise document parts will start to get grouped not according to their Title, hence creating documents made from different original parts. | ||
=USING GIT BRANCHES= | =USING GIT BRANCHES= | ||
Line 61: | Line 60: | ||
go back to master branch | go back to master branch | ||
git checkout master | git checkout master | ||
[[Category:Post-Digital Itch]] |
Latest revision as of 16:03, 9 February 2020
DO BEFORE
Write metadata of the documents you uploaded to the itchwiki, see how to in [[Help:Metadata]]
You can see what documents you uploaded in the [[Special:NewFiles]] page where you can filter by your usename
Have https://git.xpub.nl/XPUB/special-issue-11-wiki2html cloned
The dependencies described in the README installed.
Check if:
- pandoc is installed with `which pandoc` if so it will return the location of its binary, if not, it will return nothing
- Python libs Jinja and mwclient libraries with: `pip3 freeze | grep -iE 'jinja|mwclient'` pip3 freeze gives you a list of the installed python libraries; grep search for either jinja or mwclient
Fill in you user details in to login.txt as describe in the REAMD
Run `python3 download_imgs.py` to get all the images stored in the itch wiki downloaded
IN PAIRS WRITE A QUERY YOU LIKE TO MAKE:
- in plain English
- in the Ask interface
- in the query2html.py script
QUERYING MATERIAL THROUGH WIKI Ask REQUEST
- [[Special:Ask]] interface
- [[Help:Ask]] How to create ask queries
- mediawiki API call - ugly, long and messy! Needs to URL encode reserve character. That is when it makes sense to use something like the mwclient library for python which can take care of those things for us
QUERYING MATERIAL THROUGH PYTHON SCRIPT
python3 query2html.py --conditions '[[Date::>=1970/01/01]][[Date::<=1979/12/31]]'
python3 query2html.py --conditions '[[Creator::~*task force*]]'
Note: to avoid confusion or problems is better to leave the `--printouts` `--sort` `--order` arguments as the default. Otherwise document parts will start to get grouped not according to their Title, hence creating documents made from different original parts.
USING GIT BRANCHES
To avoid disrupting the work that one might be doing rather than work on the master branch of special-issue-11-wiki2html you can use branches
Read more on git branches at https://www.atlassian.com/git/tutorials/using-branches
create a new branch with your name of the feature you want to implement:
git branch mynamebranch
start working withing your branch
git checkout mynamebranch
make pushes to remote, under your branch
git push origin mynamebranch
go back to master branch
git checkout master