Skip to content

Commit

Permalink
docs: typo corrections and refactor of README
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotfontaine committed Oct 2, 2024
1 parent 30dd40d commit d92d91e
Showing 1 changed file with 44 additions and 28 deletions.
72 changes: 44 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,41 @@
# tree-sitter-cylc

[![CI][ci]](https://github.com/elliotfontaine/tree-sitter-cylc/actions/workflows/ci.yml)
[![pypi][pypi]](https://pypi.org/project/tree-sitter-python/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![CI](https://img.shields.io/github/actions/workflow/status/elliotfontaine/tree-sitter-cylc/ci.yml?logo=github&label=CI)][ci]
[![pypi](https://img.shields.io/pypi/v/tree-sitter-cylc?logo=pypi&logoColor=ffd242)][pypi]
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)][license]

A [Tree-Sitter](https://github.com/tree-sitter/tree-sitter) grammar for [Cylc](https://github.com/cylc/cylc-flow)'s workflow configurations.

<!-- <p align="center">
<img src="https://raw.githubusercontent.com/cylc/cylc-admin/master/docs/img/cylc-logo.svg" width="150" alt="Cylc Logo">
<img src="https://tree-sitter.github.io/tree-sitter/assets/images/tree-sitter-small.png" width="50" alt="Tree-Sitter Logo">
</p> -->

[ci]: https://img.shields.io/github/actions/workflow/status/elliotfontaine/tree-sitter-cylc/ci.yml?logo=github&label=CI
[pypi]: https://img.shields.io/pypi/v/tree-sitter-cylc?logo=pypi&logoColor=ffd242
A [Tree-Sitter][repo-tree-sitter] grammar for [Cylc][repo-cylc]'s workflow configurations.

## References

- [The `.cylc` File Format](https://cylc.github.io/cylc-doc/stable/html/reference/config/file-format.html#file-format)
- [Workflow Configuration](https://cylc.github.io/cylc-doc/stable/html/reference/config/workflow.html)
- [Global Configuration](https://cylc.github.io/cylc-doc/stable/html/reference/config/global.html)
- [The `.cylc` File Format][docs-cylc-format]
- [Workflow Configuration][docs-workflow-config]
- [Global Configuration][docs-global-config]

## Syntax Highlighting

As a grammar, tree-sitter-cylc can be used to generate syntax highlighting for Cylc files in text editors that support Tree-Sitter. [`/queries/highlights.scm`](/queries/highlights.scm) and [`/queries/injections.scm`](/queries/injections.scm) can be used as a template to write queries for your target editor.
As a grammar, tree-sitter-cylc can be used to generate syntax highlighting for Cylc files in text
editors that support Tree-Sitter. [`/queries/highlights.scm`][query-highlights] and
[`/queries/injections.scm`][query-injections] can be used as a template to write queries
for your target editor.

#### Supported Editors :
#### Supported Editors:

- [Zed](https://zed.dev/) — ✅[`zed-cylc`](https://github.com/elliotfontaine/zed-cylc)
- [Neovim](https://neovim.io/)
- [Helix](https://helix-editor.com/)
- [Lapce](https://lapce.dev/)
- [Pulsar](https://pulsar-edit.dev/)
- [GNU Emacs (≥ 29.1)](https://www.gnu.org/software/emacs/)
- [Zed][zed] — ✅[`zed-cylc`][repo-zed-cylc]
- [Neovim][neovim], [Helix][helix], [Lapce][lapce], [Pulsar][pulsar] and [GNU Emacs][emacs].

## Python Bindings

tree-sitter-cylc is available as a package on [PyPi](https://pypi.org/project/tree-sitter-python/). You can install it through pip:
tree-sitter-cylc is available as a package on [PyPi][pypi]). You
can install it through pip as follows:

```sh
pip install tree-sitter tree-sitter-cylc
```

You can then use the **tree_sitter_cylc** module to parse Cylc files from Python:

```py
```python
import tree_sitter_cylc as tscylc
from tree_sitter import Language, Parser

Expand Down Expand Up @@ -75,12 +67,36 @@ assert setting.type == "setting"
assert value.type == "unquoted_string"
```

See [Tree-Sitter's Python bindings](https://github.com/tree-sitter/py-tree-sitter?tab=readme-ov-file#usage) documentation for more information.
See [Tree-Sitter's Python bindings][docs-python-bindings]
documentation for more information.

## Contributing

Contributions and bug reports are welcome! Please submit a pull request or file an issue on the [GitHub repository](https://github.com/elliotfontaine/zed-cylc).
Contributions, bug reports, and suggestions are welcome! Please submit a pull request or file an issue on
the [GitHub repository][repo-tree-sitter-cylc].

## License

[MIT](LICENSE)
This project is licensed under the MIT License. See [LICENSE][license] for details.

<!-- Links -->

[ci]: https://github.com/elliotfontaine/tree-sitter-cylc/actions/workflows/ci.yml
[pypi]: https://pypi.org/project/tree-sitter-cylc/
[license]: https://github.com/elliotfontaine/tree-sitter-cylc/blob/main/LICENSE
[query-highlights]: https://github.com/elliotfontaine/tree-sitter-cylc/blob/main/queries/highlights.scm
[query-injections]: https://github.com/elliotfontaine/tree-sitter-cylc/blob/main/queries/injections.scm
[repo-tree-sitter]: https://github.com/tree-sitter/tree-sitter
[repo-tree-sitter-cylc]: https://github.com/elliotfontaine/tree-sitter-cylc
[repo-cylc]: https://github.com/cylc/cylc-flow
[docs-cylc-format]: https://cylc.github.io/cylc-doc/stable/html/reference/config/file-format.html
[docs-workflow-config]: https://cylc.github.io/cylc-doc/stable/html/reference/config/workflow.html
[docs-global-config]: https://cylc.github.io/cylc-doc/stable/html/reference/config/global.html
[docs-python-bindings]: https://github.com/tree-sitter/py-tree-sitter?tab=readme-ov-file#usage
[zed]: https://zed.dev/
[repo-zed-cylc]: https://github.com/elliotfontaine/zed-cylc
[neovim]: https://neovim.io/
[helix]: https://helix-editor.com/
[lapce]: https://lapce.dev/
[pulsar]: https://pulsar-edit.dev/
[emacs]: https://www.gnu.org/software/emacs/

0 comments on commit d92d91e

Please sign in to comment.