2022-12-15 20:12:09 +03:00
|
|
|
# Doc rendering
|
|
|
|
|
|
|
|
```ucm:hide
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> builtins.mergeio
|
2022-12-15 20:12:09 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
```unison:hide
|
|
|
|
structural type Maybe a = Nothing | Just a
|
|
|
|
otherTerm = "text"
|
|
|
|
|
|
|
|
otherDoc : (Text -> Doc2) -> Doc2
|
|
|
|
otherDoc mkMsg = {{
|
|
|
|
This doc should be embedded.
|
|
|
|
|
|
|
|
{{mkMsg "message"}}
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
{{
|
|
|
|
# Heading
|
|
|
|
|
|
|
|
## Heading 2
|
|
|
|
|
|
|
|
Term Link: {otherTerm}
|
|
|
|
|
|
|
|
Type Link: {type Maybe}
|
|
|
|
|
|
|
|
Term source:
|
|
|
|
|
|
|
|
@source{term}
|
|
|
|
|
|
|
|
Term signature:
|
|
|
|
|
|
|
|
@signature{term}
|
|
|
|
|
|
|
|
* List item
|
|
|
|
|
|
|
|
1. Numbered list item
|
|
|
|
|
|
|
|
> Block quote
|
|
|
|
|
|
|
|
Code block
|
|
|
|
|
|
|
|
Inline code:
|
|
|
|
|
|
|
|
`` 1 + 2 ``
|
|
|
|
|
2023-07-18 01:15:52 +03:00
|
|
|
`"doesn't typecheck" + 1`
|
2022-12-15 20:12:09 +03:00
|
|
|
|
|
|
|
[Link](https://unison-lang.org)
|
|
|
|
|
|
|
|
![Image](https://share-next.unison-lang.org/static/unison-logo-circle.png)
|
|
|
|
|
|
|
|
**Bold**
|
|
|
|
|
|
|
|
*Italic*
|
|
|
|
|
|
|
|
~~Strikethrough~~
|
|
|
|
|
|
|
|
Horizontal rule
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
Table
|
|
|
|
|
|
|
|
| Header 1 | Header 2 |
|
|
|
|
| -------- | -------- |
|
|
|
|
| Cell 1 | Cell 2 |
|
|
|
|
| Cell 3 | Cell 4 |
|
|
|
|
|
|
|
|
|
|
|
|
Video
|
|
|
|
|
|
|
|
{{ Special (Embed (Any (Video [(MediaSource "test.mp4" None)] [("poster", "test.png")]))) }}
|
|
|
|
|
|
|
|
Transclusion/evaluation:
|
|
|
|
|
|
|
|
{{otherDoc (a -> Word a )}}
|
|
|
|
|
|
|
|
}}
|
|
|
|
term = 42
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm:hide
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
2022-12-15 20:12:09 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> display term.doc
|
2022-12-15 20:12:09 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
```api
|
2024-06-27 20:17:27 +03:00
|
|
|
GET /api/projects/scratch/branches/main/getDefinition?names=term
|
2022-12-15 20:12:09 +03:00
|
|
|
```
|