diff options
Diffstat (limited to 'tests/typ/text')
| -rw-r--r-- | tests/typ/text/raw-code.typ | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/tests/typ/text/raw-code.typ b/tests/typ/text/raw-code.typ index 41d20ead..ca7b247d 100644 --- a/tests/typ/text/raw-code.typ +++ b/tests/typ/text/raw-code.typ @@ -3,6 +3,14 @@ --- #set page(width: 180pt) #set text(6pt) +#show raw: it => rect( + width: 100%, + inset: (x: 4pt, y: 5pt), + radius: 4pt, + fill: rgb(239, 241, 243), + place(right, text(luma(110), it.lang)) + it, +) + ```typ = Chapter 1 #lorem(100) @@ -11,10 +19,6 @@ #show heading: emph ``` ---- -#set page(width: 180pt) -#set text(6pt) - ```rust /// A carefully designed state machine. #[derive(Debug)] @@ -25,10 +29,6 @@ fn advance(state: State<'_>) -> State<'_> { } ``` ---- -#set page(width: 180pt) -#set text(6pt) - ```py import this @@ -36,10 +36,6 @@ def hi(): print("Hi!") ``` ---- -#set page(width: 180pt) -#set text(6pt) - ```cpp #include <iostream> @@ -48,26 +44,28 @@ int main() { } ``` ---- -#set page(width: 180pt) -#set text(6pt) +```julia +# Add two numbers +function add(x, y) + return x * y +end +``` -#rect(inset: (x: 4pt, y: 5pt), radius: 4pt, fill: rgb(239, 241, 243))[ - ```html - <!DOCTYPE html> - <html> - <head> - <meta charset="utf-8"> - </head> - <body> - <h1>Topic</h1> - <p>The Hypertext Markup Language.</p> - <script> - function foo(a, b) { - return a + b + "string"; - } - </script> - </body> - </html> - ``` -] + // Try with some indent. + ```html + <!DOCTYPE html> + <html> + <head> + <meta charset="utf-8"> + </head> + <body> + <h1>Topic</h1> + <p>The Hypertext Markup Language.</p> + <script> + function foo(a, b) { + return a + b + "string"; + } + </script> + </body> + </html> + ``` |
