Skip to content

Commit d5455a3

Browse files
committed
documented making code blocks copy-able
1 parent 0871ee9 commit d5455a3

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

README.md

+25-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ TINA=../path/to/tinacms TINA_WATCH=@tinacms/forms,react-tinacms-inline
2424
```
2525

2626
> ### Warning
27-
> This will only work for packages loaded by webpack. That means that environments which don't use
28-
> webpack (i.e. SSR builds) will not use this alias.
27+
>
28+
> This will only work for packages loaded by webpack. That means that environments which don't use
29+
> webpack (i.e. SSR builds) will not use this alias.
2930
3031
## Shortcodes
3132

@@ -48,3 +49,25 @@ Call the shortcode in your content by writing the name of the component encased
4849
### Shortcode Limitations
4950

5051
Shortcodes must be standalone elements; "wrapping" shortcodes will not work.
52+
53+
## Copy-able Code Blocks
54+
55+
A "Copy" button can be added to Code Blocks by adding the `copy` tag to fenced code blocks.
56+
57+
Non-copyable JS
58+
59+
```js
60+
const christmastPresent = new Banana()
61+
```
62+
63+
Copyable JS
64+
65+
```js,copy
66+
const christmastPresent = new Banana()
67+
```
68+
69+
Copyable Text
70+
71+
```copy
72+
Hello World
73+
```

content/docs/contributing/style-guide.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ This document should be used as a guideline when writing documentation and blog
2929
- "Code" in this case can include source code, terminal commands, variable names, and package names.
3030
- The above is not meant to be an exhaustive list, but use your best judgement.
3131
- Avoid `code tags` when discussing interface elements (such as navigation menus and in-app actions). Opt for **bold** text instead.
32+
- Code blocks should be made [copy-able](https://github.com/tinacms/tinacms.org/blob/master/README.md#copy-able-code-block) unless they show more context then should be copied (i.e. `diffs`)
3233
- Important concepts should be formatted in **bold (strong emphasis)**.
3334
- Other points of emphasis can be formatted in _italics (normal emphasis)_, or **bold (strong emphasis)** as appropriate.
3435
- When _an emphasized phrase_ appears near a **highlighted concept**, opt for _italics_ over **bold** for the former.

0 commit comments

Comments
 (0)