on master help sign in
Markdown, docs: escape {% strings
commit20a2135ef5d4ea151cfd622b2ffdb03fcb6e9cdf authorMatilde Park <matilde.park@urbit.org> dateWed 1 Jun 2022, 18:38 (4 years ago) parentea38184
6 files changed+37−25
components/Markdown.js+9 content/docs/arvo/clay/examples.md+4−3 content/docs/arvo/clay/scry.md+5−4 content/docs/hoon/guides/strings.md+5−5 content/docs/hoon/reference/stdlib/2i.md+6−5 content/docs/hoon/reference/stdlib/4g.md+8−8
components/Markdown.js+9
@@ -147,6 +147,13 @@ const callout = {
147147 },
148148};
149149
150+const customFence = {
151+ render: "CustomFence",
152+ attributes: {},
153+};
154+
155+const CustomFence = ({ children }) => <pre>{children}</pre>;
156+
150157export default function Markdown({ post }) {
151158 const ast = Markdoc.parse(post.content);
152159 const finalAst = footnoteParse(ast);
@@ -162,6 +169,7 @@ export default function Markdown({ post }) {
162169 tab,
163170 button,
164171 callout,
172+ customFence,
165173 },
166174 });
167175 return Markdoc.renderers.react(content, React, {
@@ -171,6 +179,7 @@ export default function Markdown({ post }) {
171179 Tab,
172180 Button,
173181 Callout,
182+ CustomFence,
174183 },
175184 });
176185}
content/docs/arvo/clay/examples.md+4−3
@@ -517,10 +517,11 @@ First, using the `send-task-take-gift.hoon` thread, let's try creating a new `de
517517
518518Now if we scry for our `desk`s we'll see `%foo` is there:
519519
520−```
520+{% customFence %}
521+
521522> .^((set desk) %cd /===)
522−{%bitcoin %base %landscape %webterm %garden %foo}
523−```
523+> &#x7B;&#x25;bitcoin %base %landscape %webterm %garden %foo}
524+> {% /customFence %}
524525
525526Next, we'll create a merge conflict and try a couple of things. Mount `%foo` with `|mount /=foo=`, then add a `foo.txt` to both `desk`s but with different text in each and `|commit` them.
526527
content/docs/arvo/clay/scry.md+5−4
@@ -49,10 +49,11 @@ A scry with a `care` of `%d` will return a `(set desk)` of the `desk`s that exis
4949
5050Example:
5151
52−```
53−> .^((set desk) %cd /===)
54−{%bitcoin %base %landscape %webterm %garden}
55−```
52+{% customFence %}
53+
54+\> .^((set desk) %cd /===)
55+&#x7B;&#x25;bitcoin %base %landscape %webterm %garden}
56+{% /customFence %}
5657
5758## %e - Static mark core.
5859
content/docs/hoon/guides/strings.md+5−5
@@ -175,11 +175,11 @@ This is something to be wary of. For example, if you wanted to form a `(set @tas
175175However, this will actually form a set of the union `?(%foo %bar %baz)` due to
176176the specificity of type inference:
177177
178−```
179−> ? (silt (limo ~[%foo %bar %baz]))
180− ?(%~ [?(n=%bar n=%baz n=%foo) l=nlr(?(%bar %baz %foo)) r=nlr(?(%bar %baz %foo))])
181−[n=%baz l={%bar} r={%foo}]
182−```
178+{% customFence %}
179+\> ? (silt (limo ~[%foo %bar %baz]))
180+?(%~ [?(n=%bar n=%baz n=%foo) l=nlr(?(%bar %baz %foo)) r=nlr(?(%bar %baz %foo))])
181+[n=%baz l&#x7B;&#x25;bar} r=&#x7B;&#x25;foo}]
182+{% /customFence %}
183183
184184One further note about the type-as-itself form: Ocassionally you may wish to
185185form a union of strings which contain characters disallowed in `term`s. To get
content/docs/hoon/reference/stdlib/2i.md+6−5
@@ -825,12 +825,13 @@ A set.
825825
826826#### Examples
827827
828−```
829−> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
828+{% customFence %}
830829
831−> ~(key by a)
832−{%b %d %a %c}
833−```
830+\> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
831+
832+\> ~(key by a)
833+{&#x7B;&#x25;b %d %a %c}
834+{% /customFence %}
834835
835836---
836837
content/docs/hoon/reference/stdlib/4g.md+8−8
@@ -202,14 +202,14 @@ Either a `tape` or a crash.
202202
203203#### Source
204204
205−```hoon
206−++ scan |* [los=tape sab=rule]
207− =+ vex=((full sab) [[1 1] los])
208− ?~ q.vex
209− ~_ (show [%m '{%d %d}'] p.p.vex q.p.vex ~)
210− ~_(leaf+"syntax error" !!)
211− p.u.q.vex
212−```
205+{% customFence %}
206+++ scan |\* [los=tape sab=rule]
207+=+ vex=((full sab) [[1 1] los])
208+?~ q.vex
209+~_ (show [%m '&#x7B;&#x25;d %d}'] p.p.vex q.p.vex ~)
210+~_(leaf+"syntax error" !!)
211+p.u.q.vex
212+{% /customFence %}
213213
214214#### Examples
215215