Trash Demo

Table of contents (generated automatically using {{ toc }}):


Hello, world! This is a demo of the Trash website compiler. ๐Ÿ—‘๏ธ <- :wastebasket:

To view it properly, you can ask Trash to serve it with live-reloading:

$ cd examples/blog
$ trash serve
Build complete in 324.5177ms.
Server starting on http://localhost:8080
Watching for changes...

All of the following elements can be compiled fully on the server side, serving zero client-side JS!

LaTeXLaTeX expressions ยถ

Given the radius rr of a circle, the area AA is:

A=ฯ€ร—r2 A = \pi \times r^2

And the circumference CC is:

C=2ฯ€r C = 2 \pi r

The page will live-reload if you change any of this!

D2 diagram: ยถ

dogscatsmicereplica 1replica 2abchasechaseTo err is human, to moo bovine1*

Mermaid Mindmap: ยถ

ProblemCategoryACategoryBCategoryCCategoryDCauseACauseBUsualCauseAUsualCauseBUsualCauseCUsualCauseDCauseCCauseDCauseE

Pikchr diagram: ยถ

MarkdownSourceMarkdownFormatter(markdown.c)HTML+SVGOutputPikchrFormatter(pikchr.c)

Embed YouTube videos & audio files ยถ

…with native Markdown syntax!

Syntax highlighting ยถ

Go:

func main() {
    fmt.Println("ok")
}

JavaScript:

"b" + "a" + +"a" + "a"; // -> 'baNaNa'

Life Inside Fences ยถ

This paragraph is inside a fenced block.

You can nest and assign custom IDs to them.

Callouts ยถ

Trash also supports GitHub style callouts:

NOTE

Highlights information that users should take into account, even when skimming.

TIP

Optional information to help a user be more successful.

IMPORTANT

Crucial information necessary for users to succeed.

WARNING

Critical content demanding immediate user attention due to potential risks.

CAUTION

Negative potential consequences of an action.

Image figures ยถ

This is an extension of Markdown that allows you to place <figure> elements by typing text below an image:

Rainbow Dash

Rainbow Dash

Rarity

Rarity

Notice how we’re appending ?w=100px after the image URL and Trash automatically knows to make it 100px, even though the host doesn’t support it:

![](https://your-image.com/image.png?w=100px)
![alt text](https://example.com/image.png|200 "title")
![alt text|200x300](https://example.com/image.png "title")
![alt text|200px](https://example.com/image.png "title")
![alt text|50%](https://example.com/image.png "title")
![alt text|50%](https://example.com/image.png?align=left "title")

(you might remember this from Obsidian).

Other extensions ยถ

This is a red heading made with the CommonMark attribute syntax ยถ

Trash fully supports all extensions of GitHub Flavored Markdown (including tables, autolinks, strikethrough text, tasklists, definition lists and footnotes):

Pony NameSpeciesColor SchemeElement
Twilight SparkleAlicornPurple / PinkMagic
Rainbow DashPegasusBlue / RainbowLoyalty
Pinkie PieEarth PonyPinkLaughter
ApplejackEarth PonyOrange / BlondeHonesty
FluttershyPegasusYellow / PinkKindness
RarityUnicornWhite / PurpleGenerosity

This is a test of the typographer extension – this should’ve been an em dash --, «this should be in quotation marks», “this should be in quotes” and this should be an ellipsis…

This is some small subtext.

Use Ctrl + C or โŒ˜ + C to copy text (<kbd> tag).

You can highlight text by wrapping it in ==.

Twemojis (toggled by emoji.custom in the config): ๐Ÿ˜ญ ๐Ÿฅบ ๐Ÿ˜ณ ๐Ÿ™ ๐Ÿ”ฅ โค๏ธ ๐Ÿฅ€ ๐Ÿ‘… ๐Ÿ‘ ๐Ÿ˜ก ๐Ÿ’” ๐Ÿ˜‡ ๐Ÿ˜” ๐Ÿ˜  ๐Ÿ˜‹ ๐Ÿ’ช ๐Ÿคค ๐Ÿ˜ฃ ๐Ÿฅน โ˜๏ธ ๐Ÿฑ ๐Ÿ˜… ๐Ÿ’€ ๐Ÿง  ๐Ÿชซ ๐ŸŒน โค๏ธโ€๐Ÿฉน ๐Ÿ™€ ๐Ÿณ ๐Ÿค“ โœ… ๐Ÿณ๏ธโ€๐ŸŒˆ ๐Ÿณ๏ธโ€โšง๏ธ โšง๏ธ ๐Ÿฅญ ๐Ÿ†

East Asian line breaks ยถ

Soft line breaks are rendered as a newline.

ๅฐ้ฉฌๅฎ่މ็š„ๆœ‹ๅ‹ไปฌ
ๅฅนไปฌไธ€่ตท็ปๅކๅ†’้™ฉใ€‚
ใƒˆใƒฏใ‚คใƒฉใ‚คใƒˆใ‚นใƒ‘ใƒผใ‚ฏใƒซใจไปฒ้–“ใŸใก
ๅฝผๅฅณใŸใกใฏๅ‹ๆƒ…ใฎ้ญ”ๆณ•ใ‚’ไฟกใ˜ใฆใ„ใพใ™ใ€‚
๋งˆ์ด๋ฆฌํ‹€ํฌ๋‹ˆ ์นœ๊ตฌ๋“ค
๊ทธ๋“ค์€ ์–ธ์ œ๋‚˜ ์šฐ์ •์„ ์†Œ์ค‘ํžˆ ํ•ฉ๋‹ˆ๋‹คใ€‚

Escaped space ยถ

The backslashes before the spaces are rendered as visible spaces instead of collapsing.

ๅฐ้ฉฌๅฎ่މๆœ‹ๅ‹ไปฌ
ใƒˆใƒฏใ‚คใƒฉใ‚คใƒˆใ‚นใƒ‘ใƒผใ‚ฏใƒซ
๋งˆ์ด๋ฆฌํ‹€ํฌ๋‹ˆ์นœ๊ตฌ๋“ค