Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
13 changes: 13 additions & 0 deletions .github/workflows/bb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: bb
on:
issues:
types: [opened, reopened, edited, closed, labeled, unlabeled]
pull_request_target:
types: [opened, reopened, edited, closed, labeled, unlabeled]
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: unifiedjs/beep-boop-beta@main
with:
repo-token: ${{secrets.GITHUB_TOKEN}}
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: main
on:
- pull_request
- push
jobs:
main:
name: '${{matrix.node}} on ${{matrix.os}}'
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- uses: dcodeIO/setup-node-nvm@master
with:
node-version: ${{matrix.node}}
- run: npm install
- run: npm test
- uses: codecov/codecov-action@v1
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
node:
- lts/erbium
- node
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage/
*.md
214 changes: 112 additions & 102 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
# Configuration

The default settings are **roughly**[(see the exact configuration)](#default-settings) equal to:
The default settings are **roughly**
[(see the exact configuration)](#default-settings) equal to:

```json
{
"retext-english": {
"plugins": [
["#retext-profanities"],
["#retext-spell", "#dictionary-en-gb"]
],
},
"remark-parse": {
"plugins": [
["#remark-preset-lint-markdown-style-guide"]
["#remark-retext", "#parse-latin"],
["#retext-profanities"],
["#retext-spell", "#dictionary-en-gb"]
]
}
"retext-english": {
"plugins": [
["#retext-profanities"],
["#retext-spell", "#dictionary-en-gb"]
],
},
"remark-parse": {
"plugins": [
["#remark-preset-lint-markdown-style-guide"]
["#remark-retext", "#parse-latin"],
["#retext-profanities"],
["#retext-spell", "#dictionary-en-gb"]
]
}
}
```

Your text editors (if they are [LSP clients](https://langserver.org/)) can be configured to override these settings.
Your text editors (if they are [LSP clients](https://langserver.org/)) can be
configured to override these settings.

## Configuration for text editors

Expand All @@ -36,82 +38,86 @@ and the file `/home/aecepoglu/.settings.json` would be:

```json
{
"unified-language-server": {
"retext-english": {
"plugins": [
...
]
},
"remark-parse": {
"plugins": [
...
]
}
}
"unified-language-server": {
"retext-english": {
"plugins": [
...
]
},
"remark-parse": {
"plugins": [
...
]
}
}
}
```

### For other editors

(TODO)

--------------------
***

## Re-Using Settings

If I wanted to use `retext-redundant-acronyms`, `retext-overuse`, `retext-intensify` and `retext-repeated-words` plugins for my text files and markdown files, I would do:
If I wanted to use `retext-redundant-acronyms`, `retext-overuse`,
`retext-intensify` and `retext-repeated-words` plugins for my text files and
markdown files, I would do:

```json
{
"unified-language-server": {
"retext-english": {
"plugins": [
["#retext-redundant-acronyms"],
["#retext-overuse"],
["#retext-intensify"],
["#retext-repeated-words"],
["#retext-spell", "#dictionary-en-gb"]
]
},
"remark-parse": {
"plugins": [
["#remark-preset-lint-markdown-style-guide"],
["#remark-retext", "#parse-latin"],
["#retext-redundant-acronyms"],
["#retext-overuse"],
["#retext-intensify"],
["#retext-repeated-words"],
["#retext-spell", "#dictionary-en-gb"]
]
}
}
"unified-language-server": {
"retext-english": {
"plugins": [
["#retext-redundant-acronyms"],
["#retext-overuse"],
["#retext-intensify"],
["#retext-repeated-words"],
["#retext-spell", "#dictionary-en-gb"]
]
},
"remark-parse": {
"plugins": [
["#remark-preset-lint-markdown-style-guide"],
["#remark-retext", "#parse-latin"],
["#retext-redundant-acronyms"],
["#retext-overuse"],
["#retext-intensify"],
["#retext-repeated-words"],
["#retext-spell", "#dictionary-en-gb"]
]
}
}
}
```

*BUT*, I (as a sane person) want my markdown rules to just follow my `retext-english` rules. I could enable that with:
*BUT*, I (as a sane person) want my markdown rules to just follow my
`retext-english` rules.
I could enable that with:

```json
{
"unified-language-server": {
"retext-english": {
"plugins": [
["#retext-redundant-acronyms"],
["#retext-overuse"],
["#retext-intensify"],
["#retext-repeated-words"],
["#retext-spell", "#dictionary-en-gb"]
]
},
"remark-parse": {
"plugins": [
["#remark-preset-lint-markdown-style-guide"]
],
"checkTextWith": {
"setting": "retext-english",
"mutator": ["#remark-retext", "#parse-latin"]
}
}
}
"unified-language-server": {
"retext-english": {
"plugins": [
["#retext-redundant-acronyms"],
["#retext-overuse"],
["#retext-intensify"],
["#retext-repeated-words"],
["#retext-spell", "#dictionary-en-gb"]
]
},
"remark-parse": {
"plugins": [
["#remark-preset-lint-markdown-style-guide"]
],
"checkTextWith": {
"setting": "retext-english",
"mutator": ["#remark-retext", "#parse-latin"]
}
}
}
}
```

Expand All @@ -121,52 +127,56 @@ And in fact, this is how the default configuration actually is:

```json
{
"unified-language-server": {
"retext-english": {
"plugins": [
["#retext-spell", "#dictionary-en-gb"]
]
},
"remark-parse": {
"plugins": [
["#remark-preset-lint-markdown-style-guide"]
],
"checkTextWith": {
"setting": "retext-english",
"mutator": ["#remark-retext", "#parse-latin"]
}
},
}
"unified-language-server": {
"retext-english": {
"plugins": [
["#retext-spell", "#dictionary-en-gb"]
]
},
"remark-parse": {
"plugins": [
["#remark-preset-lint-markdown-style-guide"]
],
"checkTextWith": {
"setting": "retext-english",
"mutator": ["#remark-retext", "#parse-latin"]
}
},
}
}
```

## Applying Settings Partially

When you omit any of the parsers in your configuration the default configuration will be used in its place.
When you omit any of the parsers in your configuration the default configuration
will be used in its place.

If are happy with what `remark-parse` does but you want `remark-english` to be different, you could:
If are happy with what `remark-parse` does but you want `remark-english` to be
different, you could:

```json
{
"unified-language-server": {
"retext-english": {
"plugins": [
["#retext-repeated-words"],
["#retext-spell", "#dictionary-en-gb"]
]
}
}
"unified-language-server": {
"retext-english": {
"plugins": [
["#retext-repeated-words"],
["#retext-spell", "#dictionary-en-gb"]
]
}
}
}
```

# The Format
## The Format

(TODO)

We rely entirely on [UnifiedJS parsers and processors](https://github.com/unifiedjs/unified#list-of-processors).
We rely entirely on
[UnifiedJS parsers and processors](https://github.com/unifiedjs/unified#list-of-processors).

The command line `--parser` option is used to parse the data.

If a string value starts with `#`, then the module with that name will be required.
If a string value starts with `#`, then the module with that name will be
required.

If a string value starts with `//`, then the file with that path will be read.
Loading