on master help sign in
Merge pull request #533 from matildepark/patch-4

Some mark conversion documentation

commit707185956e6fac56d26e18c27594045d9165978d authorDavid Kerschner <david@tlon.io> dateThu 27 Jun 2019, 10:36 (7 years ago) parent7d45ce59aba50a
1 file changed+17−3
using/shell.md+17−3
using/shell.md+17−3
@@ -287,11 +287,25 @@ Which outputs a new `urbit.pill` to `pier/.urb/put/urbit.pill`
287287
288288##### `&` - Mark conversion
289289
290−Convert between marks using `&`:
290+Convert between marks using `&`, with the destination mark first. You can stack multiple mark conversions together, and some marks can only be converted to specific other marks. In this example, [Udon](./docs/using/sail-and-udon/#udon) is converted to `&hymn` (a mark which supplies the `html`, `head`, `body` and closing tags) first, before being converted to HTML:
291291
292292```
293−~your-urbit:dojo> &html &md '# hello'
294−'<html><head></head><body><div><h1 id="-hello">hello</h1></div></body></html>'
293+~your-urbit:dojo>&html &hymn &udon ';h1#hello: hello'
294+'<html><head></head><body><h1 id="hello">hello</h1></body></html>'
295+```
296+
297+Performing a conversion straight from Udon to the `&hymn` mark reveals a bit more about its mark conversion:
298+
299+```
300+~your-urbit:dojo>&hymn &udon ';h1#hello: hello'
301+[[%html ~] [[%head ~] ~] [[%body ~] [g=[n=%h1 a=~[[n=%id v="hello"]]] c=~[[g=[n=%$ a=~[[n=%$ v="hello"]]] c=~]]] ~] ~]
302+```
303+
304+As does converting straight from Udon to HTML:
305+
306+```
307+~your-urbit:dojo>&html &udon ';h1#hello: hello'
308+';h1#hello: hello'
295309```
296310
297311##### `_` - Run a function