[WIP] Docker container with a html file server#21
[WIP] Docker container with a html file server#21eitsupi wants to merge 4 commits intoktaaaki:masterfrom
Conversation
|
To omit the step 2 (pasting the request url into the browser), you can automatically convert a pdf triggered by the addition of the pdf to the file server. The code to convert a pdf from folder monitoring is as follows. class PdfFileEventHandler(PatternMatchingEventHandler):
def __init__(self, patterns=("*.pdf",), ignore_patterns=None, ignore_directories=True, case_sensitive=False,
debug=False):
super().__init__(patterns, ignore_patterns, ignore_directories, case_sensitive)
self.debug = debug
def on_any_event(self, event):
if not os.path.exists(event.src_path):
return
n_div_paragraph = math.inf
line_margin_rate = None
verbose = self.debug
Paper.n_div_paragraph = n_div_paragraph
paper2html(event.src_path, cache_dir, line_margin_rate, verbose)See |
|
@ktaaaki It looks work! However, it seems that extra triggers can generate extra files ( |
|
That was because the file system watcher is different from my environment. |
|
@ktaaaki I tried the latest But, I found another bug. open ↑ directory. This is a bug in |
|
Percent encoded slashes may make those errors. |
This reverts commit 08cd130.




Early steps in a approach to solving #19 with a html file server.
I'm using go-http-file-server on this trial basis now.
{filename.pdf}to the file serverlocalhost:8080.http://localhost:5000/paper2html?url=http://htmlserver:8080/{filename.pdf}.