Skip to content

Commit

Permalink
Mockup for how custom classes in remark could work
Browse files Browse the repository at this point in the history
The idea is brought over from markdown-it. They do it the same way and I find it really intuitive. Also you do not have to write custom html into markdown.
  • Loading branch information
Algram authored Aug 6, 2017
1 parent b82d195 commit 7e9337c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/gatsby-transformer-remark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ This plugin adds additional fields to the `MarkdownRemark`
GraphQL type including `html`, `excerpt`, `headers`, etc. Other Gatsby
plugins can also add additional fields.

## Adding custom classes
You can also add custom classes to elements. This is especially useful for custom positioning of images, for example right-aligning:
```markdown
![Octocat](octocat.gif "This is Octocat"){.img .img--right}
```

This will result in the following:
```html
<img class="img img--right" src="octocat.gif" alt="Octocat" title="This is Octocat" />
```

## How to query

A sample GraphQL query to get MarkdownRemark nodes:
Expand Down

0 comments on commit 7e9337c

Please sign in to comment.