-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from creativenull/feat-automate-docs
feat(doc): automate docs, new defaults impl
- Loading branch information
Showing
100 changed files
with
2,411 additions
and
1,779 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Contributing | ||
|
||
## Requirements | ||
|
||
- [stylua](https://github.com/JohnnyMorganz/StyLua) - for formatting | ||
- [deno](https://deno.land/) - for documentation generation | ||
|
||
## Add a tool (linter/formatter) | ||
|
||
1. Read thru the efm-langserver readme and the schema to understand the structure. Additionally, you can go thru the | ||
`linters/*.lua`/`formatters/*.lua` files to see examples and copy and paste the code and adjust them. | ||
|
||
2. Add the metadata information above the file so that we can generate documentation for it. To end the metadata info, | ||
you must add a blank line after. Again follow the examples in any `linters/*.lua`/`formatters/*.lua` files. | ||
|
||
```lua | ||
-- Metadata | ||
-- languages: langA,langB,langC | ||
-- url: http://example.com | ||
|
||
|
||
``` | ||
|
||
## Add a tool to `default_config` option | ||
|
||
Users that use the `default_config` (`:help efmls-configs-defaults`) follow the tools registered in `lua/efmls-configs/defaults.json`. | ||
If you want to add a tool for a language that is not defined, then this json file is the place to add them. | ||
|
||
The linter/formatter name you add should match the filename in the `lua/efmls-configs/linters`/`lua/efmls-configs/formatters` | ||
directory. For example, adding eslint to an html filetype. The following values in the `linters` property should match | ||
`lua/efmls-configs/linters/eslint.lua`. | ||
|
||
```json | ||
{ | ||
"defaults": [ | ||
{ | ||
"languages": ["html"], | ||
"linters": ["eslint"] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
## Auto-generating Documentation | ||
|
||
Never touch the [`doc/SUPPORTED_LIST.md`](./doc/SUPPORTED_LIST.md)to add documentation for the tool you've add, to | ||
create documentation for run the following: | ||
|
||
```sh | ||
deno task gen | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"tasks": { | ||
"gen": "deno run --allow-read=lua/efmls-configs --allow-write=doc/SUPPORTED_LIST.md generate.ts" | ||
}, | ||
"fmt": { | ||
"lineWidth": 100 | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.