Skip to content

Commit 937e60c

Browse files
committed
scrot and cache
1 parent d2d9649 commit 937e60c

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ optional arguments:
3333
Specify alternative directory [default:current directory]
3434
--css_file CSS_FILE css-file-path; its content will be written to the <style> element
3535
--live_md_rr LIVE_MD_RR, -l LIVE_MD_RR
36-
continuous refresh rate of MD page, in ms
36+
Continuous refresh rate of MD page, in ms. Respects cache
3737
```
3838

3939
### Markdown-to-HTML Out-File

httpmdhtml/md_to_html.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def markdown_to_html(MarkdownIt_obj, in_file_path, out_file_path="tmp.html",
2121
soup = BeautifulSoup(html_text, 'html5lib') # adds <html>, <head>, <body>
2222
soup.select_one('head').append(soup.new_tag("meta"))
2323
soup.select_one('meta').attrs['charset'] = "UTF-8"
24+
# if lots of images, caching is preferable more often than not
25+
# soup.select_one('meta').attrs['http-equiv'] = "Cache-control"
26+
# soup.select_one('meta').attrs['content'] = "no-cache"
2427
soup.select_one('head').append(soup.new_tag("style"))
2528
if css_file:
2629
with open(css_file, 'r') as f:

httpmdhtml/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def do_GET(self, rm_temp_html=False):
7676
parser.add_argument('--css_file', default=None,
7777
help='css-file-path; its content will be written to the <style> element')
7878
parser.add_argument('--live_md_rr', '-l', action='store', type=int, default=None,
79-
help='continuous refresh rate of MD page, in ms')
79+
help='Continuous refresh rate of MD page, in ms. Respects cache')
8080
parser.add_argument('port', action='store',
8181
default=8000, type=int,
8282
nargs='?',

scrot.png

-18.3 KB
Loading

0 commit comments

Comments
 (0)