- Notifications
You must be signed in to change notification settings - Fork1
A Pygments lexer for JSON Schema
License
NotificationsYou must be signed in to change notification settings
python-jsonschema/jsonschema-lexer
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
jsonschema-lexer provides a lexer for syntax highlighting JSON Schema documents viaPygments.
Once installed, you can use it in your Python code to highlight JSON Schema documents.
Here's a simple example:
fromjsonschema_lexerimportJSONSchemaLexerfromrich.consoleimportConsolefromrich.syntaximportSyntaxconsole=Console()code="""{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://example.com/product.schema.json", "title": "Product", "description": "A product from Acme's catalog", "type": "object", "properties": { "productId": { "description": "The unique identifier for a product", "type": "integer" }, "productName": { "description": "Name of the product", "type": "string" } }}"""syntax=Syntax(code,lexer=JSONSchemaLexer(),background_color="default",word_wrap=True)console.print(syntax)
About
A Pygments lexer for JSON Schema
Resources
License
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.