cloudfour / guides

Conventions, processes and notes about how we do things
24 stars 1 forks source link

Add Code Block example to Blog Patterns guide #65

Closed spaceninja closed 4 years ago

spaceninja commented 4 years ago

Emerson

What's the best practice for showing blocks of code in a blog post? I didn't see it in our blog guides or the pattern library. <pre> + <code>?

Paul Hebert

You can use markdown so you can just use triple backticks to wrap code blocks

```css
/* some CSS */
<!-- some HTML -->
/* some JS */


**Emerson**
> Ha. I didn't realize the wp editor understood markdown! Thanks

**Derek Shirk**
> Not by default - as far as I know.

> In addition to Paul’s example, you can also make use of the `figure` and `figcaption` elements if you want to caption your code examples.
gerardo-rodriguez commented 4 years ago

Last I knew Prism was handling the syntax highlighting but it's also been a minute so I could be wrong. 🙂