Skip to content

Commit 3cc805f

Browse files
committed
sort as specified in schema
1 parent 1ab306b commit 3cc805f

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

doc/ReleaseNotes/develop.tex.jinja

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
([ for section_key, section_items in items|groupby("section") ])
2-
\subsection{(( sections[section_key].title() ))}
3-
([ for subsection_key, subsection_items in section_items|groupby("subsection") ])
4-
([ set subsection = subsections[subsection_key] ])
5-
([ if subsection|length > 0 ])
6-
\subsubsection{(( subsection.title() ))}
1+
([ for section_key, section_name in sections.items() ])
2+
([ set section_items = items|selectattr("section", "equalto", section_key)|list ])
3+
([ if section_items ])
4+
\subsection{(( section_name.title() ))}
5+
([ for subsection_key, subsection_name in subsections.items() ])
6+
([ set subsection_items = section_items|selectattr("subsection", "equalto", subsection_key)|list ])
7+
([ if subsection_items ])
8+
([ if subsection_name|length > 0 ])
9+
\subsubsection{(( subsection_name.title() ))}
710
([ endif ])
811

912
\begin{itemize}
1013
([ for item in subsection_items ])
1114
\item (( item.description ))
1215
([ endfor ])
1316
\end{itemize}
17+
([ endif ])
1418
([ endfor ])
19+
([ endif ])
1520
([ endfor ])

doc/ReleaseNotes/mk_releasenotes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@
6767
if patch:
6868
items = [item for item in items if item["section"] == "fixes"]
6969
sections = {k: v for k, v in sections.items() if k == "fixes"}
70-
subsections = {
71-
k: subsections[k] for k in [item["subsection"] for item in items]
72-
}
70+
used_subsections = {item["subsection"] for item in items}
71+
subsections = {k: v for k, v in subsections.items() if k in used_subsections}
7372
# make sure each item has a subsection entry even if empty
7473
for item in items:
7574
if not item.get("subsection"):

doc/ReleaseNotes/schema.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[sections]
22
features = "NEW FUNCTIONALITY"
3-
fixes = "BUG FIXES AND OTHER CHANGES TO EXISTING FUNCTIONALITY"
43
examples = "EXAMPLES"
4+
fixes = "BUG FIXES AND OTHER CHANGES TO EXISTING FUNCTIONALITY"
55

66
[subsections]
77
basic = "BASIC FUNCTIONALITY"
8-
model = "MODEL"
98
internal = "INTERNAL FLOW PACKAGES"
109
stress = "STRESS PACKAGES"
1110
advanced = "ADVANCED STRESS PACKAGES"
12-
solution = "SOLUTION"
11+
model = "MODEL"
1312
exchanges = "EXCHANGES"
13+
solution = "SOLUTION"
1414
parallel = "PARALLEL"
1515
netcdf = "NETCDF"

0 commit comments

Comments
 (0)