Pygments lexer for ddot.it (Knowledge Graph Notation).
Project description
pygments-ddot
Pygments lexer for ddot.it — a minimal text format for typed knowledge graphs.
Install
pip install pygments-ddot
The package registers itself via the pygments.lexers entry point, so
both pygmentize and any tool that uses pygments.lexers.get_lexer_by_name
will pick up ddot automatically.
Use
From the command line
pygmentize -l ddot -f html sample.ddot > sample.html
pygmentize -l ddot -f terminal sample.ddot
From Python
from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatters import HtmlFormatter
code = open("sample.ddot").read()
lexer = get_lexer_by_name("ddot")
print(highlight(code, lexer, HtmlFormatter()))
Aliases registered: ddot.it, ddot, ddotit. File pattern: *.ddot.
Token mapping
The lexer emits Pygments tokens chosen to map cleanly onto the canonical
token vocabulary at
ddot.it/test-data/tokens.md.
| Pygments token | Canonical name |
|---|---|
Name.Class |
subject |
Name.Function |
relation |
Literal.String.Symbol |
object |
Operator |
operator |
Keyword.Pseudo |
command |
Comment.Preproc |
meta-delim |
Comment.Special.Operator |
meta-operator |
Comment.Special.Relation |
meta-relation |
Comment.Special.Object |
meta-object |
Comment.Multiline |
meta-text |
Comment.Single |
disabled |
Conformance
The lexer is verified against the cross-implementation golden corpus —
identical to the TextMate, Shiki, and Rouge ports. See
tools/conformance-pygments.py.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygments_ddot-0.1.1.tar.gz.
File metadata
- Download URL: pygments_ddot-0.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7322dfb76ad488e8e5288f97e9c32e6de792fcdf55b1478f540e585646487d54
|
|
| MD5 |
75b764d766d3f9de8cfa4bcec2d17ce1
|
|
| BLAKE2b-256 |
faf6319752f2cf4003e531e3178cb2334446601a8f61b92ab130ca4cce12312e
|
Provenance
The following attestation bundles were made for pygments_ddot-0.1.1.tar.gz:
Publisher:
publish-pypi.yml on Calpano/ddot.it-syntax-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygments_ddot-0.1.1.tar.gz -
Subject digest:
7322dfb76ad488e8e5288f97e9c32e6de792fcdf55b1478f540e585646487d54 - Sigstore transparency entry: 1483529925
- Sigstore integration time:
-
Permalink:
Calpano/ddot.it-syntax-tools@938e333574bc77313c21a7c59482e0e8abca4b4d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Calpano
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@938e333574bc77313c21a7c59482e0e8abca4b4d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pygments_ddot-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pygments_ddot-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fd18f48101b55d54ea0c76bdbc4d179f8f61ee93efc33a6c79077346d473bcd
|
|
| MD5 |
ed79217da91c7f4ed906eb45f576d1f9
|
|
| BLAKE2b-256 |
d0b55ac1a5f27062ae9fb7c2a9f1e7310c31f9862b75d088140076fa44e2c500
|
Provenance
The following attestation bundles were made for pygments_ddot-0.1.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on Calpano/ddot.it-syntax-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pygments_ddot-0.1.1-py3-none-any.whl -
Subject digest:
4fd18f48101b55d54ea0c76bdbc4d179f8f61ee93efc33a6c79077346d473bcd - Sigstore transparency entry: 1483529970
- Sigstore integration time:
-
Permalink:
Calpano/ddot.it-syntax-tools@938e333574bc77313c21a7c59482e0e8abca4b4d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Calpano
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@938e333574bc77313c21a7c59482e0e8abca4b4d -
Trigger Event:
workflow_dispatch
-
Statement type: