Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlighting mode #189

Open
evincarofautumn opened this issue Jul 5, 2017 · 0 comments
Open

Syntax highlighting mode #189

evincarofautumn opened this issue Jul 5, 2017 · 0 comments

Comments

@evincarofautumn
Copy link
Owner

We need a mode that accepts a source file and just performs syntax highlighting. Based on #177 it should recover from lexical errors as much as possible so that all inputs produce some reasonable output. Take this fragment as an example:

define hello (

It should be able to produce raw syntax highlighting information consisting of source spans and lexical categories for each token in JSON:

[
{"token": "define", "category": "keyword", "line": 1, "from": 1, "to": 6},
{"token": "hello", "category": "identifier", "line": 1, "from": 8, "to": 12},
{"token": "(", "category": "symbol", "line": 1, "from": 14, "to": 14}
]

It should also be able to directly generate a syntax-highlighted source file as HTML, preserving formatting:

<span class='kitten keyword'>define</span> <span class='kitten identifier'>hello</span> <span class='kitten symbol'>(</span>

Other output formats such as sourcemaps, RTF, and LaTeX would be nice to have but aren’t critical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant