forked from EddyRivasLab/easel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates man pages and man->tex conversion; adds rmanprocess.py
- Loading branch information
1 parent
745a9a1
commit b11c190
Showing
26 changed files
with
1,652 additions
and
1,436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ m4_include([m4/ax_pthread.m4]) | |
################################################################ | ||
# 2. AC_INIT | ||
################################################################ | ||
AC_INIT(Easel, 0.44rc1, [email protected], easel) | ||
AC_INIT(Easel, 0.44, [email protected], easel) | ||
AC_MSG_NOTICE([Configuring the Easel library for your system.]) | ||
|
||
# remember if the user is overriding CFLAGS | ||
|
@@ -108,7 +108,7 @@ fi | |
# EASEL_VERSION e.g. "1.9a" | ||
# | ||
|
||
EASEL_DATE="March 2018" | ||
EASEL_DATE="April 2018" | ||
EASEL_COPYRIGHT="Copyright (C) 2018 Howard Hughes Medical Institute" | ||
EASEL_LICENSE="Freely distributed under the BSD open source license." | ||
EASEL_VERSION=$PACKAGE_VERSION | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#! /usr/bin/env python | ||
|
||
# rmanprocess.py | ||
# Massages output of PolyGlotMan's `rman -f latex2e` to fit Tufteian userguide style. | ||
# Example: | ||
# rman -f latex2e hmmbuild.man | rmanprocess.py > manpage.tex | ||
# | ||
|
||
|
||
import sys | ||
import re | ||
|
||
in_synopsis = False | ||
|
||
if len(sys.argv) == 1: | ||
f = sys.stdin | ||
else: | ||
f = open(sys.argv[1]) | ||
|
||
for line in f: | ||
line = line.rstrip('\n') | ||
|
||
# State flags (where are we in the document) | ||
if re.match(r'\\section{Synopsis}', line): | ||
in_synopsis = True | ||
elif re.match(r'\\section{', line): | ||
in_synopsis = False | ||
|
||
# | ||
# Linewise substitutions: replace certain entire lines with something else. | ||
# | ||
# Remove \documentclass, and changes to \parindent and \parskip | ||
if re.match(r'\\documentclass', line): continue | ||
if re.match(r'\\setlength{\\parindent}', line): continue | ||
if re.match(r'\\setlength{\\parskip}', line): continue | ||
if re.match(r'\\begin\{document\}', line): continue | ||
|
||
# Replace \section{Name} with \section{progname - description}, using next line too. | ||
if re.match(r'\\section\{Name\}', line): | ||
for line in f: | ||
if not re.fullmatch(r'\s*', line): | ||
break | ||
m = re.match(r'(\S+)\s*\\?-\s*(.+)$', line) | ||
if m: | ||
print(r'\section{{\monob{{{0}}} - {1}}}'.format(m.group(1), m.group(2))) | ||
else: | ||
print("Error: no progname/description line found"); | ||
sys.exit(1) | ||
continue | ||
|
||
# Remove everything after \section{See Also), and finish. | ||
if re.match(r'\\section\{See', line) or re.match(r'\\end\{document', line): | ||
print("\\newpage"); | ||
break | ||
|
||
|
||
# | ||
# Extra directives: preface certain lines with something extra, but still | ||
# process the line. | ||
# | ||
|
||
# In synopsis, put \noindent in front of each commandline, and preserve the .B's as bold. | ||
if in_synopsis and re.match(r'\s*\\textbf{', line): | ||
line = re.sub(r'\\textbf\{', r'\\monob{', line) | ||
print("\\noindent") | ||
|
||
# | ||
# Substitutions within a line. | ||
# The order of these replacements is important. (More specific ones first.) | ||
# | ||
line = re.sub(r'\\begin\{itemize\}', r'\\begin{wideitem}', line) | ||
line = re.sub(r'\\end\{itemize\}', r'\\end{wideitem}', line) | ||
line = re.sub(r'\\section\{', r'\\subsection*{', line) # \subsection* suppresses inclusion in TOC | ||
line = re.sub(r'--', r'{-}{-}', line) | ||
line = re.sub(r'\\item\s*\[\\textbf', r'\\item [\\monob', line) # option names in .TP are emphasized bold | ||
line = re.sub(r'\\textbf\{\\% ', r'\\user{\\% ', line) # example command lines are bold, on their own line | ||
line = re.sub(r'\\textit\{', r'\\monoi{', line) # metavariables (options, args) are .I in man, mono italic in tex | ||
line = re.sub(r'\\textbf\{', r'\\mono{', line) # literals (commands, etc) are .B in man, normal mono in tex | ||
|
||
print(line) | ||
|
||
|
||
|
||
if f != sys.stdin: | ||
f.close() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.