Commit 57c1ba7a authored by Björn Brandenburg's avatar Björn Brandenburg

deliberately order TOC of generated documentation

parent d0a2d4ff
...@@ -23,7 +23,7 @@ done ...@@ -23,7 +23,7 @@ done
FIND_OPTS+=( -print ) FIND_OPTS+=( -print )
# Compile all relevant *.v files # Compile all relevant *.v files
coq_makefile -f _CoqProject $(find "${FIND_OPTS[@]}" ) -o Makefile coq_makefile -f _CoqProject $(find "${FIND_OPTS[@]}" | scripts/module-toc-order.py ) -o Makefile
# Patch HTML target to switch out color, and # Patch HTML target to switch out color, and
# so that it parses comments and has links to ssreflect. # so that it parses comments and has links to ssreflect.
......
#!/usr/bin/env python3
import os
import sys
MODULE_ORDER = [
'behavior.time',
'behavior.job',
'behavior.schedule',
'behavior.service',
'behavior.arrival_sequence',
'behavior.ready',
'behavior',
'model.processor',
'model.readiness',
'model.preemption',
'model.task',
'model.priority',
'model.schedule',
'model',
'results',
'analysis',
'classic',
'util',
]
def modorder(fname):
modname = fname.replace('./', '').replace('.v', '').replace('/', '.')
for i, prefix in enumerate(MODULE_ORDER):
if modname.startswith(prefix):
return (i, modname)
return (len(MODULE_ORDER), modname)
def main():
lines = sys.stdin.readlines()
for l in sorted(lines, key=modorder):
print(l, end='')
if __name__ == '__main__':
main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment