-
Notifications
You must be signed in to change notification settings - Fork 6
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
HTML support #8
Comments
Hi, Thanks for the kind words. I'm glad you like it. Could you be more specific about what you're looking for, like with an example? Anyway, please see the variable |
Sure! This is a plugin similar to yours but in VS Code. It would be nice if yours did something similar. Maybe not stacking the different tags/indentation levels, although that would be nice too. |
If you use treesitter, this is quite easy to do like this: (defun dima-treesit-html-breadcrumbs ()
"Return a string of breadcrumbs."
(let ((node (treesit-node-at (point) 'html))
result)
(while node
(when (string= "element" (treesit-node-type node))
(push (treesit-node-text (treesit-node-child
(treesit-node-child node 0) 1))
result))
(setq node (treesit-node-parent node)))
(s-join " > " result))) The functions returns <html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Titleeez</title>
<style>
a {
height: 123px;
}
</style>
</head>
<body>
<p>123</p>
<h1 id="oeu" class="yoyo">oeu</h1>
<ul>
<li>
<h2>oeuoeu
</h2>
<div>
<div>
<div>
<h1>yo</h1>
This can also be done via treesitter and then placing a posframe at the top of the window. Topsy won't help here since the header line can't have newlines in it (from what I see). |
Hello! Long time no see. Awesome contribution to the community as usual.
I tried to use it with an html file, expecting the most recent opened tag to be displayed in the header line, however, it is not the case. It would be an awesome feature to have. Do you think it would be possible to implement it?
Thanks a lot for your work!
The text was updated successfully, but these errors were encountered: