Make code highlight sample page
This commit is contained in:
48
code.md
Normal file
48
code.md
Normal file
@@ -0,0 +1,48 @@
|
||||
## `heex`
|
||||
|
||||
```heex
|
||||
<.header>
|
||||
Listing Posts
|
||||
</.header>
|
||||
|
||||
<.table id="posts" rows={@posts} row_click={&JS.navigate(~p"/posts/#{&1}")}>
|
||||
<:col :let={post} label="id"><%= post.id %></:col>
|
||||
<:action :let={post}>
|
||||
<div class="sr-only">
|
||||
<.link navigate={~p"/posts/#{post}"}>Show</.link>
|
||||
</div>
|
||||
</:action>
|
||||
</.table>
|
||||
```
|
||||
|
||||
## `elixir`
|
||||
|
||||
```elixir
|
||||
if config_env() != :prod do
|
||||
# Configure pandoc (the version is required)
|
||||
config :pandoc,
|
||||
version: "3.6.1",
|
||||
hello: [
|
||||
args: fn extra_args ->
|
||||
{_, [input_file], _} = OptionParser.parse(extra_args, switches: [])
|
||||
~w(--output=../priv/static/posts/#{Path.rootname(input_file)}.html)
|
||||
end,
|
||||
cd: Path.expand("../documents", __DIR__)
|
||||
]
|
||||
end
|
||||
```
|
||||
|
||||
## `moonscript`
|
||||
|
||||
```moon
|
||||
class Thing
|
||||
name: "unknown"
|
||||
|
||||
class Person extends Thing
|
||||
say_name: => print "Hel#lo, I am #{@name}!"
|
||||
|
||||
with Person!
|
||||
.name = "MoonScript"
|
||||
\say_name!
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user