comparison README @ 526:31282f97b807

Reworked the --help function * More information about the templates * Information about the templates and how to create them added to the README file.
author Magnus Schieder <mschieder@intevation.de>
date Tue, 22 Jan 2019 15:35:28 +0100
parents d749ded62687
children fab6ff9b248e
comparison
equal deleted inserted replaced
525:bad607aec1af 526:31282f97b807
163 $ getan 163 $ getan
164 164
165 or:: 165 or::
166 166
167 $ getan /path/to/mytime.db 167 $ getan /path/to/mytime.db
168
169
170 Writing Templates
171 =================
172
173 Getan uses the Jinja2 templating language. You can find more information
174 at `Jinja2 <http://jinja.pocoo.org/>`_.
175
176 If a year or a week is specified, only the entries in this period will be
177 loaded.
178
179 Variables
180 ---------
181
182 current_week: The current week.
183 current_year: The current year.
184
185 user: What You indicated with -u.
186 week: What You indicated with -w.
187 unix_week: What You indicated with -w, in unix notation.
188 year: What you indicated with -y.
189
190 get_total_duration(): Total duration of all entries.
191
192 database: Path of the database.
193
194 entries: List of all entries.
195 get_comment(): Description of the entry.
196 get_workpackage(): Work package of the entry.
197 desc: Work package and Description of the entry.
198
199 startisoday: Year, month and day in ISO format.
200 start: Start time as datetime.
201 end: End time as datetime.
202 get_duration(): Duration of the entry.
203
204 projects: List of all projects.
205 get_total_duration(): Total duration of all
206 entries in the project.
207 desc: Description of the project.
208 key: Key of the project.
209
210 entries: All entries in this project (See entries).
211
212
213 If -w is specified, only this week will be loaded from the database.
214
215 year(): All entries in this year.
216 month(): All entries in this month.
217 week(): All entries in this week.
218 day(): All entries in this day.
219
220 Example
221 -------
222
223 {{ user }}, (KW {{ week }}, {{ year }})
224 {% for i in user -%}
225 =
226 {%- endfor -%}
227 ==============
228 {% for proj in projects %}
229 # {{ proj.desc }}
230 {% for entry in proj.entries|sort(attribute='start') -%}
231 {{ entry.get_comment() }}
232 {% endfor -%}
233 # total time: {{ proj.get_total_duration()|human_time }}h
234 {% endfor %}
235 # total: {{ total_time|human_time }}h
168 236
169 237
170 CREDITS 238 CREDITS
171 ======= 239 =======
172 Getan is Free Software licensed under the terms of GNU GPL v>=3. 240 Getan is Free Software licensed under the terms of GNU GPL v>=3.
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)