Need help?
<- Back

Comments (31)

  • joshka
    https://fasterthanli.me/articles/my-gift-to-the-rust-docs-te... is a better link (the author's article about this rather than the artifact produced)
  • mg
    I'm currently building an online 3D-Editor that supports OpenSCAD and Python as the input language.The ease of use to highlight static text via Arborium seems nice: <script src="arborium.iife.js"></script> <pre><code class="language-python"> def hello(name): print("Hello " + name); </code></pre> But does it support editing highlighted text? If not, one would have to do some trickery by hiding a textarea and updating the <code> element on each keypress, I guess. Which probably has a thousand corner cases one would have to deal with.And how would one add SCAD support?
  • danielvaughn
    If you haven't tried building a grammar with tree-sitter, I highly recommend you do so. It's incredibly fun once you get into a flow state. The docs call it a zen-like experience, and that's a perfect way to describe it. It's so, so good.
  • aarol
    I've been toying around with tree-sitter and have seen the potential for a proper, non-regex based highlighter. It's really powerful because it actually parses the text into an AST. With the AST it's possible for example to make variables the same colour everywhere. A function passed as a parameter could be highlighted as a function even in the parameter list.I'm happy to see that tree sitter highlighting on the web is finally a thing. This seems really solid although the bundle size is a lot.
  • jasonjmcghee
    The sponsorships achieved by the author is admirable - they really make a lot of valuable oss.https://github.com/sponsors/fasterthanlime
  • f311a
    I had to wait for about 10 seconds for it to load on my crappy mobile connection.They also load 1 mb of fonts. In total, this page is close to 3 mb.Also, when you select a language, the grammar file gets downloaded twice.
  • pseudo_meta
    Treesitter is fantastic. It has builtin support in nvim, and there are a lot of plugins that make use of it.My favorite is nvim-treesitter-textobjects which gives you dozens of new targets for vim motions, such as a function call or the condition of a loop.
  • Tepix
    Tree-sitter:Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited.
  • divyeshio
    This is cool! How does it compares with Shiki or Highlighter.js in terms of performance?
  • mintflow
    Great project, I really love tree-sitter, recently I added a ini variant config profile support to my app, and just use gemini to write a grammar and combine it with another great project called runestone to support highlight the config profile, the total progress is quite smooth.
  • teo_zero
    Sorry, but I can't understand what this actually is. A library, a stand-alone tool, a Rust crate? What users does it target? Text editors, website creators?
  • unrealhoang
    The get started section seems to be broken or missing content.
  • virajk_31
    This is cool, was looking for something similar