| 1 |
<!DOCTYPE html> |
| 2 |
<html><head> |
| 3 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
| 4 |
<title>highlight.haml</title> |
| 5 |
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (Haml) - Theme (Breeze Dark)"/> |
| 6 |
</head><body style="background-color:#232629;color:#cfcfc2"><pre> |
| 7 |
<span style="color:#2980b9;font-weight:bold;">!!!</span> |
| 8 |
<span style="font-weight:bold;">%html</span><span style="color:#3daee9;">{</span> <span style="color:#da4453;">:xmlns</span> <span style="font-weight:bold;">=></span> <span style="color:#f44f4f;">"http://www.w3.org/1999/xhtml"</span>, <span style="color:#da4453;">:lang</span> <span style="font-weight:bold;">=></span> <span style="color:#f44f4f;">"en"</span>, <span style="color:#f44f4f;">"xml:lang"</span> <span style="font-weight:bold;">=></span> <span style="color:#f44f4f;">"en"</span><span style="color:#3daee9;">}</span> |
| 9 |
<span style="font-weight:bold;">%head</span> |
| 10 |
<span style="font-weight:bold;">%title</span> BoBlog |
| 11 |
<span style="font-weight:bold;">%meta</span><span style="color:#3daee9;">{</span><span style="color:#f44f4f;">"http-equiv"</span> <span style="font-weight:bold;">=></span> <span style="color:#f44f4f;">"Content-Type"</span>, <span style="color:#da4453;">:content</span> <span style="font-weight:bold;">=></span> <span style="color:#f44f4f;">"text/html; charset=utf-8"</span><span style="color:#3daee9;">}</span> |
| 12 |
<span style="font-weight:bold;">%link</span><span style="color:#3daee9;">{</span><span style="color:#da4453;">rel: </span><span style="color:#da4453;">'stylesheet'</span>, <span style="color:#da4453;">href: </span><span style="color:#da4453;">'main.css'</span>, <span style="color:#da4453;">type: </span><span style="color:#da4453;">'text/css'</span><span style="color:#3daee9;">}</span> |
| 13 |
<span style="color:#27ae60;"> :css</span> |
| 14 |
body { |
| 15 |
<span style="font-weight:bold;">font-size</span>: <span style="color:#f67400;">16</span><span style="color:#2980b9;">px</span><span style="color:#3f8058;">;</span> |
| 16 |
<span style="font-weight:bold;">margin-top</span>: <span style="color:#f67400;">0</span><span style="color:#2980b9;">px</span><span style="color:#3f8058;">;</span> |
| 17 |
<span style="font-weight:bold;">margin-bottom</span>: <span style="color:#f67400;">0</span><span style="color:#2980b9;">px</span><span style="color:#3f8058;">;</span> |
| 18 |
<span style="font-weight:bold;">font-family</span>: Arial<span style="color:#3f8058;">,</span> <span style="color:#f67400;">sans-serif</span><span style="color:#3f8058;">;</span> |
| 19 |
} |
| 20 |
|
| 21 |
p { |
| 22 |
<span style="font-weight:bold;">margin</span>: <span style="color:#f67400;">0</span><span style="color:#2980b9;">px</span><span style="color:#3f8058;">;</span> |
| 23 |
<span style="font-weight:bold;">padding</span>: <span style="color:#f67400;">0</span><span style="color:#2980b9;">px</span><span style="color:#3f8058;">;</span> |
| 24 |
} |
| 25 |
<span style="font-weight:bold;">%body</span> |
| 26 |
<span style="color:#f67400;font-weight:bold;">#header</span> |
| 27 |
<span style="font-weight:bold;">%a</span><span style="color:#3daee9;">{</span> |
| 28 |
<span style="color:#da4453;">href: </span>root_path, |
| 29 |
<span style="color:#da4453;">name: </span><span style="color:#f44f4f;">"home"</span> |
| 30 |
<span style="color:#3daee9;">}</span> |
| 31 |
<span style="font-weight:bold;">%h1</span> BoBlog |
| 32 |
<span style="font-weight:bold;">%h2</span> Bob's Blog |
| 33 |
<span style="color:#f67400;font-weight:bold;">#content</span> |
| 34 |
<span style="font-weight:bold;">-</span> <span style="color:#27ae60;">@entries</span><span style="color:#2980b9;">.each</span> <span style="color:#fdbc4b;font-weight:bold;">do</span> <span style="font-weight:bold;">|</span>entry<span style="font-weight:bold;">|</span> |
| 35 |
<span style="color:#f67400;">.entry</span><span style="color:#3daee9;">{</span> <span style="color:#da4453;">id: </span>entry<span style="color:#2980b9;">.id</span> <span style="color:#3daee9;">}</span> |
| 36 |
<span style="font-weight:bold;">%h3</span><span style="color:#f67400;">.title</span><span style="font-weight:bold;">=</span> entry<span style="color:#2980b9;">.title</span> |
| 37 |
<span style="font-weight:bold;">%p</span><span style="color:#f67400;">.date</span> |
| 38 |
Posted on <span style="color:#27ae60;">#{</span>entry<span style="color:#2980b9;">.posted.strftime</span>(<span style="color:#f44f4f;">"%A, %B %d, %Y"</span>)<span style="color:#27ae60;">}</span> |
| 39 |
<span style="font-weight:bold;">%p</span><span style="color:#f67400;">.body</span><span style="font-weight:bold;">=</span> entry<span style="color:#2980b9;">.body</span> |
| 40 |
<span style="font-weight:bold;">=</span> button_to <span style="color:#f44f4f;">"Load more"</span>, entries_path, |
| 41 |
<span style="color:#fdbc4b;font-weight:bold;">class</span>: <span style="color:#f44f4f;">"btn btn-primary"</span>, |
| 42 |
<span style="color:#da4453;">method: :get</span>, |
| 43 |
<span style="color:#da4453;">params: </span><span style="font-weight:bold;">{</span> <span style="color:#da4453;">last_id: </span><span style="color:#27ae60;">@entries</span><span style="color:#2980b9;">.map</span>(<span style="font-weight:bold;">&</span><span style="color:#da4453;">:id</span>)<span style="color:#2980b9;">.min</span> <span style="font-weight:bold;">}</span>, |
| 44 |
<span style="color:#da4453;">form: </span><span style="font-weight:bold;">{</span> <span style="color:#da4453;">data: </span><span style="font-weight:bold;">{</span> <span style="color:#da4453;">turbo_stream: </span><span style="color:#f67400;">true</span> <span style="font-weight:bold;">}</span> <span style="font-weight:bold;">}</span> |
| 45 |
<span style="color:#27ae60;"> :ruby</span> |
| 46 |
provide(<span style="color:#da4453;">:title</span>, user_title(<span style="color:#27ae60;">@user</span>)) |
| 47 |
provide(<span style="color:#da4453;">:og</span>, user_opengraph(<span style="color:#27ae60;">@user</span>)) |
| 48 |
provide(<span style="color:#da4453;">:meta</span>, user_twitter_card(<span style="color:#27ae60;">@user</span>)) |
| 49 |
|
| 50 |
parent_layout <span style="color:#da4453;">'user/profile'</span> |
| 51 |
<span style="color:#f67400;font-weight:bold;">#footer</span> |
| 52 |
<span style="font-weight:bold;">%p</span> |
| 53 |
All content copyright © Bob |
| 54 |
|
| 55 |
<span style="color:#f67400;font-weight:bold;">#filterTest</span> |
| 56 |
<span style="font-weight:bold;">%p</span> Just testing some more HAML filters |
| 57 |
|
| 58 |
<span style="color:#27ae60;"> :coffee</span> |
| 59 |
window<span style="font-weight:bold;">.</span>alert <span style="color:#f44f4f;">"Hello from CoffeeScript </span><span style="color:#3daee9;">#{</span>1<span style="color:#3daee9;">}</span><span style="color:#f44f4f;">"</span> |
| 60 |
|
| 61 |
<span style="color:#27ae60;"> :coffeescript</span> |
| 62 |
window<span style="font-weight:bold;">.</span>alert <span style="color:#f44f4f;">"Hello from CoffeeScript again, </span><span style="color:#3daee9;">#{</span>1 + 1<span style="color:#3daee9;">}</span><span style="color:#f44f4f;">"</span> |
| 63 |
|
| 64 |
<span style="color:#27ae60;"> :css</span> |
| 65 |
<span style="color:#27ae60;font-weight:bold;">#filterTest</span> { |
| 66 |
<span style="font-weight:bold;">display</span>: <span style="color:#f67400;">none</span><span style="color:#3f8058;">;</span> |
| 67 |
} |
| 68 |
|
| 69 |
<span style="color:#27ae60;"> :erb</span> |
| 70 |
For some reason <span style="color:#2980b9;font-weight:bold;"><%=</span><span style="color:#0099ff;"> </span><span style="color:#f44f4f;">"ERB works too </span><span style="color:#3daee9;">#{</span><span style="color:#27ae60;">@abcdef</span><span style="color:#3daee9;">}</span><span style="color:#f44f4f;">"</span><span style="color:#0099ff;"> </span><span style="color:#2980b9;font-weight:bold;">%></span>. |
| 71 |
|
| 72 |
<span style="color:#27ae60;"> :plain</span> |
| 73 |
Anything else should be treated as plain text. |
| 74 |
This also means that the following shouldn't be highlighted: |
| 75 |
|
| 76 |
%h1#superawesomeheading Heading 1 |
| 77 |
|
| 78 |
<span style="font-weight:bold;">%div</span> Filter test done |
| 79 |
</pre></body></html> |