")
22 | class_data = {
23 | "ul": "list-disc font-serif",
24 | "li": "ml-8",
25 | "h2": "text-xl mt-2 pb-2 font-sans",
26 | "h1": "text-2xl mt-2 font-sans",
27 | "p": "font-serif my-1",
28 | "pre": "bg-gray-100 overflow-x-auto rounded p-2 mb-2 mt-2",
29 | # "img": "center", # 设置图片是否默认居中
30 | }
31 | for k, v in class_data.items():
32 | for item in e(k):
33 | t = PyQuery(item)
34 | t.add_class(v)
35 | page = e
36 | items = page("body").children()
37 | return "".join([str(PyQuery(e)) for e in items])
38 |
39 |
40 | def process_terminal(semi_html):
41 | semi_html += st.author_template
42 | st.author_template = ""
43 | temp = "
" + semi_html + "
"
44 | semi_html = process_html_elements(temp)
45 | return semi_html
46 |
47 |
48 | def vertical_to_fragment(vertical: str) -> str:
49 | fragments = vertical.split(st.op_index_fragment)
50 |
51 | fragment_list = [md_util.md_to_html(fragments[0])]
52 | template = "
{}
"
53 |
54 | for i in range(1, len(fragments)):
55 | fragment_list.append(template.format(i, md_util.md_to_html(fragments[i])))
56 |
57 | return "".join(fragment_list)
58 |
59 |
60 | def vertical_to_animate(vertical: str) -> str:
61 | animates = vertical.split(st.op_animate_section)
62 |
63 | animate_list = list()
64 | template = "{}"
65 |
66 | for i in range(len(animates)):
67 | animate_list.append(template.format(md_util.md_to_html(animates[i])))
68 |
69 | return "".join(animate_list)
70 |
71 |
72 | def horizontal_to_vertical(horizontal: str) -> str:
73 | verticals_divided_by_second = horizontal.split(st.op_second_section)
74 |
75 | sections = list()
76 | template_second = "
"
77 |
78 | for vertical_divided_by_second in verticals_divided_by_second:
79 | if vertical_divided_by_second.isspace():
80 | continue
81 | if st.op_animate_section in vertical_divided_by_second:
82 | verticals_divided_by_animate = vertical_divided_by_second.split(
83 | st.op_animate_section
84 | )
85 | template_animate = "
"
86 | for vertical_divided_by_animate in verticals_divided_by_animate:
87 | if vertical_divided_by_animate.isspace():
88 | continue
89 | sections.append(
90 | template_animate.format(
91 | process_terminal(
92 | vertical_to_animate(vertical_divided_by_animate)
93 | )
94 | )
95 | )
96 | elif st.op_index_fragment in vertical_divided_by_second:
97 | sections.append(
98 | template_second.format(
99 | process_terminal(vertical_to_fragment(vertical_divided_by_second))
100 | )
101 | )
102 | else:
103 | sections.append(
104 | template_second.format(
105 | process_terminal(md_util.md_to_html(vertical_divided_by_second))
106 | )
107 | )
108 |
109 | return "".join(sections)
110 |
111 |
112 | def md_divide_to_horizontal(content: str):
113 | horizontals = content.split(st.op_first_section)
114 |
115 | sections = list()
116 | template = "
"
117 |
118 | for horizontal in horizontals:
119 | if horizontal.isspace():
120 | continue
121 | html_second_sections = horizontal_to_vertical(horizontal)
122 |
123 | html = template.format(html_second_sections)
124 | sections.append(html)
125 |
126 | return "".join(sections)
127 |
128 |
129 | def get_body(content):
130 | html_first_sections = md_divide_to_horizontal(content)
131 | return html_first_sections
132 |
133 |
134 | def process_image_link():
135 | def func(link):
136 | new_name, err = file_util.get_image_to_target(
137 | link, st.filepath, st.images_foldpath
138 | )
139 |
140 | return (
141 | os.path.join(".", "static", st.images_foldname, new_name)
142 | if err is False
143 | else ""
144 | ), err
145 |
146 | st.content = md_util.process_images(st.content, func)
147 |
148 |
149 | def process_front_matter():
150 | if st.op_front_matter not in st.content:
151 | st.author_template = ""
152 | return
153 |
154 | parts = st.content.split(st.op_front_matter)
155 |
156 | front_matter = parts[0]
157 | st.content = "".join(parts[1:])
158 |
159 | try:
160 | data = json.loads(front_matter)
161 | except Exception as e:
162 | data = yaml.load(front_matter, Loader=yaml.SafeLoader)
163 |
164 | for department in data["departments"]:
165 | new_name, err = file_util.get_image_to_target(
166 | department["img"], st.filepath, st.images_foldpath
167 | )
168 | if err is False:
169 | department["img"] = os.path.join(
170 | ".", "static", st.images_foldname, new_name
171 | )
172 | department["name"] = department["name"].replace(" ", " ")
173 |
174 | st.author_template = st.author_template.render(author=data["author"], departments=data["departments"]) # type: ignore
175 |
176 |
177 | def process_static():
178 | if os.path.exists(st.output_foldpath) is True:
179 | shutil.rmtree(st.output_foldpath)
180 | os.mkdir(st.output_foldpath)
181 | shutil.copytree(st.static_path, st.static_foldpath)
182 |
183 |
184 | def converter(MDfilepath):
185 | st.Init(MDfilepath)
186 | process_static()
187 |
188 | st.template = Template(file_util.read(st.template_from))
189 | st.author_template = Template(file_util.read(st.authortemp_from))
190 |
191 | st.content = file_util.read(st.filepath)
192 | process_front_matter() # 解析markdown中的front_matter and render author_template(will change content)
193 | process_image_link() # 处理Markdown文本中的图片链接, 将它们get到静态文件, 同时修改content
194 |
195 | st.title = "".join(st.filename.split(".")[:-1])
196 | st.body = get_body(st.content)
197 |
198 | st.template = st.template.render(title=st.title, body=st.body)
199 |
200 | file_util.write(st.output_filepath, st.template)
201 |
--------------------------------------------------------------------------------
/src/settings.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | from jinja2 import Template
4 |
5 | settings_abspath = os.path.split(os.path.realpath(__file__))[0]
6 | projects_abspath = os.path.abspath(os.path.join(settings_abspath, ".."))
7 |
8 | static_path = os.path.join(projects_abspath, "src", "static")
9 | backup_path = os.path.join(projects_abspath, "src", "backup")
10 | template_from = os.path.join(backup_path, "template", "basetemp.html")
11 | authortemp_from = os.path.join(backup_path, "template", "authortemp.html")
12 |
13 | op_first_section = "\n---\n"
14 | op_second_section = "\n----\n"
15 | op_animate_section = "\n++++\n"
16 | op_index_fragment = "\n--\n"
17 | op_front_matter = "\n+++++\n"
18 |
19 | # 文件信息
20 | filename = str()
21 | filepath = str()
22 | output_foldname = "dist"
23 | output_filename = "index.html"
24 | output_foldpath = str()
25 | output_filepath = str()
26 | static_foldpath = str()
27 | images_foldname = "img" # 如果要修改还要修炼static下的img文件名,template中icon的文件路径
28 | images_foldpath = str()
29 |
30 | content = str() # MD内容
31 |
32 | template: str | Template = str() # HTML内容
33 | title = str()
34 | body = str()
35 |
36 | # 作者信息相关
37 | author_template: str | Template = str()
38 |
39 |
40 | def Init(target_filepath):
41 | global filename, filepath, output_foldname, output_filename, output_foldpath, output_filepath, static_foldpath, images_foldpath
42 | filename = os.path.basename(target_filepath)
43 | filepath = os.path.abspath(target_filepath)
44 | output_foldpath = os.path.join(filepath.split(filename)[0], output_foldname)
45 | output_filepath = os.path.join(output_foldpath, output_filename)
46 |
47 | static_foldpath = os.path.join(output_foldpath, "static")
48 | images_foldpath = os.path.join(static_foldpath, images_foldname)
49 |
--------------------------------------------------------------------------------
/src/static/css/base.css:
--------------------------------------------------------------------------------
1 | .watermark {
2 | position: fixed;
3 | opacity: 0.1;
4 | font-size: 128px;
5 | width: 100%;
6 | text-align: center;
7 | z-index: 1000;
8 | pointer-events: none;
9 | }
10 |
11 | .reveal .katex {
12 | font-size: 100%;
13 | }
14 |
15 | red { color: red; }
16 | green { color: green; }
17 | blue { color: blue; }
18 |
19 | .codehilite .hll { background-color: #ffffcc }
20 | .codehilite .c { color: #408080; font-style: italic } /* Comment */
21 | .codehilite .err { border: 1px solid #FF0000 } /* Error */
22 | .codehilite .k { color: #008000; font-weight: bold } /* Keyword */
23 | .codehilite .o { color: #666666 } /* Operator */
24 | .codehilite .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
25 | .codehilite .cm { color: #408080; font-style: italic } /* Comment.Multiline */
26 | .codehilite .cp { color: #BC7A00 } /* Comment.Preproc */
27 | .codehilite .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
28 | .codehilite .c1 { color: #408080; font-style: italic } /* Comment.Single */
29 | .codehilite .cs { color: #408080; font-style: italic } /* Comment.Special */
30 | .codehilite .gd { color: #A00000 } /* Generic.Deleted */
31 | .codehilite .ge { font-style: italic } /* Generic.Emph */
32 | .codehilite .gr { color: #FF0000 } /* Generic.Error */
33 | .codehilite .gh { color: #000080; font-weight: bold } /* Generic.Heading */
34 | .codehilite .gi { color: #00A000 } /* Generic.Inserted */
35 | .codehilite .go { color: #888888 } /* Generic.Output */
36 | .codehilite .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
37 | .codehilite .gs { font-weight: bold } /* Generic.Strong */
38 | .codehilite .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
39 | .codehilite .gt { color: #0044DD } /* Generic.Traceback */
40 | .codehilite .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
41 | .codehilite .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
42 | .codehilite .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
43 | .codehilite .kp { color: #008000 } /* Keyword.Pseudo */
44 | .codehilite .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
45 | .codehilite .kt { color: #B00040 } /* Keyword.Type */
46 | .codehilite .m { color: #666666 } /* Literal.Number */
47 | .codehilite .s { color: #BA2121 } /* Literal.String */
48 | .codehilite .na { color: #7D9029 } /* Name.Attribute */
49 | .codehilite .nb { color: #008000 } /* Name.Builtin */
50 | .codehilite .nc { color: #0000FF; font-weight: bold } /* Name.Class */
51 | .codehilite .no { color: #880000 } /* Name.Constant */
52 | .codehilite .nd { color: #AA22FF } /* Name.Decorator */
53 | .codehilite .ni { color: #999999; font-weight: bold } /* Name.Entity */
54 | .codehilite .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
55 | .codehilite .nf { color: #0000FF } /* Name.Function */
56 | .codehilite .nl { color: #A0A000 } /* Name.Label */
57 | .codehilite .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
58 | .codehilite .nt { color: #008000; font-weight: bold } /* Name.Tag */
59 | .codehilite .nv { color: #19177C } /* Name.Variable */
60 | .codehilite .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
61 | .codehilite .w { color: #bbbbbb } /* Text.Whitespace */
62 | .codehilite .mb { color: #666666 } /* Literal.Number.Bin */
63 | .codehilite .mf { color: #666666 } /* Literal.Number.Float */
64 | .codehilite .mh { color: #666666 } /* Literal.Number.Hex */
65 | .codehilite .mi { color: #666666 } /* Literal.Number.Integer */
66 | .codehilite .mo { color: #666666 } /* Literal.Number.Oct */
67 | .codehilite .sa { color: #BA2121 } /* Literal.String.Affix */
68 | .codehilite .sb { color: #BA2121 } /* Literal.String.Backtick */
69 | .codehilite .sc { color: #BA2121 } /* Literal.String.Char */
70 | .codehilite .dl { color: #BA2121 } /* Literal.String.Delimiter */
71 | .codehilite .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
72 | .codehilite .s2 { color: #BA2121 } /* Literal.String.Double */
73 | .codehilite .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
74 | .codehilite .sh { color: #BA2121 } /* Literal.String.Heredoc */
75 | .codehilite .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
76 | .codehilite .sx { color: #008000 } /* Literal.String.Other */
77 | .codehilite .sr { color: #BB6688 } /* Literal.String.Regex */
78 | .codehilite .s1 { color: #BA2121 } /* Literal.String.Single */
79 | .codehilite .ss { color: #19177C } /* Literal.String.Symbol */
80 | .codehilite .bp { color: #008000 } /* Name.Builtin.Pseudo */
81 | .codehilite .fm { color: #0000FF } /* Name.Function.Magic */
82 | .codehilite .vc { color: #19177C } /* Name.Variable.Class */
83 | .codehilite .vg { color: #19177C } /* Name.Variable.Global */
84 | .codehilite .vi { color: #19177C } /* Name.Variable.Instance */
85 | .codehilite .vm { color: #19177C } /* Name.Variable.Magic */
86 | .codehilite .il { color: #666666 } /* Literal.Number.Integer.Long */
87 |
--------------------------------------------------------------------------------
/src/static/img/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zweix123/jyyslide-md/b33c115558a20e1a254259559d115d25f4d24458/src/static/img/favicon.png
--------------------------------------------------------------------------------
/src/static/jyy/jyy.css:
--------------------------------------------------------------------------------
1 | .reveal .slide-number {
2 | font-size: 26px;
3 | border-radius: 5px;
4 | background-color: rgba(0, 0, 0, .3);
5 | }
6 |
7 | .reveal .slides {
8 | border: 1.5px #ddd solid;
9 | border-radius: 7px;
10 | text-align: left;
11 | font-weight: 300;
12 | }
13 |
14 | .reveal h1,
15 | .reveal h2,
16 | .reveal h3,
17 | .reveal h4 {
18 | font-family: 'Lato', 'SimHei', 'STXihei', 'Sans Serif';
19 | font-weight: 400;
20 | }
21 |
22 | .reveal p,
23 | .reveal li,
24 | .reveal center {
25 | font-size: 32px;
26 | font-family: 'Lato', 'STHeiti', 'SimHei', 'Sans Serif';
27 | }
28 |
29 | .reveal li+li {
30 | margin-top: 10px;
31 | }
32 |
33 | .reveal ul {
34 | display: block;
35 | margin-right: 15px;
36 | }
37 |
38 | .reveal p,
39 | .reveal h1,
40 | .reveal h2,
41 | .reveal h3,
42 | .reveal h4,
43 | .reveal h5 {
44 | padding: 0 25px 0 25px;
45 | }
46 |
47 | .reveal table {
48 | font-size: 32px;
49 | font-family: 'Lato', 'STHeiti', 'SimHei', 'Sans Serif';
50 | margin-top: 15px;
51 | margin-bottom: 15px;
52 | }
53 |
54 | .reveal th {
55 | background-color: #eee;
56 | }
57 |
58 | .reveal tr:nth-child(even) {
59 | background-color: #efffff;
60 | }
61 |
62 | .reveal h1,
63 | .reveal h2,
64 | .reveal h3,
65 | .reveal h4,
66 | .reveal h5,
67 | .reveal h6 {
68 | text-align: left;
69 | margin: 0 0 20px 0;
70 | color: #222;
71 | font-weight: 400;
72 | line-height: 1.2;
73 | letter-spacing: normal;
74 | }
75 |
76 | .reveal h1 {
77 | margin: 0 10 0 10;
78 | font-size: 60px;
79 | }
80 |
81 | .reveal .middle h1 {
82 | text-align: center;
83 | }
84 |
85 | .reveal h2 {
86 | font-size: 48px;
87 | border-bottom: 2px solid rgb(106, 0, 95);
88 | padding-bottom: 5px;
89 | }
90 |
91 | .reveal h3 {
92 | font-size: 1.15em;
93 | }
94 |
95 | .reveal h4 {
96 | font-size: 1.05em;
97 | }
98 |
99 | .reveal .center {
100 | text-align: center;
101 | }
102 |
103 | .reveal .middle {
104 | height: 728px;
105 | display: flex;
106 | align-items: center;
107 | width: 100%;
108 | }
109 |
110 | .reveal pre {
111 | font-size: 28px;
112 |
113 | background-color: #eee;
114 |
115 | border-radius: 3mm;
116 | padding: 10px 10px 10px 10px;
117 | }
118 |
119 | .reveal pre code {
120 | max-height: none;
121 | }
122 |
123 | .reveal code {
124 | font-family: 'Inconsolata', 'STKaiti', 'KaiTi', 'Sans Serif', Monospace;
125 | }
126 |
127 | .reveal .middle blockquote {
128 | text-align: center;
129 | color: rgb(106, 0, 95);
130 | background: none;
131 | box-shadow: none;
132 | }
133 |
134 | .reveal .middle blockquote a {
135 | color: inherit;
136 | }
137 |
138 | .reveal blockquote p,
139 | .reveal blockquote li {
140 | font-family: 'Lato', 'STKaiti', 'KaiTi', 'Sans Serif';
141 | }
142 |
143 | section .center {
144 | display: block;
145 | margin-left: auto;
146 | margin-right: auto;
147 | }
148 |
149 | .reveal .author-block {
150 | margin: 75px 0 35px 0;
151 | }
152 |
153 | .reveal .author-affiliation img {
154 | margin: 15px 0 0 0;
155 | }
156 |
157 | .reveal .author-block p,
158 | .reveal .author-affiliation p {
159 | font-family: 'Kaiti', 'STKaiti', 'Serif', 'Times', 'Times New Roman';
160 | margin-block-start: 0em;
161 | margin-block-end: 0em;
162 | }
163 |
164 | .reveal .author-affiliation {
165 | display: inline-block;
166 | font-size: 90%;
167 | }
168 |
169 | .reveal hr {
170 | border: 10px solid rgba(0, 0, 0, 0);
171 | }
172 |
173 | .reveal li {
174 | margin-top: 10px;
175 | }
--------------------------------------------------------------------------------
/src/static/katex/auto-render.min.js:
--------------------------------------------------------------------------------
1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var i={};return function(){n.d(i,{default:function(){return s}});var e=n(771),t=n.n(e),r=function(e,t,r){for(var n=r,i=0,a=e.length;n
0&&(i.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));var l=t.findIndex((function(t){return e.startsWith(t.left)}));if(-1===(n=r(t[l].right,e,t[l].left.length)))break;var d=e.slice(0,n+t[l].right.length),s=a.test(d)?d:e.slice(t[l].left.length,n);i.push({type:"math",data:s,rawData:d,display:t[l].display}),e=e.slice(n+t[l].right.length)}return""!==e&&i.push({type:"text",data:e}),i},l=function(e,r){var n=o(e,r.delimiters);if(1===n.length&&"text"===n[0].type)return null;for(var i=document.createDocumentFragment(),a=0;a.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}
2 |
--------------------------------------------------------------------------------
/src/static/reveal/theme/simple.css:
--------------------------------------------------------------------------------
1 | /**
2 | * A simple theme for reveal.js presentations, similar
3 | * to the default theme. The accent color is darkblue.
4 | *
5 | * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed.
6 | * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
7 | */
8 | @import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700);
9 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
10 | section.has-dark-background, section.has-dark-background h1, section.has-dark-background h2, section.has-dark-background h3, section.has-dark-background h4, section.has-dark-background h5, section.has-dark-background h6 {
11 | color: #fff; }
12 |
13 | /*********************************************
14 | * GLOBAL STYLES
15 | *********************************************/
16 | :root {
17 | --background-color: #fff;
18 | --main-font: Lato, sans-serif;
19 | --main-font-size: 40px;
20 | --main-color: #000;
21 | --block-margin: 20px;
22 | --heading-margin: 0 0 20px 0;
23 | --heading-font: News Cycle, Impact, sans-serif;
24 | --heading-color: #000;
25 | --heading-line-height: 1.2;
26 | --heading-letter-spacing: normal;
27 | --heading-text-transform: none;
28 | --heading-text-shadow: none;
29 | --heading-font-weight: normal;
30 | --heading1-text-shadow: none;
31 | --heading1-size: 3.77em;
32 | --heading2-size: 2.11em;
33 | --heading3-size: 1.55em;
34 | --heading4-size: 1em;
35 | --code-font: monospace;
36 | --link-color: #00008B;
37 | --link-color-hover: #0000f1;
38 | --selection-background-color: rgba(0, 0, 0, 0.99);
39 | --selection-color: #fff; }
40 |
41 | .reveal-viewport {
42 | background: #fff;
43 | background-color: #fff; }
44 |
45 | .reveal {
46 | font-family: "Lato", sans-serif;
47 | font-size: 40px;
48 | font-weight: normal;
49 | color: #000; }
50 |
51 | .reveal ::selection {
52 | color: #fff;
53 | background: rgba(0, 0, 0, 0.99);
54 | text-shadow: none; }
55 |
56 | .reveal ::-moz-selection {
57 | color: #fff;
58 | background: rgba(0, 0, 0, 0.99);
59 | text-shadow: none; }
60 |
61 | .reveal .slides section,
62 | .reveal .slides section > section {
63 | line-height: 1.3;
64 | font-weight: inherit; }
65 |
66 | /*********************************************
67 | * HEADERS
68 | *********************************************/
69 | .reveal h1,
70 | .reveal h2,
71 | .reveal h3,
72 | .reveal h4,
73 | .reveal h5,
74 | .reveal h6 {
75 | margin: 0 0 20px 0;
76 | color: #000;
77 | font-family: "News Cycle", Impact, sans-serif;
78 | font-weight: normal;
79 | line-height: 1.2;
80 | letter-spacing: normal;
81 | text-transform: none;
82 | text-shadow: none;
83 | word-wrap: break-word; }
84 |
85 | .reveal h1 {
86 | font-size: 3.77em; }
87 |
88 | .reveal h2 {
89 | font-size: 2.11em; }
90 |
91 | .reveal h3 {
92 | font-size: 1.55em; }
93 |
94 | .reveal h4 {
95 | font-size: 1em; }
96 |
97 | .reveal h1 {
98 | text-shadow: none; }
99 |
100 | /*********************************************
101 | * OTHER
102 | *********************************************/
103 | .reveal p {
104 | margin: 20px 0;
105 | line-height: 1.3; }
106 |
107 | /* Ensure certain elements are never larger than the slide itself */
108 | .reveal img,
109 | .reveal video,
110 | .reveal iframe {
111 | max-width: 95%;
112 | max-height: 95%; }
113 |
114 | .reveal strong,
115 | .reveal b {
116 | font-weight: bold; }
117 |
118 | .reveal em {
119 | font-style: italic; }
120 |
121 | .reveal ol,
122 | .reveal dl,
123 | .reveal ul {
124 | display: inline-block;
125 | text-align: left;
126 | margin: 0 0 0 1em; }
127 |
128 | .reveal ol {
129 | list-style-type: decimal; }
130 |
131 | .reveal ul {
132 | list-style-type: disc; }
133 |
134 | .reveal ul ul {
135 | list-style-type: square; }
136 |
137 | .reveal ul ul ul {
138 | list-style-type: circle; }
139 |
140 | .reveal ul ul,
141 | .reveal ul ol,
142 | .reveal ol ol,
143 | .reveal ol ul {
144 | display: block;
145 | margin-left: 10px; }
146 |
147 | .reveal dt {
148 | font-weight: bold; }
149 |
150 | .reveal dd {
151 | margin-left: 40px; }
152 |
153 | .reveal blockquote {
154 | display: block;
155 | position: relative;
156 | width: 90%;
157 | margin: 20px auto;
158 | padding: 5px;
159 | background: rgba(0, 255, 255, 0.05);
160 | border-radius: 10px;
161 | box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
162 | }
163 |
164 | .reveal q {
165 | font-style: italic; }
166 |
167 | .reveal pre {
168 | display: block;
169 | position: relative;
170 | width: 90%;
171 | margin: 20px auto;
172 | text-align: left;
173 | font-size: 0.55em;
174 | font-family: monospace;
175 | line-height: 1.2em;
176 | word-wrap: break-word;
177 | box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15); }
178 |
179 | .reveal code {
180 | font-family: monospace;
181 | text-transform: none; }
182 |
183 | .reveal pre code {
184 | display: block;
185 | padding: 5px;
186 | overflow: auto;
187 | max-height: 400px;
188 | word-wrap: normal; }
189 |
190 | .reveal table {
191 | margin: auto;
192 | border-collapse: collapse;
193 | border-spacing: 0; }
194 |
195 | .reveal table th {
196 | font-weight: bold; }
197 |
198 | .reveal table th,
199 | .reveal table td {
200 | text-align: left;
201 | padding: 0.2em 0.5em 0.2em 0.5em;
202 | border-bottom: 1px solid; }
203 |
204 | .reveal table th[align="center"],
205 | .reveal table td[align="center"] {
206 | text-align: center; }
207 |
208 | .reveal table th[align="right"],
209 | .reveal table td[align="right"] {
210 | text-align: right; }
211 |
212 | .reveal table tbody tr:last-child th,
213 | .reveal table tbody tr:last-child td {
214 | border-bottom: none; }
215 |
216 | .reveal sup {
217 | vertical-align: super;
218 | font-size: smaller; }
219 |
220 | .reveal sub {
221 | vertical-align: sub;
222 | font-size: smaller; }
223 |
224 | .reveal small {
225 | display: inline-block;
226 | font-size: 0.6em;
227 | line-height: 1.2em;
228 | vertical-align: top; }
229 |
230 | .reveal small * {
231 | vertical-align: top; }
232 |
233 | .reveal img {
234 | margin: 20px 0; }
235 |
236 | /*********************************************
237 | * LINKS
238 | *********************************************/
239 | .reveal a {
240 | color: #00008B;
241 | text-decoration: none;
242 | transition: color .15s ease; }
243 |
244 | .reveal a:hover {
245 | color: #0000f1;
246 | text-shadow: none;
247 | border: none; }
248 |
249 | .reveal .roll span:after {
250 | color: #fff;
251 | background: #00003f; }
252 |
253 | /*********************************************
254 | * Frame helper
255 | *********************************************/
256 | .reveal .r-frame {
257 | border: 4px solid #000;
258 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); }
259 |
260 | .reveal a .r-frame {
261 | transition: all .15s linear; }
262 |
263 | .reveal a:hover .r-frame {
264 | border-color: #00008B;
265 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); }
266 |
267 | /*********************************************
268 | * NAVIGATION CONTROLS
269 | *********************************************/
270 | .reveal .controls {
271 | color: #00008B; }
272 |
273 | /*********************************************
274 | * PROGRESS BAR
275 | *********************************************/
276 | .reveal .progress {
277 | background: rgba(0, 0, 0, 0.2);
278 | color: #00008B; }
279 |
280 | /*********************************************
281 | * PRINT BACKGROUND
282 | *********************************************/
283 | @media print {
284 | .backgrounds {
285 | background-color: #fff; } }
286 |
--------------------------------------------------------------------------------
/src/util/__init__.py:
--------------------------------------------------------------------------------
1 | from . import file_util, net_util, str_util, md_util
2 |
--------------------------------------------------------------------------------
/src/util/file_util.py:
--------------------------------------------------------------------------------
1 | import os, shutil, uuid
2 | from typing import Optional, Tuple
3 | from . import str_util, net_util
4 |
5 |
6 | def get_files_under_folder(
7 | folerpath: str, suffix_name: Optional[str] = None
8 | ) -> list[str]:
9 | """返回目录folderpath下后缀名为suffix_name的所有文件的绝对路径列表"""
10 | return [
11 | os.path.abspath(os.path.join(dirpath, filename))
12 | for dirpath, dirnames, filenames in os.walk(folerpath)
13 | for filename in filenames
14 | if suffix_name is None or str(filename).endswith("." + suffix_name)
15 | ]
16 |
17 |
18 | def read(filepath: str) -> str: # 读取文本文件内容
19 | if os.path.exists(filepath) is False:
20 | raise Exception("The path {} is not exists".format(filepath))
21 | with open(filepath, "r", encoding="utf-8") as f:
22 | return str(f.read())
23 |
24 |
25 | def write(filepath: str, data: str) -> None: # 向文件(覆)写内容
26 | dirpath = os.path.dirname(filepath)
27 | if os.path.exists(dirpath) is False:
28 | os.makedirs(dirpath)
29 | with open(filepath, "w", encoding="utf-8") as f:
30 | f.write(data)
31 |
32 |
33 | def get_abspath(basefile: str, filepath: str) -> str: # 从绝对路径变化成相对路径且符合当前的操作系统
34 | return os.path.normpath(os.path.join(os.path.dirname(basefile), filepath))
35 |
36 |
37 | def get_image_to_target(
38 | link: str, from_filepath: str, target_foldpath: str
39 | ) -> Tuple[str, bool]:
40 | # 对于from_filepath(请使用其绝对地址)中的图床链接link, 它可能是url、绝对地址或相对地址, 我们会get它然后重命名并放到target_foldpath下, 并返回重命名后的名字
41 | # 这里对图片类型的判断是通过link的后缀名, 有些图片的url的末尾不是类型名, 就会有bug
42 | name = uuid.uuid4().hex + "." + link.split(".")[-1]
43 | if str_util.is_url(link):
44 | pass
45 | else:
46 | if os.path.isabs(link) is True:
47 | pass
48 | else:
49 | link = get_abspath(from_filepath, link)
50 | pass
51 |
52 | if str_util.is_url(link):
53 | net_util.down_image(link, os.path.join(target_foldpath, name))
54 | else:
55 | if os.path.exists(link) is False:
56 | print("The path is not exists: ", link)
57 | return "", True
58 | shutil.copyfile(link, os.path.join(target_foldpath, name))
59 |
60 | return name, False
61 |
--------------------------------------------------------------------------------
/src/util/md_util.py:
--------------------------------------------------------------------------------
1 | import re
2 | from typing import List, Union
3 |
4 |
5 | def process_images(content, func):
6 | """处理Markdown类型字符串中的图片链接, 返回处理过图片链接部分的Markdown字符串
7 |
8 | Args:
9 | content (_type_): Markdown类型字符串
10 | func (_type_): 处理图片链接的函数, 该函数接受图片链接字符串, 返回一个(有关图片链接的新串, 是否有错误)的元组
11 | """
12 |
13 | def modify(match):
14 | # 下面是黑盒魔法
15 | tar = match.group()
16 | pre, mid, suf = str(), str(), str()
17 | if tar[-1] == ")":
18 | pre = tar[: tar.index("(") + 1]
19 | mid = tar[tar.index("(") + 1 : -1]
20 | suf = tar[-1]
21 | else:
22 | mid = re.search(r'src="([^"]*)"', tar).group(1)
23 | pre, suf = tar.split(mid)
24 |
25 | link = mid
26 | # 黑盒魔法结束
27 | new_name, err = func(link)
28 | return pre + (new_name if err is False else link) + suf
29 |
30 | patten = r"!\[.*?\]\((.*?)\)|"
31 | return re.sub(patten, modify, content)
32 |
33 |
34 | ###
35 |
36 | from markdown import markdown
37 | from markdown import Extension
38 | from markdown.blockprocessors import BlockProcessor
39 | import xml.etree.ElementTree as etree
40 |
41 |
42 | def md_to_html(md: str) -> str:
43 | class BoxBlockProcessor(BlockProcessor):
44 | first = True
45 |
46 | def run(self, parent, blocks):
47 | if self.first:
48 | self.first = False
49 | e = etree.SubElement(parent, "div")
50 | self.parser.parseBlocks(e, blocks)
51 | for _ in range(0, len(blocks)):
52 | blocks.pop(0)
53 | return True
54 | return False
55 |
56 | class BoxExtension(Extension):
57 | def extendMarkdown(self, md):
58 | md.parser.blockprocessors.register(BoxBlockProcessor(md.parser), "box", 175)
59 |
60 | extensions: List[Union[str, BoxExtension]] = [
61 | BoxExtension(),
62 | "meta",
63 | "fenced_code",
64 | "codehilite",
65 | "extra",
66 | "attr_list",
67 | "tables",
68 | "toc",
69 | ]
70 | return markdown(md, extensions=extensions)
71 |
--------------------------------------------------------------------------------
/src/util/net_util.py:
--------------------------------------------------------------------------------
1 | import requests
2 |
3 |
4 | def down_image(img_url, save_file_path):
5 | resp = requests.get(img_url)
6 | with open(save_file_path, "wb") as f:
7 | f.write(resp.content)
8 |
--------------------------------------------------------------------------------
/src/util/str_util.py:
--------------------------------------------------------------------------------
1 | from urllib.parse import urlparse
2 |
3 |
4 | # 分辨URL和路径: 判断一个字符串是否为URL
5 | def is_url(string):
6 | result = urlparse(string)
7 | return all([result.scheme, result.netloc])
8 |
9 |
10 | # 分辨URL和路径: 判断一个字符串是否为路径
11 | def is_path(string):
12 | result = urlparse(string)
13 | return not all([result.scheme, result.netloc])
14 |
--------------------------------------------------------------------------------
/test/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zweix123/jyyslide-md/b33c115558a20e1a254259559d115d25f4d24458/test/.gitkeep
--------------------------------------------------------------------------------
/test/regression-testing.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # TODO: Compatible with Windows operating system
4 | jyyslice_md_path=$(dirname $(dirname $(readlink -f $0)))
5 | export JYYSLICE_MD_PATH=$jyyslice_md_path
6 |
7 | # unit
8 | poetry run python unit/author.py
9 |
10 | # TODO: other tests
11 |
--------------------------------------------------------------------------------
/test/unit/author.py:
--------------------------------------------------------------------------------
1 | # unit test for function process_front_matter
2 | # process_front_matter input is st.content
3 | # process_front_matter output is st.author_template
4 |
5 |
6 | import os
7 | import sys
8 | import unittest
9 |
10 | from jinja2 import Template # lib used in converter.py
11 |
12 | # add project root to sys.path, otherwise, the import below will fail
13 | sys.path = [os.environ["JYYSLICE_MD_PATH"]] + sys.path
14 |
15 |
16 | import src.settings as st
17 | from src.converter import process_front_matter
18 |
19 | # 这里没有使用项目中的template, 而是针对其使用的模版变量专门测试
20 | #! 假如未来模版内容修改, 当前单元测试无法感知, 导致作为回归测试的话会落后版本
21 | AUTHOR_TEMPLATE_STRING = """
22 | {{ author.name }}
23 | {{ author.url }}
24 | {% for department in departments %}
25 | {{ department.name }}
26 | {{ department.url }}
27 | {{ department.img }}
28 | {% endfor %}
29 | """
30 |
31 |
32 | class TestProcessFrontMatter(unittest.TestCase):
33 | def single_test(self, input: str, output: str):
34 | """
35 | 单次测试
36 | Args:
37 | input (str): 要测试的markdown头
38 | output (str): 要测试的头部分的输出
39 | """
40 | st.content = input
41 | st.author_template = Template(AUTHOR_TEMPLATE_STRING) # init st.author_template
42 | process_front_matter()
43 | self.assertEqual(st.author_template, output)
44 |
45 | def test_not_front_matter(self):
46 | self.single_test("", "")
47 |
48 | def test_common_json(self):
49 | author_info_md = (
50 | """{
51 | "author": {
52 | "name": "蒋炎岩",
53 | "url": "https://ics.nju.edu.cn/~jyy/"
54 | },
55 | "departments": [
56 | {
57 | "name": " 南京大学 ",
58 | "url": "https://www.nju.edu.cn/main.htm",
59 | "img": "./img/nju-logo.jpg"
60 | },
61 | {
62 | "name": "计算机科学与技术系",
63 | "url": "https://cs.nju.edu.cn/main.htm",
64 | "img": "./img/njucs-logo.jpg"
65 | },
66 | {
67 | "name": "计算机软件研究所",
68 | "url": "https://www.nju.edu.cn/main.htm",
69 | "img": "./img/ics-logo.png"
70 | }
71 | ]
72 | }"""
73 | + st.op_front_matter
74 | )
75 | expected_output = """
76 | 蒋炎岩
77 | https://ics.nju.edu.cn/~jyy/
78 |
79 | 南京大学
80 | https://www.nju.edu.cn/main.htm
81 | ./img/nju-logo.jpg
82 |
83 | 计算机科学与技术系
84 | https://cs.nju.edu.cn/main.htm
85 | ./img/njucs-logo.jpg
86 |
87 | 计算机软件研究所
88 | https://www.nju.edu.cn/main.htm
89 | ./img/ics-logo.png
90 | """
91 |
92 | self.single_test(author_info_md, expected_output)
93 |
94 | def test_common_yaml(self):
95 | author_info_md = (
96 | """author:
97 | name: 蒋炎岩
98 | url: https://ics.nju.edu.cn/~jyy/
99 |
100 | departments:
101 | - name: " 南京大学 "
102 | url: https://www.nju.edu.cn/main.htm,
103 | img: ./img/nju-logo.jpg
104 |
105 | - name: 计算机科学与技术系
106 | url: https://cs.nju.edu.cn/main.htm,
107 | img: ./img/njucs-logo.jpg
108 |
109 | - name: 计算机软件研究所
110 | url: https://www.nju.edu.cn/main.htm,
111 | img: ./img/ics-logo.png"""
112 | + st.op_front_matter
113 | )
114 | expected_output = """
115 | 蒋炎岩
116 | https://ics.nju.edu.cn/~jyy/
117 |
118 | 南京大学
119 | https://www.nju.edu.cn/main.htm,
120 | ./img/nju-logo.jpg
121 |
122 | 计算机科学与技术系
123 | https://cs.nju.edu.cn/main.htm,
124 | ./img/njucs-logo.jpg
125 |
126 | 计算机软件研究所
127 | https://www.nju.edu.cn/main.htm,
128 | ./img/ics-logo.png
129 | """
130 |
131 | self.single_test(author_info_md, expected_output)
132 |
133 |
134 | if __name__ == "__main__":
135 | unittest.main()
136 |
--------------------------------------------------------------------------------