The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Add A Language To The Tree-sitter CLi Tool

TODO: Pull subtitle into page object pre_start_default_section pre_end_default_section

Installation

Installation took two steps

- Clone the repo for the desired language

- Update `parser-directories`` array in the _config.json__ file to add the parent directory above the repo

For example, I installed the HTML language parser/highlighter in my _~/workshop__ directory with:

code_start_default_section code_end_default_section

Running The Example

With that in place, this works and highlights the HTML properly

Code
tree-sitter highlight example.neo

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Add A Language To The Tree-sitter CLi Tool

I'm working on the Tree-sitter^ts^^ parser and syntax 
highlighter for Neopolitan^neo^^. One feature
of the format is the ability to embed other languages.
It took me a while to figure out that in order for
the injected langauges to highlight properly I had
to install each language for the CLI tool individually.

I did this in my tree-sitter config.json file which is
here on my mac:

-- pre/

~/Library/Application Support/tree-sitter/config.json

-- /pre

-- h3

Installation

Installation took two steps

-- olist

- Clone the repo for the desired language

- Update `parser-directories`` array in the _config.json__
file to add the parent directory above the repo

-- p

For example, I installed the HTML language parser/highlighter
in my _~/workshop__ directory with:

-- code/

cd ~/workshop
git clone git@github.com:tree-sitter/tree-sitter-html.git

-- /code

Then I added this 

-- code/
-- json

{
  "parser-directories": [
    "/Users/alan/workshop"
  ],

  "other_config_stuff": {}
}

-- /code

-- h3

Running The Example

With that in place, this works and highlights
the HTML properly

-- code

tree-sitter highlight example.neo


-- ref
-- id: neo
-- title: Neopolitan
-- url: /neopolitan/

My mardkdown-like plain-text file format

-- ref
-- id: ts
-- title: Tree-sitter
-- url: https://tree-sitter.github.io/tree-sitter/

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

-- ref
-- title: tree-sitter-html
-- url: https://github.com/tree-sitter/tree-sitter-html

The HTML language parser/highlighter repo for Tree-sitter


-- categories
-- Tree-sitter 
-- Neopolitan 

-- metadata
-- date: 2023-10-15 10:09:10
-- id: 2wnqz4sc
-- site: aws
-- type: post
-- status: published