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

feat(developer): add button to show parsed structure #2345

Merged
merged 2 commits into from Jan 15, 2020

Conversation

nknapp
Copy link
Contributor

@nknapp nknapp commented Jan 6, 2020

This is a small extension to the developer.html

  • It adds a button "Show structure" that adds a class to the "editor"-div
  • Once this happens, additional styles come into effect, that render highlighted spans as blocks with borders and a small label containing the class name.

While this is not perfect (I would rather like to see all modes) this was very helpful when I made that latest changes to the Handlebars language and I would like to see this in the master branch.

@joshgoebel
Copy link
Member

Snap of this in action? :)

@nknapp
Copy link
Contributor Author

nknapp commented Jan 6, 2020

Peek 2020-01-06 23-45

@nknapp
Copy link
Contributor Author

nknapp commented Jan 6, 2020

it's more helpful, if you define more classes on youre modes:

Peek 2020-01-06 23-57

@joshgoebel
Copy link
Member

Did you try and inline version vs block?

@nknapp
Copy link
Contributor Author

nknapp commented Jan 7, 2020

No, I actually wanted to have a tree view. But it might look better inline, if that doesn't run into layouting problems

I think the optimal solution for developing languages is still another one. Something displaying the test cases in a live reload server. I almost started building that, before I saw developer.html.

I didn't want to spend too much time on tooling, because the actual goal was to write the Handlebars definition.

@joshgoebel
Copy link
Member

Add a changelog entry for this improvement?

@nknapp
Copy link
Contributor Author

nknapp commented Jan 11, 2020

Will do.

@joshgoebel joshgoebel merged commit b33ef93 into highlightjs:master Jan 15, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants