diff options
| author | Cary Coutant <ccoutant@gmail.com> | 2023-03-27 12:28:29 -0700 | 
|---|---|---|
| committer | Cary Coutant <ccoutant@gmail.com> | 2023-03-27 12:28:29 -0700 | 
| commit | c8573a20879151cdbaffa206e92f9143d27ca696 (patch) | |
| tree | 48a26e9b1fb34fc7f8dddfe44bdf67f91ddda7e2 /tools | |
| parent | Add Copyright, GPL3 notice, and usage messages. (diff) | |
Add Format: metadata tag to issues file; remove -p flag from md-wrapper.py.
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/build.sh | 2 | ||||
| -rwxr-xr-x | tools/md-wrapper.py | 7 | 
2 files changed, 3 insertions, 6 deletions
diff --git a/tools/build.sh b/tools/build.sh index fbf4f78..16eb8a2 100755 --- a/tools/build.sh +++ b/tools/build.sh  | |||
| @@ -43,7 +43,7 @@ echo "Generating issue pages..." | |||
| 43 | for f in $SRCDIR/issues/*.md | 43 | for f in $SRCDIR/issues/*.md | 
| 44 | do | 44 | do | 
| 45 | b=$(basename "$f" ".md") | 45 | b=$(basename "$f" ".md") | 
| 46 | $TOOLSDIR/md-wrapper.py -p -r "$DESTDIR" -t "$ISSUE_TEMPLATE" "$f" "$DESTDIR/issues/$b.html" | 46 | $TOOLSDIR/md-wrapper.py -r "$DESTDIR" -t "$ISSUE_TEMPLATE" "$f" "$DESTDIR/issues/$b.html" | 
| 47 | done | 47 | done | 
| 48 | 48 | ||
| 49 | # Build the issue indexes | 49 | # Build the issue indexes | 
diff --git a/tools/md-wrapper.py b/tools/md-wrapper.py index 7fed69e..a9cf2d8 100755 --- a/tools/md-wrapper.py +++ b/tools/md-wrapper.py  | |||
| @@ -39,12 +39,11 @@ import html | |||
| 39 | def usage(): | 39 | def usage(): | 
| 40 | sys.stderr.write("usage: md-wrapper.py [-r root-dir] [-t template-file] source.md dest.html\n") | 40 | sys.stderr.write("usage: md-wrapper.py [-r root-dir] [-t template-file] source.md dest.html\n") | 
| 41 | 41 | ||
| 42 | is_proposal = False | ||
| 43 | root_dir = "" | 42 | root_dir = "" | 
| 44 | template_file = "" | 43 | template_file = "" | 
| 45 | 44 | ||
| 46 | try: | 45 | try: | 
| 47 | opts, args = getopt.getopt(sys.argv[1:], "hpr:t:") | 46 | opts, args = getopt.getopt(sys.argv[1:], "hr:t:") | 
| 48 | except getopt.GetoptError as err: | 47 | except getopt.GetoptError as err: | 
| 49 | sys.stderr.write(str(err) + "\n") | 48 | sys.stderr.write(str(err) + "\n") | 
| 50 | usage() | 49 | usage() | 
| @@ -53,8 +52,6 @@ for o, a in opts: | |||
| 53 | if o == "-h": | 52 | if o == "-h": | 
| 54 | usage() | 53 | usage() | 
| 55 | sys.exit(0) | 54 | sys.exit(0) | 
| 56 | elif o == "-p": | ||
| 57 | is_proposal = True | ||
| 58 | if o == "-r": | 55 | if o == "-r": | 
| 59 | root_dir = a | 56 | root_dir = a | 
| 60 | elif o == "-t": | 57 | elif o == "-t": | 
| @@ -93,7 +90,7 @@ with open(source_file, 'r', encoding="utf-8") as f: | |||
| 93 | with open(template_file, 'r', encoding="utf-8") as f: | 90 | with open(template_file, 'r', encoding="utf-8") as f: | 
| 94 | tmpl = f.read() | 91 | tmpl = f.read() | 
| 95 | 92 | ||
| 96 | if is_proposal and not "markdown" in vars: | 93 | if "format" in vars and vars["format"] != "markdown": | 
| 97 | vars["content"] = '<pre class=\"proposal\">\n' + html.escape(text) + "</pre>\n" | 94 | vars["content"] = '<pre class=\"proposal\">\n' + html.escape(text) + "</pre>\n" | 
| 98 | else: | 95 | else: | 
| 99 | vars["content"] = markdown.markdown(text, extensions = ['tables']) | 96 | vars["content"] = markdown.markdown(text, extensions = ['tables']) | 
