-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
106 lines (99 loc) · 3.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<html>
<head>
<meta charset="utf-8">
<title>MySTyc - Online conversion from reStructuredText to MyST</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<script defer data-domain="astrojuanlu.github.io/mystyc" src="https://plausible.io/js/script.js"></script>
<link rel="stylesheet" href="https://pyscript.net/releases/2022.12.1/pyscript.css" />
<script defer src="https://pyscript.net/releases/2022.12.1/pyscript.js"></script>
<py-config>
packages = [
"rst-to-myst==0.3.2",
"ruamel-yaml==0.16.13",
]
[[fetch]]
files = ["./conversion.py"]
[splashscreen]
autoclose = true
</py-config>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Montserrat', sans-serif;
}
.main {
width: 900px;
max-width: 100%;
margin: 60px auto;
}
textarea {
width: 100%;
height: 220px;
background: #222127;
color: #fff;
padding: 30px 20px 20px;
border-radius: 8px;
resize: vertical;
font-size: 16px;
font-family: monospace;
}
h1 {
font-size: 42px;
font-weight: 600;
margin: 60px 0 0;
}
q {
font-style: italic;
}
footer p {
font-size: 12px;
}
footer a {
text-decoration: underline;
}
label {
display: block;
font-size: 18px;
font-weight: 500;
margin: 30px 0 8px;
}
</style>
</head>
<body>
<div class="main">
<h1>MySTyc</h1>
<h2>Online conversion from reStructuredText to <abbr title="Markedly Structured Text">MyST</a></h2>
<py-script>
from js import document
from conversion import convert
input_textarea = document.querySelector("form textarea#input_rest")
output_textarea = document.querySelector("form textarea#output_myst")
def do_convert(event):
result = convert(event.srcElement.value)
output_textarea.value = result['output_myst']
input_textarea.oninput = do_convert
</py-script>
<p><q cite="https://myst-parser.readthedocs.io/">MyST is a rich and extensible flavor of Markdown meant for technical documentation and publishing</q>.
It combines the familiarity of Markdown with the power and extensibility of reStructuredText,
and <a href="https://www.sphinx-doc.org/en/master/usage/markdown.html">you can use it in your Sphinx documentation</a>.
<a href="https://myst-parser.readthedocs.io/">Learn more!</a></p>
<form method="post">
<section>
<label for="input_rest">Introduce the reStructuredText input</label>
<textarea id="input_rest" name="input_rest"></textarea>
</section>
<section>
<label for="output_myst">Result MyST</label>
<textarea id="output_myst" name="output_myst" readonly="true"></textarea>
</section>
</form>
<footer>
<p>Created by <a href="https://github.com/astrojuanlu/">Juan Luis Cano</a> from <a href="https://readthedocs.org">Read the Docs</a>
with Python, <a href="https://pyscript.net/">PyScript</a>, and love ❤️ design by <a href="https://github.com/nienn">Ana Costa</a>
(<a href="https://github.com/astrojuanlu/mystyc">Source code</a>)</p>
</footer>
</div>
</body>
</html>