Merge branch 'master' into release
This commit is contained in:
commit
f6959e532a
@ -23,6 +23,7 @@ We recommend you to structure your project directory like this:
|
|||||||
│ └── titlepage.html
|
│ └── titlepage.html
|
||||||
├── meta.yml
|
├── meta.yml
|
||||||
├── onpoint
|
├── onpoint
|
||||||
|
│ ├── autocompile.sh
|
||||||
│ ├── main.py
|
│ ├── main.py
|
||||||
│ ├── README.md
|
│ ├── README.md
|
||||||
│ └── requirements.txt
|
│ └── requirements.txt
|
||||||
@ -45,4 +46,10 @@ We recommend you to structure your project directory like this:
|
|||||||
|
|
||||||
## Updating onPoint
|
## Updating onPoint
|
||||||
|
|
||||||
In order to update the version of onPoint in an existing project, simply enter the `onpoint` directory and run `git pull`.
|
In order to update the version of onPoint in an existing project, simply enter the `onpoint` directory and run `git pull`.
|
||||||
|
|
||||||
|
## Auto-compile during Development
|
||||||
|
|
||||||
|
You might want to have all slides auto-compiled for you on safe. For this case, we wrote a small bash script that spawns a file watcher to compile your presentation once any markdown file in the slides folder is saved. Simply run `./onpoint/autocompile.sh` from your project root folder.
|
||||||
|
|
||||||
|
You will need Python and `inotify-tools` to execute the script.
|
||||||
6
autocompile.sh
Executable file
6
autocompile.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
# Requirements: inotify-tools, python3
|
||||||
|
|
||||||
|
while inotifywait -e close_write ./slides/*.md; do
|
||||||
|
python3 ./onpoint/main.py .
|
||||||
|
done
|
||||||
13
main.py
13
main.py
@ -124,11 +124,20 @@ def read_yaml(path):
|
|||||||
except yaml.YAMLError as exc:
|
except yaml.YAMLError as exc:
|
||||||
print(exc)
|
print(exc)
|
||||||
|
|
||||||
|
#
|
||||||
|
def get_available_languages():
|
||||||
|
return read_yaml('./meta.yml')['language']
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("rootdirectory", help="your project's root directory")
|
parser.add_argument("rootdirectory", help="your project's root directory")
|
||||||
parser.add_argument("-l", "--language", default="de", help="the presentation language (default: de)")
|
parser.add_argument("-l", "--language", default="all", help="the presentation language (default: all)")
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
compile(args.rootdirectory, language=args.language)
|
|
||||||
|
if args.language == "all":
|
||||||
|
for language in get_available_languages():
|
||||||
|
compile(args.rootdirectory, language=language)
|
||||||
|
else:
|
||||||
|
compile(args.rootdirectory, language=args.language)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user