An open API service indexing awesome lists of open source software.

https://github.com/purplebooth/gfmfmt-action

Format your markdown into a standard format, and check PRs have markdown formatted in a standard way using pandoc
https://github.com/purplebooth/gfmfmt-action

Last synced: 5 months ago
JSON representation

Format your markdown into a standard format, and check PRs have markdown formatted in a standard way using pandoc

Awesome Lists containing this project

README

          

# gfmfmt action

Format your markdown into a standard format, and check users have
formatted their markdown formatted uniformly using
[pandoc](https://pandoc.org/)

## A note on Markdown Flavours

While it may appear that Markdown is a single standard, that's not quite
true, there's lots of little extensions to it that make it not exactly
the same across the board. This is intended for use with "[GitHub
Flavoured
Markdown](https://docs.github.com/en/github/writing-on-github)". You can
read more about this on the [pandoc
docs](https://pandoc.org/MANUAL.html#markdown-variants).

The name comes from this fact: gfmfmt, GitHub Flavoured Markdown
Formatter.

## Inputs

### `check`

**Optional** Only check the markdown, don't fix it. Default `"true"`.

### `pattern`

**Optional** Pattern to filter files by. Default `".*\.md$"`.

## Example usage

### Checking all markdown files

``` yaml
lint-markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: PurpleBooth/gfmfmt-action@v2.0.14
```

### Checking some markdown files

``` yaml
lint-markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: PurpleBooth/gfmfmt-action@v1.0.3
with:
pattern: 'README.md$'
```

### Fixing all markdown files

``` yaml
lint-markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: PurpleBooth/gfmfmt-action@v1.0.3
with:
check: 'false'
- run: git add .
- run: git commit -m "Formatting markdown"
- run: git push
```

### Fixing some markdown files

``` yaml
lint-markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: PurpleBooth/gfmfmt-action@v1.0.3
with:
check: 'false'
pattern: 'README.md$'
- run: git add .
- run: git commit -m "Formatting markdown"
- run: git push
```

## Annotations

The annotations look like this

A red annotation with the diff on it

## CLI Tool

See [PurpleBooth/gfmfmt](https://github.com/PurpleBooth/gfmfmt)