Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Implement naming conventions in HTML grammar #249

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

chbk
Copy link

@chbk chbk commented Jan 12, 2021

Description of the Change

This is a rewrite of the Tree-sitter grammar to implement naming conventions for syntax scopes.

Benefits

  • Improvements on punctuation.
  • Highlighting to be consistent with other languages.

Possible Drawbacks

Some new scopes to be added to themes. The changes aim to facilitate theme development, filling the template is enough to ensure coherent highlighting across languages, instead of painfully creating styling rules for every language separately.

Applicable Issues

Related Pull Requests

@chbk
Copy link
Author

chbk commented Jan 12, 2021

Preview of the changes with Atom's default syntax themes:

Without naming conventions
(current Tree-sitter grammar)
With naming conventions in
theme and Tree-sitter grammar
Solarized Dark
solarized-dark-html-0
Solarized Dark
solarized-dark-html-1
One Dark
one-dark-html-0
One Dark
one-dark-html-1
Base16 Tomorrow Dark
base16-dark-html-0
Base16 Tomorrow Dark
base16-dark-html-1
Atom Dark
atom-dark-html-0
Atom Dark
atom-dark-html-1
Solarized Light
solarized-light-html-0
Solarized Light
solarized-light-html-1
One Light
one-light-html-0
One Light
one-light-html-1
Base16 Tomorrow Light
base16-light-html-0
Base16 Tomorrow Light
base16-light-html-1
Atom Light
atom-light-html-0
Atom Light
atom-light-html-1

Code snippet:

<!doctype html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
  <head>
    <title>Origami</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="platypus.css">
  </head>
  <body>
    <a href="/">
      <img src="Anya.png"/>
      Lighthouse
    </a>
    <!-- Memory -->
    <form id="rocket">
      <input type="password"/>
      <button type="submit" class="paper rabbit">
        <span>Launch</span>
      </button>
    </form>
  </body>
</html>

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

Successfully merging this pull request may close these issues.

1 participant