More granular token types
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13k
- Forks
- 1.4k
- Avg merge
- 15h 36m
- Merged PRs (30d)
- 3
Description
Motivation
This ties into #2849. There are a few token types that are missing right now and languages usually approximate. I.e. TOML has a date token type and all tokens have a number alias for coloring.
Description
A few new token types, I would like to suggest:
-
time(ordateordate-time): A type for dates, times, and other time instances.
We have a few languages that contain literals for dates and times. Right now, most of them use thenumbertype. -
character(orchar): A type for character literals.
Some languages support literals for string and characters (e.g. C/C++, C#, Java, Rust, Scheme). Themes should be able to give these literals a different color. -
ip-address(orip-addrorip): A type for IPv4 and IPv6 addresses.
Some languages support IP address literals. -
attr-assign: A token used to assign an attribute value to an attribute name.
Some people what to highlight the assignment operator of attributes differently (example). -
doc: An alias for different types to indicate that a string or comment is used for documentation (e.g. JavaDoc comments or Python docstrings). E.g.<span class="token comment doc">/** foo */</span>.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the related issue #2849 and the attribute assignment example in components/prism-markup.js. Review how the proposed token types relate to existing aliases and decide which names and semantics are accepted; the work is done when the agreed token types are specified and implemented consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100