├── content ├── _index.md ├── notes │ ├── _index.md │ ├── note_two │ │ ├── rust.png │ │ └── index.md │ ├── note_one.md │ └── markdown_here_cheatsheet.md └── about │ └── _index.md ├── .gitignore ├── screenshot.png ├── screenshot-index.png ├── static ├── fonts │ ├── iosevka-bold.woff2 │ ├── iosevka-italic.woff2 │ ├── iosevka-regular.woff2 │ └── iosevka-bolditalic.woff2 └── icons │ ├── twitter.svg │ └── github.svg ├── templates ├── 404.html ├── page.html ├── section.html └── index.html ├── .editorconfig ├── theme.toml ├── config.toml ├── sass ├── _colors.scss └── theme.scss ├── LICENSE └── README.md /content/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | sort_by = "weight" 3 | +++ 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # macOS 2 | *~ 3 | .DS_Store 4 | 5 | # Zola 6 | public/ 7 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barlog-m/oceanic-zen/HEAD/screenshot.png -------------------------------------------------------------------------------- /content/notes/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Notes" 3 | sort_by = "date" 4 | weight = 0 5 | +++ 6 | -------------------------------------------------------------------------------- /screenshot-index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barlog-m/oceanic-zen/HEAD/screenshot-index.png -------------------------------------------------------------------------------- /content/about/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "About" 3 | weight = 99 4 | +++ 5 | 6 | This is personal site. 7 | -------------------------------------------------------------------------------- /content/notes/note_two/rust.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barlog-m/oceanic-zen/HEAD/content/notes/note_two/rust.png -------------------------------------------------------------------------------- /static/fonts/iosevka-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barlog-m/oceanic-zen/HEAD/static/fonts/iosevka-bold.woff2 -------------------------------------------------------------------------------- /static/fonts/iosevka-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barlog-m/oceanic-zen/HEAD/static/fonts/iosevka-italic.woff2 -------------------------------------------------------------------------------- /static/fonts/iosevka-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barlog-m/oceanic-zen/HEAD/static/fonts/iosevka-regular.woff2 -------------------------------------------------------------------------------- /static/fonts/iosevka-bolditalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/barlog-m/oceanic-zen/HEAD/static/fonts/iosevka-bolditalic.woff2 -------------------------------------------------------------------------------- /content/notes/note_two/index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Note Two" 3 | date = 2020-09-29 4 | +++ 5 | 6 | This is an example note with image 7 | 8 | ![Rust](rust.png) 9 | -------------------------------------------------------------------------------- /templates/404.html: -------------------------------------------------------------------------------- 1 | {% extends "index.html" %} 2 | 3 | {% block content %} 4 |
5 |

404: Page not found

6 |
7 | {% endblock content %} 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_size = 4 6 | indent_style = space 7 | end_of_line = lf 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.{yml,yaml}] 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /theme.toml: -------------------------------------------------------------------------------- 1 | name = "Oceanic Zen" 2 | description = "Minimalistic blog theme" 3 | license = "MIT" 4 | homepage = "https://github.com/barlog-m/oceanic-zen" 5 | min_version = "0.12.0" 6 | demo = "https://oceanic-zen.netlify.app" 7 | 8 | [extra] 9 | 10 | [author] 11 | name = "Barlog M." 12 | homepage = "https://barlog.li" 13 | -------------------------------------------------------------------------------- /config.toml: -------------------------------------------------------------------------------- 1 | base_url = "https://oceanic-zen.netlify.app/" 2 | title = "Blog name" 3 | description = "Personal blog" 4 | compile_sass = true 5 | build_search_index = false 6 | 7 | [markdown] 8 | highlight_code = true 9 | highlight_theme = "visual-studio-dark" 10 | 11 | [extra] 12 | author = "Barlog M." 13 | github = "barlog-m" 14 | twitter = "barlog_m" 15 | -------------------------------------------------------------------------------- /sass/_colors.scss: -------------------------------------------------------------------------------- 1 | $black: #1b2b34; 2 | $black_light: #343d46; 3 | $gray_dark: #4f5b66; 4 | $gray: #65737e; 5 | $gray_light: #a7adba; 6 | $white: #c0c5ce; 7 | $silver: #cdd3de; 8 | $silver_light: #d8dee9; 9 | $white_pure: #ffffff; 10 | 11 | $red: #ec5f67; 12 | $orange: #f99157; 13 | $green: #99c794; 14 | $yellow: #fac863; 15 | $blue: #6699cc; 16 | $blue_light: #bcdaf7; 17 | $magenta: #c594c5; 18 | $cyan: #62b3b2; 19 | 20 | -------------------------------------------------------------------------------- /static/icons/twitter.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/page.html: -------------------------------------------------------------------------------- 1 | {% extends "index.html" %} 2 | 3 | {% block main %} 4 |
5 |
6 |

{{ page.title }}

7 |
8 | 11 |
12 |
13 | {{ page.content | safe }} 14 |
15 |
16 | {% endblock main %} 17 | -------------------------------------------------------------------------------- /templates/section.html: -------------------------------------------------------------------------------- 1 | {% extends "index.html" %} 2 | 3 | {% block main %} 4 | {% if section.pages %} 5 |

{{ section.title }}

6 |
7 | 16 | {% else %} 17 |
18 |
19 |

{{ section.title }}

20 |
21 |
22 |
23 | {{ section.content | safe }} 24 |
25 |
26 | {% endif %} 27 | {% endblock main %} 28 | -------------------------------------------------------------------------------- /static/icons/github.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Barlog M. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Oceanic Zen 2 | 3 | [![Netlify Status](https://api.netlify.com/api/v1/badges/e90897e9-f3e3-4906-b647-11a918af3a3b/deploy-status)](https://app.netlify.com/sites/oceanic-zen/deploys) 4 | 5 | Oceanic Zen is a theme for [Zola](https://www.getzola.org/) static site generator 6 | 7 | [Oceanic Zen](https://oceanic-zen.netlify.app/) is a minimalistic theme for personal blog. 8 | 9 | ![Screenshot](screenshot-index.png) 10 | ![Screenshot](screenshot.png) 11 | 12 | ## Installation 13 | 14 | Download theme to your `themes` directory: 15 | 16 | ```bash 17 | $ cd themes 18 | $ git clone https://github.com/barlog-m/oceanic-zen.git 19 | ``` 20 | 21 | Or add as git submodule 22 | 23 | ```bash 24 | $ git submodule add https://github.com/barlog-m/oceanic-zen.git themes/oceanic-zen 25 | ``` 26 | 27 | Enable it in your `config.toml`: 28 | 29 | ```toml 30 | theme = "oceanic-zen" 31 | ``` 32 | 33 | ## Options 34 | 35 | Theme supported some extra options 36 | 37 | ```toml 38 | [extra] 39 | author = "blog author name" 40 | github = "github author name" 41 | twitter = "twitter author name" 42 | ``` 43 | 44 | Font [Iosevka](https://typeof.net/Iosevka/) 45 | -------------------------------------------------------------------------------- /content/notes/note_one.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Note One" 3 | date = 2020-01-22 4 | +++ 5 | 6 | This is an example note. 7 | 8 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. 9 | 10 | File `~/projects/sandbox/c/fizzbuzz/fizzbuzz.c` 11 | 12 | ```c 13 | #include 14 | 15 | int main (void) 16 | { 17 | int i; 18 | for (i = 1; i <= 100; i++) 19 | { 20 | if (!(i % 15)) 21 | printf ("FizzBuzz"); 22 | else if (!(i % 3)) 23 | printf ("Fizz"); 24 | else if (!(i % 5)) 25 | printf ("Buzz"); 26 | else 27 | printf ("%d", i); 28 | 29 | printf("\n"); 30 | } 31 | return 0; 32 | } 33 | ``` 34 | 35 | Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. 36 | -------------------------------------------------------------------------------- /sass/theme.scss: -------------------------------------------------------------------------------- 1 | @import "colors"; 2 | 3 | @font-face { 4 | font-family: 'Iosevka'; 5 | src: url("/fonts/iosevka-regular.woff2"); 6 | font-display: swap; 7 | } 8 | @font-face { 9 | font-family: 'Iosevka'; 10 | src: url("/fonts/iosevka-italic.woff2"); 11 | font-style: italic; 12 | font-display: swap; 13 | } 14 | @font-face { 15 | font-family: 'Iosevka'; 16 | src: url("/fonts/iosevka-bold.woff2"); 17 | font-weight: bold; 18 | font-display: swap; 19 | } 20 | @font-face { 21 | font-family: 'Iosevka'; 22 | src: url("/fonts/iosevka-bolditalic.woff2"); 23 | font-weight: bold; 24 | font-style: italic; 25 | font-display: swap; 26 | } 27 | 28 | $font: "Iosevka", sans-serif; 29 | $font-mono: "Iosevka", monospace; 30 | $padding: 8px; 31 | 32 | body { 33 | font: 100% $font; 34 | background: $black; 35 | color: $white; 36 | } 37 | 38 | body { 39 | display: grid; 40 | grid-template-columns: auto; 41 | grid-template-areas: 42 | "header" 43 | "main" 44 | "footer"; 45 | } 46 | 47 | header { 48 | padding: $padding $padding 0 $padding; 49 | 50 | grid-area: header; 51 | 52 | display: flex; 53 | justify-content: space-between; 54 | align-items: center; 55 | } 56 | 57 | main { 58 | padding: $padding; 59 | grid-area: main; 60 | } 61 | 62 | footer { 63 | color: $gray_light; 64 | padding: 0 $padding $padding $padding; 65 | 66 | grid-area: footer; 67 | } 68 | 69 | .footer { 70 | display: flex; 71 | justify-content: space-between; 72 | align-items: center; 73 | } 74 | 75 | nav { 76 | list-style-type: none; 77 | } 78 | 79 | .nav { 80 | display: inline; 81 | } 82 | 83 | ul { 84 | list-style: none inside none; 85 | list-style-type: "·"; 86 | padding: 0; 87 | } 88 | 89 | li::marker { 90 | color: $green; 91 | } 92 | 93 | ul ul { 94 | padding-left: 1em; 95 | } 96 | 97 | a { 98 | font-size: none; 99 | color: $blue; 100 | text-decoration: none; 101 | } 102 | 103 | h1 { 104 | font-size: 24px; 105 | margin: 5px 0; 106 | font-weight: bold; 107 | } 108 | 109 | h2 { 110 | font-size: 22px; 111 | font-weight: bold; 112 | } 113 | 114 | h3 { 115 | font-size: 20px; 116 | font-weight: bold; 117 | } 118 | 119 | h4 { 120 | font-size: 18px; 121 | font-weight: bold; 122 | } 123 | 124 | h5 { 125 | font-size: 16px; 126 | font-weight: bold; 127 | } 128 | 129 | h6 { 130 | font-size: 14px; 131 | font-weight: bold; 132 | } 133 | 134 | pre { 135 | padding: 1em; 136 | margin: 1em; 137 | overflow-x: auto; 138 | } 139 | 140 | code { 141 | font: 16px $font-mono; 142 | } 143 | 144 | p > code { 145 | font-weight: bold; 146 | color: $gray; 147 | } 148 | 149 | .logo { 150 | font-size: 26px; 151 | font-weight: bold; 152 | } 153 | 154 | .date { 155 | color: $gray_light; 156 | font-size: 14px; 157 | } 158 | 159 | .border { 160 | color: $gray_dark; 161 | margin: 8px 0 8px 0; 162 | border-top: 2px dashed; 163 | } 164 | 165 | .notfound { 166 | text-align: center; 167 | } 168 | 169 | .icon { 170 | display: inline-block; 171 | vertical-align: middle; 172 | width: 16px; 173 | height: 16px; 174 | } 175 | 176 | .content { 177 | margin: 0 auto; 178 | width: 860px; 179 | } 180 | 181 | @media (max-width: 1200px) { 182 | .content { 183 | margin-left: 1em; 184 | margin-right: 1em; 185 | width: auto; 186 | max-width: 1200px; 187 | min-width: 200px; 188 | } 189 | } 190 | 191 | img { 192 | max-width: 100%; 193 | } 194 | -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% block head %} 5 | 6 | 7 | 8 | {% if config.description -%} 9 | 10 | {% endif %} 11 | 12 | {% block title %}{{ config.title }}{% endblock title %} 13 | 14 | {% block css %} 15 | 16 | {% endblock css %} 17 | {% endblock head %} 18 | 19 | 20 |
21 | {% block body%} 22 | {% block header %} 23 |
24 |
25 | 26 |
27 |
28 | 55 |
56 |
57 | {% endblock header %} 58 | {% block content %} 59 |
60 | {% block main %} 61 |

Index

62 |
63 |
    64 | {% set index = get_section(path="_index.md") %} 65 | {% for s in index.subsections %} 66 | {% set subsection = get_section(path=s) %} 67 |
  • 68 | 69 | {{ subsection.title }} 70 | 71 |
  • 72 | {% if subsection.pages %} 73 | 82 | {% endif %} 83 | {% endfor %} 84 |
85 | {% endblock main %} 86 |
87 | {% endblock content %} 88 |
89 | {% block footer %} 90 |
91 | 99 | {% endblock footer %} 100 |
101 | {% endblock body%} 102 |
103 | 104 | 105 | -------------------------------------------------------------------------------- /content/notes/markdown_here_cheatsheet.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Markdown Here Cheatsheet" 3 | date = 2020-03-20 4 | +++ 5 | 6 | This is intended as a quick reference and showcase. For more complete info, see [John Gruber's original spec](http://daringfireball.net/projects/markdown/) and the [Github-flavored Markdown info page](http://github.github.com/github-flavored-markdown/). 7 | 8 | This cheatsheet is specifically *Markdown Here's* version of Github-flavored Markdown. This differs slightly in styling and syntax from what Github uses, so what you see below might vary a little from what you get in a *Markdown Here* email, but it should be pretty close. 9 | 10 | You can play around with Markdown on our [live demo page](http://www.markdown-here.com/livedemo.html). 11 | 12 | (If you're not a Markdown Here user, check out the [Markdown Cheatsheet](./Markdown-Cheatsheet) that is not specific to MDH. But, really, you should also use Markdown Here, because it's awesome. http://markdown-here.com) 13 | 14 | ##### Table of Contents 15 | [Headers](#headers) 16 | [Emphasis](#emphasis) 17 | [Lists](#lists) 18 | [Links](#links) 19 | [Images](#images) 20 | [Code and Syntax Highlighting](#code) 21 | [Tables](#tables) 22 | [Blockquotes](#blockquotes) 23 | [Inline HTML](#html) 24 | [Horizontal Rule](#hr) 25 | [Line Breaks](#lines) 26 | [YouTube Videos](#videos) 27 | [TeX Mathematical Formulae](#tex) 28 | 29 | ## Headers 30 | 31 | ```no-highlight 32 | # H1 33 | ## H2 34 | ### H3 35 | #### H4 36 | ##### H5 37 | ###### H6 38 | 39 | Alternatively, for H1 and H2, an underline-ish style: 40 | 41 | Alt-H1 42 | ====== 43 | 44 | Alt-H2 45 | ------ 46 | ``` 47 | 48 | # H1 49 | ## H2 50 | ### H3 51 | #### H4 52 | ##### H5 53 | ###### H6 54 | 55 | Alternatively, for H1 and H2, an underline-ish style: 56 | 57 | Alt-H1 58 | ====== 59 | 60 | Alt-H2 61 | ------ 62 | 63 | ## Emphasis 64 | 65 | ```no-highlight 66 | Emphasis, aka italics, with *asterisks* or _underscores_. 67 | 68 | Strong emphasis, aka bold, with **asterisks** or __underscores__. 69 | 70 | Combined emphasis with **asterisks and _underscores_**. 71 | 72 | Strikethrough uses two tildes. ~~Scratch this.~~ 73 | ``` 74 | 75 | Emphasis, aka italics, with *asterisks* or _underscores_. 76 | 77 | Strong emphasis, aka bold, with **asterisks** or __underscores__. 78 | 79 | Combined emphasis with **asterisks and _underscores_**. 80 | 81 | Strikethrough uses two tildes. ~~Scratch this.~~ 82 | 83 | 84 | ## Lists 85 | 86 | ```no-highlight 87 | 1. First ordered list item 88 | 2. Another item 89 | * Unordered sub-list. 90 | 1. Actual numbers don't matter, just that it's a number 91 | 1. Ordered sub-list 92 | 4. And another item. 93 | 94 | Some text that should be aligned with the above item. 95 | 96 | * Unordered list can use asterisks 97 | - Or minuses 98 | + Or pluses 99 | ``` 100 | 101 | 1. First ordered list item 102 | 2. Another item 103 | * Unordered sub-list. 104 | 1. Actual numbers don't matter, just that it's a number 105 | 1. Ordered sub-list 106 | 4. And another item. 107 | 108 | Some text that should be aligned with the above item. 109 | 110 | * Unordered list can use asterisks 111 | - Or minuses 112 | + Or pluses 113 | 114 | ## Links 115 | 116 | There are two ways to create links. 117 | 118 | ```no-highlight 119 | [I'm an inline-style link](https://www.google.com) 120 | 121 | [I'm a reference-style link][Arbitrary case-insensitive reference text] 122 | 123 | [You can use numbers for reference-style link definitions][1] 124 | 125 | Or leave it empty and use the [link text itself] 126 | 127 | URLs and URLs in angle brackets will automatically get turned into links. 128 | http://www.example.com or and sometimes 129 | example.com (but not on Github, for example). 130 | 131 | Some text to show that the reference links can follow later. 132 | 133 | [arbitrary case-insensitive reference text]: https://www.mozilla.org 134 | [1]: http://slashdot.org 135 | [link text itself]: http://www.reddit.com 136 | ``` 137 | 138 | [I'm an inline-style link](https://www.google.com) 139 | 140 | [I'm a reference-style link][Arbitrary case-insensitive reference text] 141 | 142 | [You can use numbers for reference-style link definitions][1] 143 | 144 | Or leave it empty and use the [link text itself] 145 | 146 | URLs and URLs in angle brackets will automatically get turned into links. 147 | http://www.example.com or and sometimes 148 | example.com (but not on Github, for example). 149 | 150 | Some text to show that the reference links can follow later. 151 | 152 | [arbitrary case-insensitive reference text]: https://www.mozilla.org 153 | [1]: http://slashdot.org 154 | [link text itself]: http://www.reddit.com 155 | 156 | ## Images 157 | 158 | ```no-highlight 159 | Here's our logo (hover to see the title text): 160 | 161 | Inline-style: 162 | ![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1") 163 | 164 | Reference-style: 165 | ![alt text][logo] 166 | 167 | [logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 2" 168 | ``` 169 | 170 | Here's our logo (hover to see the title text): 171 | 172 | Inline-style: 173 | ![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1") 174 | 175 | Reference-style: 176 | ![alt text][logo] 177 | 178 | [logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 2" 179 | 180 | ## Code and Syntax Highlighting 181 | 182 | Code blocks are part of the Markdown spec, but syntax highlighting isn't. However, many renderers -- like Github's and *Markdown Here* -- support syntax highlighting. *Markdown Here* supports highlighting for dozens of languages (and not-really-languages, like diffs and HTTP headers); to see the complete list, and how to write the language names, see the [highlight.js demo page](http://softwaremaniacs.org/media/soft/highlight/test.html). 183 | 184 | ```no-highlight 185 | Inline `code` has `back-ticks around` it. 186 | ``` 187 | 188 | Inline `code` has `back-ticks around` it. 189 | 190 | Blocks of code are either fenced by lines with three back-ticks ```, or are indented with four spaces. I recommend only using the fenced code blocks -- they're easier and only they support syntax highlighting. 191 | 192 |
```javascript
193 | var s = "JavaScript syntax highlighting";
194 | alert(s);
195 | ```
196 |  
197 | ```python
198 | s = "Python syntax highlighting"
199 | print s
200 | ```
201 |  
202 | ```
203 | No language indicated, so no syntax highlighting. 
204 | But let's throw in a <b>tag</b>.
205 | ```
206 | 
207 | 208 | 209 | 210 | ```javascript 211 | var s = "JavaScript syntax highlighting"; 212 | alert(s); 213 | ``` 214 | 215 | ```python 216 | s = "Python syntax highlighting" 217 | print s 218 | ``` 219 | 220 | ``` 221 | No language indicated, so no syntax highlighting in Markdown Here (varies on Github). 222 | But let's throw in a tag. 223 | ``` 224 | 225 | Again, to see what languages are available for highlighting, and how to write those language names, see the [highlight.js demo page](http://softwaremaniacs.org/media/soft/highlight/test.html). 226 | 227 | ## Tables 228 | 229 | Tables aren't part of the core Markdown spec, but they are part of GFM and *Markdown Here* supports them. They are an easy way of adding tables to your email -- a task that would otherwise require copy-pasting from another application. 230 | 231 | ```no-highlight 232 | Colons can be used to align columns. 233 | 234 | | Tables | Are | Cool | 235 | | ------------- |:-------------:| -----:| 236 | | col 3 is | right-aligned | $1600 | 237 | | col 2 is | centered | $12 | 238 | | zebra stripes | are neat | $1 | 239 | 240 | The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown. 241 | 242 | Markdown | Less | Pretty 243 | --- | --- | --- 244 | *Still* | `renders` | **nicely** 245 | 1 | 2 | 3 246 | ``` 247 | 248 | Colons can be used to align columns. 249 | 250 | | Tables | Are | Cool | 251 | | ------------- |:-------------:| -----:| 252 | | col 3 is | right-aligned | $1600 | 253 | | col 2 is | centered | $12 | 254 | | zebra stripes | are neat | $1 | 255 | 256 | The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown. 257 | 258 | Markdown | Less | Pretty 259 | --- | --- | --- 260 | *Still* | `renders` | **nicely** 261 | 1 | 2 | 3 262 | 263 | ## Blockquotes 264 | 265 | ```no-highlight 266 | > Blockquotes are very handy in email to emulate reply text. 267 | > This line is part of the same quote. 268 | 269 | Quote break. 270 | 271 | > This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote. 272 | ``` 273 | 274 | > Blockquotes are very handy in email to emulate reply text. 275 | > This line is part of the same quote. 276 | 277 | Quote break. 278 | 279 | > This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote. 280 | 281 | ## Inline HTML 282 | 283 | You can also use raw HTML in your Markdown, and it'll mostly work pretty well. 284 | 285 | ```no-highlight 286 |
287 |
Definition list
288 |
Is something people use sometimes.
289 | 290 |
Markdown in HTML
291 |
Does *not* work **very** well. Use HTML tags.
292 |
293 | ``` 294 | 295 |
296 |
Definition list
297 |
Is something people use sometimes.
298 | 299 |
Markdown in HTML
300 |
Does *not* work **very** well. Use HTML tags.
301 |
302 | 303 | ## Horizontal Rule 304 | 305 | ``` 306 | Three or more... 307 | 308 | --- 309 | 310 | Hyphens 311 | 312 | *** 313 | 314 | Asterisks 315 | 316 | ___ 317 | 318 | Underscores 319 | ``` 320 | 321 | Three or more... 322 | 323 | --- 324 | 325 | Hyphens 326 | 327 | *** 328 | 329 | Asterisks 330 | 331 | ___ 332 | 333 | Underscores 334 | 335 | ## Line Breaks 336 | 337 | My basic recommendation for learning how line breaks work is to experiment and discover -- hit <Enter> once (i.e., insert one newline), then hit it twice (i.e., insert two newlines), see what happens. You'll soon learn to get what you want. "Markdown Toggle" is your friend. 338 | 339 | Here are some things to try out: 340 | 341 | ``` 342 | Here's a line for us to start with. 343 | 344 | This line is separated from the one above by two newlines, so it will be a *separate paragraph*. 345 | 346 | This line is also a separate paragraph, but... 347 | This line is only separated by a single newline, so it's a separate line in the *same paragraph*. 348 | ``` 349 | 350 | Here's a line for us to start with. 351 | 352 | This line is separated from the one above by two newlines, so it will be a *separate paragraph*. 353 | 354 | This line is also begins a separate paragraph, but... 355 | This line is only separated by a single newline, so it's a separate line in the *same paragraph*. 356 | 357 | (Technical note: *Markdown Here* uses GFM line breaks, so there's no need to use MD's two-space line breaks.) 358 | 359 | ## YouTube Videos 360 | 361 | They can't be added directly but you can add an image with a link to the video like this: 362 | 363 | ```no-highlight 364 | IMAGE ALT TEXT HERE 367 | ``` 368 | 369 | Or, in pure Markdown, but losing the image sizing and border: 370 | 371 | ```no-highlight 372 | [![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/YOUTUBE_VIDEO_ID_HERE/0.jpg)](http://www.youtube.com/watch?v=YOUTUBE_VIDEO_ID_HERE) 373 | ``` 374 | 375 | ## TeX Mathematical Formulae 376 | 377 | A full description of TeX math symbols is beyond the scope of this cheatsheet. Here's a [good reference](https://en.wikibooks.org/wiki/LaTeX/Mathematics), and you can try stuff out on [CodeCogs](https://www.codecogs.com/latex/eqneditor.php). You can also play with formulae in the Markdown Here options page. 378 | 379 | Here are some examples to try out: 380 | 381 | ``` 382 | $-b \pm \sqrt{b^2 - 4ac} \over 2a$ 383 | $x = a_0 + \frac{1}{a_1 + \frac{1}{a_2 + \frac{1}{a_3 + a_4}}}$ 384 | $\forall x \in X, \quad \exists y \leq \epsilon$ 385 | ``` 386 | 387 | The beginning and ending dollar signs (`$`) are the delimiters for the TeX markup. 388 | --------------------------------------------------------------------------------