Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidwinter/syntaxedit
A simple Python Qt syntax highlighting widget
https://github.com/davidwinter/syntaxedit
pygments pyqt pyside python qt qtpy syntax-highlighting
Last synced: about 2 months ago
JSON representation
A simple Python Qt syntax highlighting widget
- Host: GitHub
- URL: https://github.com/davidwinter/syntaxedit
- Owner: davidwinter
- License: mit
- Created: 2023-01-13T16:42:00.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-26T16:05:07.000Z (over 1 year ago)
- Last Synced: 2024-08-09T03:52:51.384Z (5 months ago)
- Topics: pygments, pyqt, pyside, python, qt, qtpy, syntax-highlighting
- Language: Python
- Homepage:
- Size: 331 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# syntaxedit
[![test](https://github.com/davidwinter/syntaxedit/workflows/ci_cd/badge.svg)](https://github.com/davidwinter/syntaxedit/actions?query=workflow%3Aci_cd) [![PyPI](https://img.shields.io/pypi/v/syntaxedit)](https://pypi.org/project/syntaxedit/)
> A simple Python Qt syntax highlighting widget
![syntaxedit](https://raw.githubusercontent.com/davidwinter/syntaxedit/main/example.png)
## Features
- Extensive [syntax](https://pygments.org/languages/) and [theme](https://pygments.org/styles/) support - powered by [Pygments](https://pygments.org)
- Set font and font size
- Set indentation size## Usage
1. Install package
```shell
pip install syntaxedit
```Or
```shell
poetry add syntaxedit
```2. In your app, include the package, and create a `SyntaxEdit` widget:
```python
from syntaxedit.core import SyntaxEditcode = """# Todo list
- [ ] Go shopping
- [x] Walk the dog"""widget = SyntaxEdit(code)
```### Available options
- `content`: the initial content for the widget. **Default:** `""`
- `parent`: parent Qt widget for SyntaxEdit. **Default:** `None`
- `font`: the font family for the widget. **Default:** `"Courier New"`
- `font_size`: size to use for the font. **Default:** `13`
- `syntax`: the code [syntax](https://pygments.org/languages/) to use. **Default:** `"Markdown"`
- `theme`: the syntax [theme](https://pygments.org/styles/) to use. **Default:** `"solarized-light"`
- `indentation_size`: the size for indentation. **Default:** `4`
- `use_theme_background`: whether to use the background colour from the theme or to not set one. **Default:** `True`## Authors
By [David Winter](https://github.com/davidwinter)
## License
MIT