Merge branch 'master' into release
This commit is contained in:
commit
a6d5079473
21
main.py
21
main.py
@ -1,10 +1,11 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import yaml
|
import argparse
|
||||||
import pypandoc
|
|
||||||
import os
|
import os
|
||||||
|
import pypandoc
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
import yaml
|
||||||
|
|
||||||
root = ""
|
root = ""
|
||||||
lang = "de"
|
lang = "de"
|
||||||
@ -123,15 +124,11 @@ def read_yaml(path):
|
|||||||
except yaml.YAMLError as exc:
|
except yaml.YAMLError as exc:
|
||||||
print(exc)
|
print(exc)
|
||||||
|
|
||||||
# Print information on how to use this program.
|
|
||||||
def print_usage():
|
|
||||||
print("Usage: python3 main.py <root-directory>")
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) != 2:
|
parser = argparse.ArgumentParser()
|
||||||
print_usage()
|
parser.add_argument("rootdirectory", help="your project's root directory (default: .)")
|
||||||
else:
|
parser.add_argument("-l", "--language", default="de", help="the presentation language (default: de)")
|
||||||
compile(sys.argv[1], language='de')
|
|
||||||
# TODO: Handle multiple languages
|
args = parser.parse_args()
|
||||||
# compile(sys.argv[1], language='en')
|
compile(args.rootdirectory, language=args.language)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user