songbook generator

This commit is contained in:
Carlos Galindo 2021-10-01 18:26:40 +02:00
parent c084ca2d89
commit 6535d4d7dd
5 changed files with 158 additions and 4 deletions

View file

@ -278,21 +278,21 @@ class SongLoader:
self.print_index(join(output_dir, "index.html"), dj_engine)
def parse_args():
def create_argparser():
parser = argparse.ArgumentParser()
parser.add_argument("--latex", required=True, nargs=1, help="The main LaTeX file. It may include other documents")
parser.add_argument("--other-latex", required=False, nargs=1, default=[None],
help="A folder with songs, those not referenced in the main file will be included at the end.")
parser.add_argument("--other-index", required=False, nargs=1, default=["400"],
parser.add_argument("--other-index", required=False, nargs=1, type=int, default=[400],
help="The first song number for songs outside the main songbook.")
parser.add_argument("--audios", required=False, nargs=1, default=[None],
help="The folder containing the audio files.")
parser.add_argument("--output-dir", required=False, nargs=1, default=["public"])
return parser.parse_args()
return parser
if __name__ == '__main__':
args = parse_args()
args = create_argparser().parse_args()
loader = SongLoader(args.latex[0], args.audios[0])
if args.other_latex:
loader.scan_others(args.other_latex[0], int(args.other_index[0]))