Minor fixes
This commit is contained in:
parent
ccad5282c5
commit
4cddcc259d
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
autocompile.sh
Normal file → Executable file
0
autocompile.sh
Normal file → Executable file
0
chapters.py
Normal file → Executable file
0
chapters.py
Normal file → Executable file
0
fragments.py
Normal file → Executable file
0
fragments.py
Normal file → Executable file
0
help-menu.html
Normal file → Executable file
0
help-menu.html
Normal file → Executable file
13
main.py
13
main.py
@ -12,14 +12,17 @@ import helper
|
||||
# stores it in a corresponding slides.lang.html file inside the same directory.
|
||||
|
||||
|
||||
def compile(root, language='en', force_recompile=False, lazyload_images=False):
|
||||
def compile(root, language='en', force_recompile=False, lazyload_images=False, no_helpmenu=False):
|
||||
wrapper = open(os.path.join(root, 'layouts/root.html'), 'r').read()
|
||||
compiled_chapters = chapters.compile_chapters(root, language, force_recompile)
|
||||
wrapper = wrapper.replace('@slides', compiled_chapters)
|
||||
wrapper = helper.insert_metadata(wrapper, root, language)
|
||||
wrapper = fragments.defragmentize(wrapper)
|
||||
wrapper = helper.add_lazyload(wrapper, lazyload_images)
|
||||
wrapper = helper.add_help_menu(wrapper, root)
|
||||
|
||||
if not no_helpmenu:
|
||||
wrapper = helper.add_help_menu(wrapper, root)
|
||||
|
||||
with open(os.path.join(root, 'slides.' + language + '.html'), 'w+') as output:
|
||||
output.write(wrapper)
|
||||
print('done')
|
||||
@ -34,15 +37,17 @@ if __name__ == '__main__':
|
||||
help="recompile the entire presentation without caches")
|
||||
parser.add_argument("-i", "--lazyload-images", action='store_true',
|
||||
help="replace all images' src attributes by data-src for image lazyloading")
|
||||
parser.add_argument("-n", "--nohelpmenu", action="store_true", help="do not compile the help menu")
|
||||
|
||||
args = parser.parse_args()
|
||||
force_recompile = False or args.force_recompile
|
||||
lazyload_images = False or args.lazyload_images
|
||||
no_helpmenu = False or args.nohelpmenu
|
||||
|
||||
if args.language == "all":
|
||||
for language in helper.get_available_languages(args.rootdirectory):
|
||||
compile(args.rootdirectory, language=language,
|
||||
force_recompile=force_recompile, lazyload_images=lazyload_images)
|
||||
force_recompile=force_recompile, lazyload_images=lazyload_images, no_helpmenu=no_helpmenu)
|
||||
else:
|
||||
compile(args.rootdirectory, language=args.language,
|
||||
force_recompile=force_recompile, lazyload_images=lazyload_images)
|
||||
force_recompile=force_recompile, lazyload_images=lazyload_images, no_helpmenu=no_helpmenu)
|
||||
|
||||
0
onpoint.js
Normal file → Executable file
0
onpoint.js
Normal file → Executable file
0
requirements.txt
Normal file → Executable file
0
requirements.txt
Normal file → Executable file
0
structure-draft
Normal file → Executable file
0
structure-draft
Normal file → Executable file
0
test/.gitignore
vendored
Normal file → Executable file
0
test/.gitignore
vendored
Normal file → Executable file
0
test/images/.gitkeep
Normal file → Executable file
0
test/images/.gitkeep
Normal file → Executable file
0
test/layouts/default.html
Normal file → Executable file
0
test/layouts/default.html
Normal file → Executable file
4
test/layouts/root.html
Normal file → Executable file
4
test/layouts/root.html
Normal file → Executable file
@ -4,11 +4,13 @@
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
|
||||
<link rel="stylesheet" href="styles/style.css"/>
|
||||
<!-- FIXME: Make this stylesheet work again. -->
|
||||
<!--link rel="stylesheet" href="styles/style.css"/-->
|
||||
<title>@title</title>
|
||||
</head>
|
||||
<body>
|
||||
@slides <!-- reserved keyword -->
|
||||
<!-- FIXME: Make this script work again. -->
|
||||
<script src="../slidify.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
0
test/layouts/titlepage.html
Normal file → Executable file
0
test/layouts/titlepage.html
Normal file → Executable file
0
test/meta.yml
Normal file → Executable file
0
test/meta.yml
Normal file → Executable file
0
test/package-lock.json
generated
Normal file → Executable file
0
test/package-lock.json
generated
Normal file → Executable file
0
test/package.json
Normal file → Executable file
0
test/package.json
Normal file → Executable file
0
test/slides.yml
Normal file → Executable file
0
test/slides.yml
Normal file → Executable file
0
test/slides/chapter1.de.md
Normal file → Executable file
0
test/slides/chapter1.de.md
Normal file → Executable file
0
test/slides/chapter1.en.md
Normal file → Executable file
0
test/slides/chapter1.en.md
Normal file → Executable file
0
test/slides/chapter2.de.md
Normal file → Executable file
0
test/slides/chapter2.de.md
Normal file → Executable file
0
test/slides/chapter2.en.md
Normal file → Executable file
0
test/slides/chapter2.en.md
Normal file → Executable file
4
test/styles/style.css
Normal file → Executable file
4
test/styles/style.css
Normal file → Executable file
@ -33,7 +33,7 @@ h1 {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
article {
|
||||
section {
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@ -44,7 +44,7 @@ h1 {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
article:target {
|
||||
section:target {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user