title | layout | tags | updated | intro | |
---|---|---|---|---|---|
Cheatsheet styles |
2017/sheet |
|
2017-10-26 |
This is a reference of styles that you can use on Devhints cheatsheets. How
meta!
You can refer to this when contributing your own cheatsheets to the [GitHub repo](https://github.com/rstacruz/cheatsheets/).
|
{: .-three-column}
| -one-column
| |
| -two-column
| (default)|
| -three-column
| |
| -left-reference
| 3 columns
(short first column) |
| -no-hide
| Don't hide H2 |
See: H2 sections
| -prime
| Highlight |
See: H3 sections
| -bold-first
| Bold first column |
| -headers
| Show headers |
| -left-align
| Don't right align last column |
| -mute-em
| Lower opacity for italics |
| -no-wrap
| Don't wrap text |
| -shortcuts
| Shortcut keys |
See: Tables
| -box-chars
| Less line height
for box drawing chars |
| -setup
| Gray background |
| -wrap
| Enables line-wrapping |
See: Code
| -setup
| Gray background |
| -crosslink
| Has arrow on the link |
{: .-gray}
See: Paragraphs
| -also-see
| Lighter background |
| -four-column
| |
| -six-column
| |
See: Lists
{: .-prime}
## Section
{: .-two-column}
Devhints uses Kramdown, and supports adding classes via Kramdown's syntax.
{: .-three-column}
Each section can have the following children:
pre
ul
table
p
h4
{: .-prime}
This is a section with {: .-prime}
. Notice the fancy highlight! Great for "getting started" kind of snippets.
Every box is an H3 section. The box will encompass everything inside the body of the H3.
This is a basic section with paragraphs in it.
{: .-three-column}
here.is(() => {
some.code()
})
here.is.some.more()
Code blocks can be placed one after the other.
See: Cheatsheets
{: .-file}
here.is(() => {
some.code()
})
{: .-file}
here.is.some.more()
Code blocks can have headings.
app.start(() => {
const port = app.server.port
console.log(`Started at ${port}`)
})
{: data-line="3"}
Add {: data-line="3"}
to add line highlights.
app.start(() => {
const port = app.server.port
console.log(`Started at ${port}`)
})
{: data-line="2,3"}
Add {: data-line="2,3"}
to add multiple line highlights.
import React from 'react'
{: .-setup}
class Hello extends React.Component {
render () {
return <span>Hello</span>
}
}
Add {: .-setup}
to a pre
or table
or ul
.
function createNode(nodeName: string, options: { key: string }) {
return true
}
Long lines will have scrollbars.
<script>(function(d,s){if(window.Promise&&[].includes&&Object.assign&&window.Map)return;var js,sc=d.getElementsByTagName(s)[0];js=d.createElement(s);js.src='https://cdn.polyfill.io/v2/polyfill.min.js';sc.parentNode.insertBefore(js, sc);}(document,'script'))</script>
{: .-wrap}
Add -wrap
to wrap long lines.
{: .-three-column}
- This is
- a list
- with a few items
Here's an extra paragraph after the list.
createElement()
componentDidMount()
componentWillUnmount()
shouldComponentUpdate()
componentWillReceiveProps()
Here's an extra paragraph after the list.
{: .-one-column}
- One
- Two
- Three
- Four
- Five
- Six
- Seven
- Eight
- Nine
- Ten
- Eleven {: .-six-column}
Add {: .-six-column}
to make large lists.
- One
- Two
- Three
- Four
- Five
- Six
- Seven
- Eight
- Nine
- Ten
- Eleven {: .-four-column}
Add {: .-four-column}
to make large lists.
- One
- Two
- Three
- Four
- Five
- Six
- Seven
- Eight
- Nine
- Ten {: .-also-see}
Add {: .-also-see}
.
{: .-three-column}
This is a basic section with paragraphs in it. When paragraphs are the first elements in an H3 section's body, they appear as white.
···
When paragraphs appear after pre
/table
/ul
, they appear with a gray background.
Here's a prelude paragraph. Add {: .-setup}
to make paragraphs appear with a gray background.
{: .-setup}
···
Add {: .-crosslink}
to make big loud external links:
···
Home {: .-crosslink}
{: .-three-column}
Example | Output |
---|---|
%m/%d/%Y |
06/05/2013 |
%A, %B %e, %Y |
Sunday, June 5, 2013 |
%b %e %a |
Jun 5 Sun |
Example | Output |
---|---|
%H:%M |
23:05 |
%I:%M %p |
11:05 PM |
This is a basic table with h4's.
| V
| Vector |
| P
| Pencil |
| T
| Text |
| L
| Line |
| R
| Rectangle |
| O
| Oval |
| U
| Rounded |
{: .-shortcuts}
Add {: .-shortcuts}
to tables.
Prefix | Example | What |
---|---|---|
// |
//hr[@class='edge'] |
Anywhere |
./ |
./a |
Relative |
/ |
/html/body/div |
Root |
{: .-headers} |
Add {: .-headers}
to add headers.
···
···
{: .-left-reference}
···
···
···
···
···
···
···
···
···
···
{: .-one-column}
···