Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Pygments lexer for JSON Schema

License

NotificationsYou must be signed in to change notification settings

python-jsonschema/jsonschema-lexer

Repository files navigation

PyPI versionSupported Python versionsBuild status

Introduction

jsonschema-lexer provides a lexer for syntax highlighting JSON Schema documents viaPygments.

Usage

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

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp