aboutsummaryrefslogtreecommitdiff
path: root/scripts/reqs2tex.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/reqs2tex.py')
-rwxr-xr-xscripts/reqs2tex.py32
1 files changed, 19 insertions, 13 deletions
diff --git a/scripts/reqs2tex.py b/scripts/reqs2tex.py
index 667eeb6..3bf0501 100755
--- a/scripts/reqs2tex.py
+++ b/scripts/reqs2tex.py
@@ -68,22 +68,28 @@ def convert(data):
return reqs
-def req2aux(req):
- ref = tex.label2ref(req['label'])
- out = [
- tex.cmd('newlabel', f"{ref}", tex.group(req['id'], req['id'], 'ggg', 'hhh', 'iii')),
- tex.cmd('newlabel', f"{ref}@cref", tex.group(f"[requirement][aaa][bbb]{req['id']}", '[ccc][ddd][eee]fff')),
- ]
- return "\n".join(out)
-
def fmt_aux(data):
- out = "\n".join([req2aux(req) for req in data])
- return out
+ out = []
+ for req in data:
+ ref = tex.label2ref(req['label'])
+ out += [
+ tex.cmd('newlabel', f"{ref}", tex.group(req['id'], req['id'], 'ggg', 'hhh', 'iii')),
+ tex.cmd('newlabel', f"{ref}@cref", tex.group(f"[requirement][aaa][bbb]{req['id']}", '[ccc][ddd][eee]fff')),
+ ]
+ return "\n".join(out)
def fmt_tex(data):
- return "\n".join([
- tex.cmd('relax')
- ])
+ out = []
+ for req in data:
+ out.append(
+ tex.cmd('subsection', req['id']) + "\n\n" +\
+ tex.env('description',
+ tex.cmd('item', ['Priority']) + req['priority'].title() +\
+ tex.cmd('item', ['Requirement']) + req['description'] +\
+ (tex.cmd('item', ['Definition of done']) + req['done'] if req['type'] == 'user' else "")
+ )
+ )
+ return "\n\n".join(out)
def main(input_file):
data = {}