-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Docker container with a html file server #21
base: master
Are you sure you want to change the base?
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}
.