18 Commits

Author SHA1 Message Date
Adrian Vollmer
2e8a3ee989 Use camel case in JS 2024-04-21 16:23:03 +02:00
Adrian Vollmer
9faf9ca98b Add URL pragma of main.js in python code 2024-04-21 14:56:22 +02:00
Adrian Vollmer
04777f15f8 Show version in HTML source 2024-04-09 18:45:53 +02:00
Adrian Vollmer
b37d287cc6 Fix fetch monkey patch
Wait for `global_context` to exist. Fix bug with b64 encoding. Respect
mime type.
2024-04-08 18:54:49 +02:00
Adrian Vollmer
f7530f8ff9 Fix source URL pragmas 2024-04-03 20:17:43 +02:00
Adrian Vollmer
0bde114839 Apply black 2024-03-31 10:56:04 +02:00
Adrian Vollmer
f6e6228bbf Reduce errors related to mime types
We don't need to know about the `ImportError` every time we guess a mime
type. Because an `ImportError` is also raised if `python-magic` is
installed but `libmagic1` is not present, we can handle this at the
beginning of the file.
2022-10-18 17:44:52 +02:00
Adrian Vollmer
31ff902098 Add fall back when guessing mime type
This fixes a bug that appears if the document is built on a system
without libmagic1. The python library python-magic uses it to guess the
mime type. We treat files with unknown mime type as `octet-stream`,
which causes them to be downloaded rather than displayed in the main
iframe. This results in lots of popups when opening the resulting HTML
file in a browser.

In this commit we add a fallback to the built-in library `mimetypes`
which gueses the mime type from the filename alone. This should work in
most cases but could still fail.

Close #2.
2022-10-18 17:30:40 +02:00
Adrian Vollmer
3958492feb Add revert flag 2022-10-18 17:24:47 +02:00
Adrian Vollmer
fadbb72e67 Add support for append-pre/post 2022-10-12 14:48:58 +02:00
Adrian Vollmer
25fb93219c Rename some files; fix sourceURL pragmas 2022-10-12 14:41:57 +02:00
Adrian Vollmer
b563da585e Improve docstring 2022-10-12 13:43:24 +02:00
Adrian Vollmer
e05de76bad Improve CSS embedding 2022-10-12 13:42:05 +02:00
Adrian Vollmer
74fc46e1d9 Gracefully handle missing files 2022-10-11 23:09:48 +02:00
Adrian Vollmer
150a7f2c76 Improve logging 2022-10-10 15:09:07 +02:00
Adrian Vollmer
223b88639f Use better mime type guessing 2022-10-09 12:15:54 +02:00
Adrian Vollmer
1924eb07a9 Implement Sphinx extension 2022-10-05 17:11:12 +02:00
Adrian Vollmer
0a82f2977c Fix setup cfg, rename directory, add 3rd party licenses 2022-10-05 12:17:14 +02:00