From 712a8bd0adafa4d6768da0b66bba30864b896fc0 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 27 Apr 2014 20:23:09 +0100 Subject: [PATCH] org-mode subsections --- makeJargon.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/makeJargon.py b/makeJargon.py index 29012f3..2bf9639 100755 --- a/makeJargon.py +++ b/makeJargon.py @@ -113,7 +113,6 @@ def jargonToManpage(manpageFilename, entries, version, publishername): fp.write(".SH " + title + "\n") fp.write(text + "\n\n") - fp.close() os.system("gzip " + manpageFilename) @@ -145,6 +144,7 @@ def jargonToOrgMode(orgFilename, entries, version, publishername): fp.write("* Glossary\n") + subsection = '' for entry in entries: title = entry[0] text = entry[1] @@ -152,7 +152,11 @@ def jargonToOrgMode(orgFilename, entries, version, publishername): if definitions > 1: text = jargonWithDefinitions(text, definitions) - fp.write("** " + title + "\n") + if title[0:1] != subsection: + subsection = title[0:1] + fp.write("** " + subsection.upper() + "\n") + + fp.write("*** " + title + "\n") fp.write(text + "\n\n") fp.close()