README.md 2.32 KB
Newer Older
PizZaKatZe's avatar
PizZaKatZe committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# Junghackertag flyer generator
A Python module that reads information about self-organized sessions for kids from the congress
wiki and turns it into a PDF using

* Jinja2
* LaTeX

and black magic.

## Requirements
To use this module, you need at least:

* Python 3
  * [latex](https://pypi.org/project/latex)
* LaTeX
  * [koma-script](https://www.ctan.org/pkg/koma-script)
  * [qrcode](https://www.ctan.org/pkg/qrcode)

## CLI
For convenience and testing purposes, a simple CLI is included:
```
22 23 24
usage: jht_flyergen [-h] [-d [DAY]] [-l] [-m HOMEPAGE] [-p PRINT] [-t]
                    (-U | -u [URL] | -f PATH)
                    [output]
PizZaKatZe's avatar
PizZaKatZe committed
25 26 27 28 29 30 31

positional arguments:
  output                path to output file; if omitted raw PDF data is
                        written to stdout

optional arguments:
  -h, --help            show this help message and exit
32 33 34 35 36
  -d [DAY], --day [DAY]
                        day of month (default: 28)
  -l, --links           generate QR codes with links to sessions' wiki pages
  -m HOMEPAGE, --homepage HOMEPAGE
                        JHT homepage URL
PizZaKatZe's avatar
PizZaKatZe committed
37 38 39
  -p PRINT, --print PRINT
                        print filtered data of session with index PRINT,
                        starting at 1; 0 prints all sessions
40
  -t, --tex             print tex document to stdout
PizZaKatZe's avatar
PizZaKatZe committed
41 42

data sources:
43 44
  -U, --print-default-url
                        print default URL and exit
PizZaKatZe's avatar
PizZaKatZe committed
45 46
  -u [URL], --url [URL]
                        URL to fetch JSON data from; if URL is omitted, a
47
                        hard-coded default URL is used
PizZaKatZe's avatar
PizZaKatZe committed
48 49 50
  -f PATH, --file PATH  path to file containing JSON data
```

51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
## Data source
Default URL was generated with Semantic Wiki's [Special:Ask](https://events.ccc.de/congress/2019/wiki/index.php?title=Special:Ask) page using the following settings:

* Condition:
  ```
  [[Category:Session]] [[Is for kids::yes]]
  ```
* Printout selection:
  ```
  ?Has description=description
  ?Has subobject.Has session location=location
  ?Has subobject.Has start time=starts
  ?Has subobject.Has end time=ends
  ```
* limit: 128
* offset: 0
* link: all

Sorting is done by the script, so we don't care about it here.

PizZaKatZe's avatar
PizZaKatZe committed
71 72 73 74
## Templates
At the moment the module uses a bundled, "hard-coded" [LaTeX template](jht_flyergen/template.tex).
Maybe support for custom templates will be added once the thing works as expected and was tested
successfully at 36C3.