MCPcopy Create free account
hub / github.com/Image-Py/imagepy / md2html

Function md2html

imagepy/ui/mkdownwindow.py:6–179  ·  view source on GitHub ↗
(mdstr)

Source from the content-addressed store, hash-verified

4import os
5
6def md2html(mdstr):
7 exts = ['markdown.extensions.extra', 'markdown.extensions.codehilite','markdown.extensions.tables','markdown.extensions.toc']
8
9 html = '''
10<html lang="zh-cn">
11<head>
12<meta content="text/html; charset=utf-8" http-equiv="content-type" />
13</head>
14
15<style>
16h1,
17h2,
18h3,
19h4,
20h5,
21h6,
22p,
23blockquote {
24 margin: 0;
25 padding: 0;
26}
27body {
28 font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
29 font-size: 13px;
30 line-height: 18px;
31 color: #737373;
32 background-color: white;
33 margin: 10px 13px 10px 13px;
34}
35table {
36 margin: 10px 0 15px 0;
37 border-collapse: collapse;
38}
39td,th {
40 border: 1px solid #ddd;
41 padding: 3px 10px;
42}
43th {
44 padding: 5px 10px;
45}
46
47a {
48 color: #0069d6;
49}
50a:hover {
51 color: #0050a3;
52 text-decoration: none;
53}
54a img {
55 border: none;
56}
57p {
58 margin-bottom: 9px;
59}
60p img {
61 width:100%%;
62}
63h1,

Callers 4

on_selectMethod · 0.90
on_selectMethod · 0.90
on_runMethod · 0.90
__init__Method · 0.85

Calls 2

writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected