From 91f0c8e4f4c7934776a1541c857c987d9bf5b94c Mon Sep 17 00:00:00 2001 From: Felix Wittwer Date: Mon, 8 Jul 2019 17:21:23 +0200 Subject: [PATCH] Dump decisions to yaml --- .gitignore | 278 +++++++++++++++++++++++++++++++++++++ protokoll/fsrprotokoll.cls | 45 ++++-- protokoll/protokoll.tex | 2 +- 3 files changed, 314 insertions(+), 11 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9141c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1,278 @@ +protokoll/*.yaml +protokoll/protokoll.pdf + +# Created by https://www.gitignore.io/api/latex +# Edit at https://www.gitignore.io/?templates=latex + +### LaTeX ### +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs + +# uncomment this for glossaries-extra (will ignore makeindex's style files!) +# *.ist + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Comment the next line if you want to keep your tikz graphics files +*.tikz +*-tikzDictionary + +# listings +*.lol + +# luatexja-ruby +*.ltjruby + +# makeidx +*.idx +*.ilg +*.ind + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices +*.xyc + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# KBibTeX +*~[0-9]* + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +### LaTeX Patch ### +# glossaries +*.glstex + +# End of https://www.gitignore.io/api/latex + diff --git a/protokoll/fsrprotokoll.cls b/protokoll/fsrprotokoll.cls index fc2fd01..cc91b9e 100644 --- a/protokoll/fsrprotokoll.cls +++ b/protokoll/fsrprotokoll.cls @@ -125,35 +125,60 @@ \newsavebox{\mybox} \newcounter{x} % counter to add up two arguments \newenvironment{vote} {% + \immediate\write\exportdata{-} \begin{lrbox}{\mybox}\begin{minipage}{.985\textwidth} \newcommand*{\voteNumber}[1]{% - \immediate\write\exportdata{\the\year/##1}% + \immediate\write\exportdata{ decision_id: "\the\year/##1"}% \textbf{\the\year\,/\,##1:}\\% }% \newcommand*{\voteMoney}[1]{% - \ifthenelse{\equal{##1}{}} {\textbf{Antrag}} {\textbf{Finanzantrag}}% + \ifthenelse{\equal{##1}{}} {% + \immediate\write\exportdata{ money_limit: NULL}% + \textbf{Antrag}% + } {% + \immediate\write\exportdata{ money_limit: ##1}% + \textbf{Finanzantrag}% + }% } - \newcommand*{\voteText}[1]{##1\vspace{\baselineskip}\\}% - \newcommand*{\voteReason}[1]{\textbf{Begründung: }##1\vspace{\baselineskip}\\}% + \newcommand*{\voteText}[1]{% + \immediate\write\exportdata{ text: "##1"}% + ##1\vspace{\baselineskip}\\}% + \newcommand*{\voteReason}[1]{% + \immediate\write\exportdata{ rationale: "##1"}% + \textbf{Begründung: }##1\vspace{\baselineskip}\\}% \newcommand*{\voting}[3]{\textbf{Abstimmung: }% \ifthenelse{\equal{##1}{} \AND \equal{##2}{} \AND \equal{##3}{}} {% + \immediate\write\exportdata{ v_yes: 0}% + \immediate\write\exportdata{ v_no: 0}% + \immediate\write\exportdata{ v_neutral: 0}% + \immediate\write\exportdata{ accepted: 1}% Der Antrag wurde ohne Gegenrede angenommen.% } {% + \immediate\write\exportdata{ v_yes: ##1}% + \immediate\write\exportdata{ v_no: ##2}% + \immediate\write\exportdata{ v_neutral: ##3}% Dafür: ##1, Dagegen: ##2, Enthaltungen: ##3% \\% \setcounter{x}{##2+##3}% \ifnum##1>\arabic{x}% - {Der Antrag wurde angenommen.}% + {% + \immediate\write\exportdata{ accepted: 1}% + Der Antrag wurde angenommen. + }% \else% - {Der Antrag wurde abgelehnt.}% + { + \immediate\write\exportdata{ accepted: 0}% + Der Antrag wurde abgelehnt. + }% \fi% }% }% - \newcommand*{\voteComment}[1]{##1}% + \newcommand*{\voteComment}[1]{% + \immediate\write\exportdata{ comment: "##1"}% + ##1 + }% } { \end{minipage}\end{lrbox}\fbox{\usebox{\mybox}} - \immediate\write\exportdata{ - }% } % poll environment @@ -195,7 +220,7 @@ } \AtEndDocument{% - \immediate\write18{mv tmp.txt \the\date.txt} + \immediate\write18{mv tmp.txt \the\date.yaml} \immediate\closeout\exportdata% } diff --git a/protokoll/protokoll.tex b/protokoll/protokoll.tex index e0321f7..aeef4ff 100644 --- a/protokoll/protokoll.tex +++ b/protokoll/protokoll.tex @@ -57,7 +57,7 @@ % % Die Reihenfolge muss beibehalten werden. % \begin{vote} -% % \voteMoney{} % {Betrag (ohne \EUR)} nur bei Finanzantrag +% \voteMoney{} % {Betrag (ohne \EUR)} nur bei Finanzantrag, sonst leer lassen % \voteNumber{} % {#Antrag} % \voteText{} % \voteReason{}