-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
186 lines (166 loc) · 11.9 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<!DOCTYPE html>
<html lang="en_us">
<head>
<title>Schemascii ± 0</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/static/css/main.css" />
<link rel="stylesheet" href="/static/css/theme.css" />
<link rel="icon" href="/images/yazani/yazani_1_extracted_bg_big_eyes_cropped.png" type="image/png" />
<link rel="apple-touch-icon" href="/images/yazani/yazani_1_extracted_bg_big_eyes_cropped.png" type="image/png" />
<script src="/static/misc.js"></script>
<script src="/blog/banner_image.js"></script>
<meta name="tags" content="programming, electronics, python" />
<meta property="og:site_name" content="dragoncoder047’s blog" />
<meta property="og:title" content="Schemascii ± 0" />
<meta property="og:description" content="I have been working really hard this week on Schemascii. Like, maybe too much. But, I finally got Schemascii to the point that I could (if I wanted) upload it to PyPI and it would be a valid package. Schemascii is also able to be called as a command-line program …" />
<meta property="og:image" content="/images/yazani/yazani_1_extracted_bg.png" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://dragoncoder047.github.io/blog/2023/schemascii-0" />
<meta property="og:locale" content="['']" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="dragoncoder047’s blog - Schemascii ± 0" />
<meta name="twitter:description" content="I have been working really hard this week on Schemascii. Like, maybe too much. But, I finally got Schemascii to the point that I could (if I wanted) upload it to PyPI and it would be a valid package. Schemascii is also able to be called as a command-line program …" />
<meta name="twitter:image" content="/images/yazani/yazani_1_extracted_bg.png" />
<!-- PrismJS -->
<script src="/static/prism.js" data-autoloader-path="https://cdn.jsdelivr.net/npm/prismjs@v1.x/components/"></script>
<script src="/static/prism-runbutton.js"></script>
<script src="/phoo/prism-phoo.js"></script> <!-- /PrismJS -->
<!-- Schemascii -->
<link rel="stylesheet" href="/schemascii/schemascii_example.css"> <!-- /Schemascii -->
</head>
<body class="match-braces rainbow-braces">
<header>
<a href="https://dragoncoder047.github.io/blog" class="flex-row"><div class="flex-row"><img src="/images/yazani/yazani_1_extracted_bg.png" style="max-height:10em" id="banner-image" /><div id="sitename-text"><h1>dragoncoder047’s blog</h1><h2>random thoughts about nonrandom things</h2></div></div></a>
<nav>
<ul>
<li><a href="https://dragoncoder047.github.io/blog/">Home</a></li>
<li><a href="https://dragoncoder047.github.io/blog/archives">Archives</a>
</li>
<li><a href="https://dragoncoder047.github.io/blog/tags">By tag</a>
</li>
<li><a href="/">Site root</a>
</li>
<li><a href="#">Projects</a>
<ul>
<li><a href="https://dragoncoder047.github.io/thuepaste">Thuepaste</a>
</li>
<li><a href="https://dragoncoder047.github.io/armdroid">Armdroid</a>
</li>
<li><a href="https://dragoncoder047.github.io/langton-music">Langton's Ant Music</a>
</li>
<li><a href="https://dragoncoder047.github.io/schemascii">Schemascii</a>
</li>
<li><a href="https://dragoncoder047.github.io/parasite">Parasite</a>
</li>
</ul>
</li>
<li>
<form action="https://www.google.com/search" method="GET">
<input name="q" type="search" placeholder="Search"></input>
<input type="hidden" name="as_sitesearch" value="https://dragoncoder047.github.io/blog"></input>
<input type="submit" value="Search"></input>
</form>
</li>
</ul>
</nav>
</header>
<main>
<h1><a href="https://dragoncoder047.github.io/blog/2023/schemascii-0" rel="bookmark" title="Permalink to this page">Schemascii ± 0</a></h1>
<div class="flex-row">
<span style="flex: 1">← Previous:
<a href="https://dragoncoder047.github.io/blog/2023/schemascii-1">
Schemascii ± 1
</a>
</span>
<span>Next:
<a href="https://dragoncoder047.github.io/blog/2023/pickles">
Pickles!
</a> →
</span>
</div>
<div class="post-info">
Posted <time class="published" datetime="2023-02-01T00:00:00-05:00">Wed 01 February 2023</time>
<address>By
<a href="https://dragoncoder047.github.io/blog/">dragoncoder047</a>
</address>
<div class="tags">
Tags:
<a href="https://dragoncoder047.github.io/blog/tag/electronics">electronics</a>
<a href="https://dragoncoder047.github.io/blog/tag/programming">programming</a>
<a href="https://dragoncoder047.github.io/blog/tag/python">python</a>
</div>
</div>
<p>I have been working <em>really</em> hard this week on Schemascii. Like, maybe too much. But, I finally got Schemascii to the point that I could (if I wanted) upload it to PyPI and it would be a valid package.</p>
<p>Schemascii is also able to be called as a command-line program. I don’t really need this, but now anyone who is able to install Schemascii (which is really anyone who has a computer now) can render a Schemascii diagram to SVG via the command line.</p>
<p>As-is, what I need for Schemascii is to embed it into a Python-Markdown website. I am using a Python-Markdown extension that makes this super easy – all I need to do is provide a class and the callback function (in this case a super dumb wrapper around <code class="language-py3 highlight">schemascii.render()</code>)</p>
<p>That way, I can turn this:</p>
<pre class="highlight"><code class="language-markdown">```schemascii
*--R1--* R1:0.5k
| |
B1 C1 B1:5000m
| |
*------* C1:0.00033
```</code></pre>
<p>Into this:</p>
<p><svg width="335" height="110" viewBox="-10 -10 335 110" xmlns="http://www.w3.org/2000/svg" class="schemascii"><g class="wire"><polyline points="15,30 15,15 45,15" fill="transparent" stroke-width="2" stroke="black"></polyline></g><g class="wire"><polyline points="120,30 120,15 90,15" fill="transparent" stroke-width="2" stroke="black"></polyline></g><g class="wire"><polyline points="120,60 120,75 15,75 15,60" fill="transparent" stroke-width="2" stroke="black"></polyline></g><g class="component R"><polyline points="90,15 86.25,11.25 82.5,18.75 78.75,11.25 75,18.75 71.25,11.25 67.5,18.75 63.75,11.25 60,18.75 56.25,11.25 52.5,18.75 48.75,11.25 45,15" fill="transparent" stroke-width="2" stroke="black"></polyline><text x="67.5" y="7.5" text-anchor="middle" font-size="15" fill="black"><tspan class="cmp-id">R1</tspan> <tspan class="cmp-value">500 Ω</tspan></text></g><g class="component B"><text x="22.5" y="45" text-anchor="start" font-size="15" fill="black"><tspan class="cmp-id">B1</tspan> <tspan class="cmp-value">5 V</tspan></text><polyline points="18.75,52.5 11.25,52.5" fill="transparent" stroke-width="2" stroke="black"></polyline><polyline points="22.5,47.4 7.5,47.4" fill="transparent" stroke-width="2" stroke="black"></polyline><polyline points="18.75,42.6 11.25,42.6" fill="transparent" stroke-width="2" stroke="black"></polyline><polyline points="22.5,37.5 7.5,37.5" fill="transparent" stroke-width="2" stroke="black"></polyline><polyline points="15,60 15,52.5" fill="transparent" stroke-width="2" stroke="black"></polyline><polyline points="15,30 15,37.5" fill="transparent" stroke-width="2" stroke="black"></polyline></g><g class="component C"><polyline points="126,48.75 114,48.75" fill="transparent" stroke-width="2" stroke="black"></polyline><polyline points="126,41.25 114,41.25" fill="transparent" stroke-width="2" stroke="black"></polyline><polyline points="120,60 120,48.75" fill="transparent" stroke-width="2" stroke="black"></polyline><polyline points="120,30 120,41.25" fill="transparent" stroke-width="2" stroke="black"></polyline><text x="127.5" y="45" text-anchor="start" font-size="15" fill="black"><tspan class="cmp-id">C1</tspan> <tspan class="cmp-value">330 µF</tspan></text></g></svg></p>
<p>Doesn’t that look a whole lot nicer?</p>
<p>In the coming days I’ll be going around to all of my other pages and updating them to use Schemascii. Hopefully this change will be for the better!</p>
<hr />
<p><strong>Related Posts</strong></p>
<ul>
<li><a href="https://dragoncoder047.github.io/blog/2024/now-fully-two-dimensional">Now Fully Two-Dimensional</a></li>
<li><a href="https://dragoncoder047.github.io/blog/2023/schemascii-1">Schemascii ± 1</a></li>
<li><a href="https://dragoncoder047.github.io/blog/2024/in-defense-of-eval">In Defense Of Eval</a></li>
<li><a href="https://dragoncoder047.github.io/blog/2024/perhaps-it-was-too-complicated">Perhaps It Was Too Complicated</a></li>
<li><a href="https://dragoncoder047.github.io/blog/2023/zero-thickness-tree">Zero-Thickness Tree</a></li>
</ul>
<script src="https://giscus.app/client.js"
data-repo="dragoncoder047/blog"
data-repo-id="R_kgDOHCL60w"
data-category="Post Comments"
data-category-id="DIC_kwDOHCL6084CRxCW"
data-mapping="og:title"
data-reactions-enabled="1"
data-input-position="top"
data-theme="dark"
data-lang="en"
crossorigin="anonymous"
async
></script>
<section id="extras">
<div class="blogroll">
<ul>
<li><a href="https://www.conwaylife.com/">Conwaylife.com Forums</a></li>
<li><a href="https://www.python.org/">Python</a></li>
<li><a href="http://www.ulisp.com/">uLisp</a></li>
</ul>
</div>
<div class="social">
<ul>
<li><a href="https://github.com/dragoncoder047">dragoncoder047 on GitHub</a></li>
<li><a href="https://youtube.com/@dragoncoder047">dragoncoder047 on YouTube</a></li>
<li><a href="https://instagram.com/dragoncoder047/">dragoncoder047 on Instagram</a></li>
</ul>
</div>
</section>
</main>
<footer>
<address>
Site built by <a href="https://getpelican.com/">Pelican</a>
</address>
<a href="#" onclick="window.scrollTo({top: 0, left: 0});">Back to top</a>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XR0F89CCGK"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-XR0F89CCGK");
</script>
</footer>
</body>
</html>