Minor fixes

This commit is contained in:
Knoch 2023-04-26 08:58:16 +02:00
parent ccad5282c5
commit 4cddcc259d
27 changed files with 14 additions and 7 deletions

0
.gitignore vendored Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
autocompile.sh Normal file → Executable file
View File

0
cache.py Normal file → Executable file
View File

0
chapters.py Normal file → Executable file
View File

0
fragments.py Normal file → Executable file
View File

0
help-menu.html Normal file → Executable file
View File

0
helper.py Normal file → Executable file
View File

13
main.py
View File

@ -12,14 +12,17 @@ import helper
# stores it in a corresponding slides.lang.html file inside the same directory. # 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() wrapper = open(os.path.join(root, 'layouts/root.html'), 'r').read()
compiled_chapters = chapters.compile_chapters(root, language, force_recompile) compiled_chapters = chapters.compile_chapters(root, language, force_recompile)
wrapper = wrapper.replace('@slides', compiled_chapters) wrapper = wrapper.replace('@slides', compiled_chapters)
wrapper = helper.insert_metadata(wrapper, root, language) wrapper = helper.insert_metadata(wrapper, root, language)
wrapper = fragments.defragmentize(wrapper) wrapper = fragments.defragmentize(wrapper)
wrapper = helper.add_lazyload(wrapper, lazyload_images) 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: with open(os.path.join(root, 'slides.' + language + '.html'), 'w+') as output:
output.write(wrapper) output.write(wrapper)
print('done') print('done')
@ -34,15 +37,17 @@ if __name__ == '__main__':
help="recompile the entire presentation without caches") help="recompile the entire presentation without caches")
parser.add_argument("-i", "--lazyload-images", action='store_true', parser.add_argument("-i", "--lazyload-images", action='store_true',
help="replace all images' src attributes by data-src for image lazyloading") 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() args = parser.parse_args()
force_recompile = False or args.force_recompile force_recompile = False or args.force_recompile
lazyload_images = False or args.lazyload_images lazyload_images = False or args.lazyload_images
no_helpmenu = False or args.nohelpmenu
if args.language == "all": if args.language == "all":
for language in helper.get_available_languages(args.rootdirectory): for language in helper.get_available_languages(args.rootdirectory):
compile(args.rootdirectory, language=language, 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: else:
compile(args.rootdirectory, language=args.language, 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
View File

0
requirements.txt Normal file → Executable file
View File

0
slides.py Normal file → Executable file
View File

0
structure-draft Normal file → Executable file
View File

0
test/.gitignore vendored Normal file → Executable file
View File

0
test/images/.gitkeep Normal file → Executable file
View File

0
test/layouts/default.html Normal file → Executable file
View File

4
test/layouts/root.html Normal file → Executable file
View File

@ -4,11 +4,13 @@
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge"/> <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> <title>@title</title>
</head> </head>
<body> <body>
@slides <!-- reserved keyword --> @slides <!-- reserved keyword -->
<!-- FIXME: Make this script work again. -->
<script src="../slidify.js"></script> <script src="../slidify.js"></script>
</body> </body>
</html> </html>

0
test/layouts/titlepage.html Normal file → Executable file
View File

0
test/meta.yml Normal file → Executable file
View File

0
test/package-lock.json generated Normal file → Executable file
View File

0
test/package.json Normal file → Executable file
View File

0
test/slides.yml Normal file → Executable file
View File

0
test/slides/chapter1.de.md Normal file → Executable file
View File

0
test/slides/chapter1.en.md Normal file → Executable file
View File

0
test/slides/chapter2.de.md Normal file → Executable file
View File

0
test/slides/chapter2.en.md Normal file → Executable file
View File

4
test/styles/style.css Normal file → Executable file
View File

@ -33,7 +33,7 @@ h1 {
display: contents; display: contents;
} }
article { section {
display: none; display: none;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -44,7 +44,7 @@ h1 {
height: 100vh; height: 100vh;
} }
article:target { section:target {
display: flex; display: flex;
} }
} }