README.md 5.17 KB
Newer Older
Dave Kliczbor's avatar
Dave Kliczbor committed
1
2
3
Schildergenerator
=================

4
A web service to quickly create and print signs using a common design.
Dave Kliczbor's avatar
Dave Kliczbor committed
5
6
Especially useful for events.

7
8
9
10
11
12
You might find it useful in the following scenarios:
  
  * You need to set up an event where visitors need signs to point them around.
  * You often need to change some signs in your organization.
  * You're bored in the Fachschaftsbüro.

13
What you need for this tool to unleash it's maximum potential:
14
15
16

  * A printer on premise.
  * Some kind of server, preferrably running a flavor of Linux, capable of printing
17
    on said printer via lpd interface. A RaspberryPi would suffice, even if it's slow.
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  * Web clients of any type being able to connect to said server.
  * The knowledge to modify a LaTeX template to fit your organizations design.

After you put in the initial work of setting this up, you'll have a service 
where everyone on your team can quickly create a new sign as soon as they see a
need for it (provided they've got a mobile web client) just by typing a headline
and some text, selecting or uploading an image -- and by the time they arrive at
the printer, the sign is already printed and ready to be posted on the wall. All
while heeding the event's design.

> This script frees the event organisators of the responsibility to pre-think
> all the details of sign-making. Instead, this part can simply be delegated to 
> the helpers who are setting up the event by showing them the web frontend of
> this tool.


Dave Kliczbor's avatar
Dave Kliczbor committed
34
35
36
Dependencies
------------

37
38
39
40
41
  * python-flask, python-genshi 
  * python-pythonmagick, graphicsmagick
  * pdflatex, latex-beamer
  * libapache2-mod-wsgi for production use 
    (or [anything capable of running WSGI apps](http://wsgi.readthedocs.org/en/latest/servers.html) really…)
Dave Kliczbor's avatar
Dave Kliczbor committed
42

Dave Kliczbor's avatar
Dave Kliczbor committed
43
44
45
46
47
48
49

Download
--------

       $ git clone https://github.com/kif-ev/schildergenerator.git


Dave Kliczbor's avatar
Dave Kliczbor committed
50
51
52
Config
------

53
54
55
56
57
58
59
  * *for all uses*: copy config.py.example to config.py and edit it to your needs.
  * *for production use*: copy schildergen.wsgi.example to schildergen.wsgi and edit it.


Modify the templates
--------------------

60
61
62
63
64
In most cases, you just need to edit `tex/support/header.tex` and add your logo
in `tex/support`. A suitable test workflow might be recreating the same sign in
the webinterface while always saving under the same name.

After you're done with modifying the template, you might want to run
65
66
67
68
69
70

	$ python schilder.py --recreate-cache

to delete all cached pdf and image thumbnails, then re-run pdflatex on all 
saved signs. Accessing the webinterface will recreate the rest of the cached 
image thumbnails.
Dave Kliczbor's avatar
Dave Kliczbor committed
71
72


Dave Kliczbor's avatar
Dave Kliczbor committed
73
74
75
76
77
78
79
Running in test/debug mode
--------------------------

You need to have the config done. Then you could just start the server in debug mode:

       $ python schilder.py

80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
This will serve a webpage at http://localhost:5432/ for testing purposes.


General directory layout
------------------------

	schildergenerator
        ├── schilder.py
        ├── config.py
        ├── schilder.wsgi
        ├── data	(sign store: needs to be writable, recursively)
        │   ├── cache	(template preview cache)
        │   ├── images	(image store + thumbnail cache)
        │   ├── pdf	(pdf versions of all signs, including thumbnails)
        │   └── upload	(image upload handler temp dir, non-empty only after errors)
        ├── static	(static web UI files)
        ├── templates	(web UI HTML templates)
        └── tex		(strictly LaTeX sign templates only)
            └── support (everything your LaTeX template needs: includes, macros, logo files, ...)

Dave Kliczbor's avatar
Dave Kliczbor committed
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

Webserver Deployment
--------------------

See http://flask.pocoo.org/docs/0.10/deploying/ for all deployment options.

Example config for the Apache Webserver, following http://flask.pocoo.org/docs/deploying/mod_wsgi/:

        LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
        WSGIRestrictStdout Off

        <VirtualHost *:443>
                ServerAdmin admin@server.test
                DocumentRoot /path/to/schildergen
                ServerName server.name.org
                AddDefaultCharset utf-8
                ErrorLog /path/to/log
                CustomLog /path/to/log
                
                SSLEngine on
                SSLCertificateFile /path/to/www.example.com.cert
                SSLCertificateKeyFile /path/to/www.example.com.key

                WSGIDaemonProcess schildergen user=www-data group=www-data threads=2
                WSGIScriptAlias / /path/to/schildergen.wsgi
Dave Kliczbor's avatar
Dave Kliczbor committed
125

Dave Kliczbor's avatar
Dave Kliczbor committed
126
127
128
129
130
131
132
133
134
                <Directory /path/to/schildergen.wsgi>
                        AllowOverride All
                        WSGIProcessGroup schildergen
                        WSGIApplicationGroup %{GLOBAL}
                        WSGIScriptReloading On
                        Order deny,allow
                        Allow from all
                </Directory>
        </VirtualHost>
Dave Kliczbor's avatar
Dave Kliczbor committed
135
136
137
138
139
140
141
142
143
144
145
146
147
148

Contributors
============

  * Dave Kliczbor <dave@fsinfo.cs.tu-dortmund.de>
  * Lars Beckers <larsb@fsmpi.rwth-aachen.de>
  * Moritz Holtz <moritz@fsmpi.rwth-aachen.de>
  * Konstantin Kotenko <konstantin@fsmpi.rwth-aachen.de>

Image Sources
-------------

  * USNPS pictograms taken from the Open Icon Library: http://sourceforge.net/projects/openiconlibrary/