Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Feature switch for edited volume
  • Loading branch information
Klaus Thoden committed Nov 13, 2018
1 parent bd9f730 commit 78961df
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions build_frontmatter.py
Expand Up @@ -682,7 +682,7 @@ def create_omp_native_xml(eoa_publication):
outfile.close()
# def create_omp_native_xml ends here

def create_xhtml(eoa_publication):
def create_xhtml(eoa_publication, edited):
"""Use the database infos for creating an XHTML file for pro business"""

# validate input
Expand Down Expand Up @@ -721,7 +721,10 @@ def create_xhtml(eoa_publication):
if len(authors_line) == 0:
authors_line = item_for_template["bookauthors"]

xhtml_string += "<li>{} (<i>{}</i>)</li>\n".format(chapter_title, authors_line)
if edited:
xhtml_string += "<li>{} (<i>{}</i>)</li>\n".format(chapter_title, authors_line)
else:
xhtml_string += "<li>{}</li>\n".format(chapter_title)

xhtml_string += "</ol>\n"
# the template file
Expand All @@ -740,6 +743,7 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument("publication", help="Series and number of publication without space (e.g. sources7).")
parser.add_argument("-r", "--remove", help="Remove the first page in case the chapter already contains an info page.", action="store_true")
parser.add_argument("-e", "--edited", help="If set, the publication is treated as edited volume. This prints authors' names in the xhtml mode.", action="store_true")
group = parser.add_mutually_exclusive_group()
group.add_argument("-p", "--pdf", action="store_true")
group.add_argument("-o", "--omp", action="store_true")
Expand All @@ -752,7 +756,7 @@ def main():
elif args.omp:
create_omp_native_xml(args.publication)
elif args.xhtml:
create_xhtml(args.publication)
create_xhtml(args.publication, args.edited)
else:
print_error("Specify whether you want the output as a PDF, OMP or XHTML input.")
sys.exit()
Expand Down

0 comments on commit 78961df

Please sign in to comment.