File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,11 @@ def markdown_to_html(
31
31
# soup.select_one('meta').attrs['content'] = "no-cache"
32
32
soup .select_one ("head" ).append (soup .new_tag ("style" ))
33
33
if css_file :
34
- with open (css_file , "r" ) as f :
35
- css = f .read ()
34
+ if css_file == "none" :
35
+ css = ""
36
+ else :
37
+ with open (css_file , "r" ) as f :
38
+ css = f .read ()
36
39
else :
37
40
css = """body { background-color: #272822; color: white; font-family: Courier; }
38
41
a[href] { color: #66d9ef; }
@@ -81,7 +84,7 @@ def markdown_to_html(
81
84
parser .add_argument (
82
85
"--css_file" ,
83
86
default = None ,
84
- help = " css-file-path; its content will be written to the <style> element" ,
87
+ help = ' css-file-path whose content will be written to the <style> element. Can be "none"; do not use any css' ,
85
88
)
86
89
args = parser .parse_args ()
87
90
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ def do_GET(self, rm_temp_html=False):
90
90
parser .add_argument (
91
91
"--css_file" ,
92
92
default = None ,
93
- help = " css-file-path; its content will be written to the <style> element" ,
93
+ help = ' css-file-path whose content will be written to the <style> element. Can be "none"; do not use any css' ,
94
94
)
95
95
parser .add_argument (
96
96
"--live_md_rr" ,
@@ -115,7 +115,9 @@ def do_GET(self, rm_temp_html=False):
115
115
MarkdownIt_obj = (
116
116
MarkdownIt ("commonmark" ).enable ("table" ).enable ("strikethrough" )
117
117
)
118
- if args .css_file and not os .path .isfile (args .css_file ):
118
+ if args .css_file and all (
119
+ (args .css_file != "none" , not os .path .isfile (args .css_file ))
120
+ ):
119
121
raise FileNotFoundError (
120
122
f"looks like the given `css_file` argument's value - { args .css_file } - cannot be found"
121
123
)
Original file line number Diff line number Diff line change 6
6
7
7
setup (
8
8
name = "httpmdhtml" ,
9
- version = "0.0.7 " ,
9
+ version = "0.0.8 " ,
10
10
license = "gpl-3.0" ,
11
11
author = "John Hupperts" ,
12
12
13
13
description = "HTTP server that converts markdown to HTML" ,
14
14
long_description = long_description ,
15
15
long_description_content_type = "text/markdown" ,
16
16
url = "https://github.com/treatmesubj/python-md-to-html-server" ,
17
- download_url = "https://github.com/treatmesubj/python-md-to-html-server/archive/refs/tags/v0.0.7 .tar.gz" ,
17
+ download_url = "https://github.com/treatmesubj/python-md-to-html-server/archive/refs/tags/v0.0.8 .tar.gz" ,
18
18
packages = ["httpmdhtml" ],
19
19
package_dir = {"python-md-to-html-server" : "httpmdhtml" },
20
20
project_urls = {
You can’t perform that action at this time.
0 commit comments