mirror of
https://gitlab.com/parroquia-san-leandro/cancionero-web.git
synced 2025-04-27 23:55:57 +02:00
songbook generator
This commit is contained in:
parent
c084ca2d89
commit
6535d4d7dd
5 changed files with 158 additions and 4 deletions
|
@ -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]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue