### Install tree-sitter-solidity
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-solidity/typed-libraries/python/README.md
Install the package using pip. This command fetches and installs the necessary libraries for using tree-sitter with Solidity.
```bash
pip install tree-sitter-solidity
```
--------------------------------
### Start Development Server
Source: https://github.com/biomejs/gritql/blob/main/docs/README.md
Run this command to start the Next.js development server.
```shell
yarn dev
```
--------------------------------
### Install Dependencies
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-kotlin/README.md
Run this command to install the necessary Node.js dependencies for the project.
```bash
npm install
```
--------------------------------
### Build and Install Grit CLI
Source: https://github.com/biomejs/gritql/blob/main/crates/cli/README.md
Commands to build the Grit CLI from source and install it globally. Use `grit --help` to verify installation.
```bash
cargo build
```
```bash
cargo install --path .
```
```bash
grit --help
```
--------------------------------
### Install tree-sitter-toml
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-toml/README.md
Install the tree-sitter-toml package along with tree-sitter itself using npm.
```sh
npm install tree-sitter-toml tree-sitter
```
--------------------------------
### Clone Repository and Install Dependencies
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-sql/CONTRIBUTING.md
Clone the tree-sitter-sql repository and install necessary npm packages to set up the development environment.
```bash
git clone https://github.com/DerekStride/tree-sitter-sql.git
npm install
```
--------------------------------
### TOML AST for Key Order Example
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-toml/corpus/spec.txt
Abstract Syntax Tree representation for the TOML key order examples, illustrating both discouraged and recommended structures.
```tree-sitter-toml
(document
(comment)
(pair
(dotted_key
(bare_key)
(bare_key))
(string))
(pair
(dotted_key
(bare_key)
(bare_key))
(string))
(pair
(dotted_key
(bare_key)
(bare_key))
(string))
(pair
(dotted_key
(bare_key)
(bare_key))
(string))
(pair
(dotted_key
(bare_key)
(bare_key))
(string))
(pair
(dotted_key
(bare_key)
(bare_key))
(string))
(comment)
(pair
(dotted_key
(bare_key)
(bare_key))
(string))
(pair
(dotted_key
(bare_key)
(bare_key))
(string))
(pair
(dotted_key
(bare_key)
(bare_key))
(string))
(pair
(dotted_key
(bare_key)
(bare_key))
(string))
(pair
(dotted_key
(bare_key)
(bare_key))
(string))
(pair
(dotted_key
(bare_key)
(bare_key))
(string)))
```
--------------------------------
### Launch Playground
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-kotlin/README.md
Run this command to start an interactive web-based playground for visualizing the parsed syntax tree.
```bash
npm run playground
```
--------------------------------
### Multiple pip install commands
Source: https://github.com/biomejs/gritql/blob/main/crates/cli_bin/fixtures/notebooks/magic.ipynb
Shows consecutive pip install commands, which might be treated as a sequence of package installations.
```python
pip install nevershow
pip install nevershow
```
--------------------------------
### Inline Table Equivalents
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-toml/toml-spec/spec.md
This example shows standard table definitions that are equivalent to the inline table examples.
```toml
[name]
first = "Tom"
last = "Preston-Werner"
[point]
x = 1
y = 2
[animal]
type.name = "pug"
```
--------------------------------
### Install Grit CLI
Source: https://github.com/biomejs/gritql/blob/main/README.md
Installs the Grit command-line interface. Ensure you have curl installed.
```sh
curl -fsSL https://docs.grit.io/install | bash
```
--------------------------------
### Install tree-sitter-vue
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-vue/README.md
Install the tree-sitter-vue package along with the tree-sitter parser using npm.
```sh
npm install tree-sitter-vue tree-sitter
```
--------------------------------
### TOML Document Example
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-toml/toml-spec/spec.md
A comprehensive example demonstrating various TOML features including comments, key-value pairs, nested tables, arrays, and inline comments.
```toml
# This is a TOML document.
title = "TOML Example"
[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00 # First class dates
[database]
server = "192.168.1.1"
ports = [ 8001, 8001, 8002 ]
connection_max = 5000
enabled = true
[servers]
# Indentation (tabs and/or spaces) is allowed but not required
[servers.alpha]
ip = "10.0.0.1"
dc = "eqdc10"
[servers.beta]
ip = "10.0.0.2"
dc = "eqdc10"
[clients]
data = [ ["gamma", "delta"], [1, 2] ]
# Line breaks are OK when inside arrays
hosts = [
"alpha",
"omega"
]
```
--------------------------------
### Install package with pip
Source: https://github.com/biomejs/gritql/blob/main/crates/cli_bin/fixtures/notebooks/magic.ipynb
Standard Python code for installing a package using pip.
```python
pip install nevershow
```
--------------------------------
### Example: Lookup Wikibase property
Source: https://github.com/biomejs/gritql/blob/main/crates/cli_bin/fixtures/wikibase_agent.ipynb
Demonstrates calling the `vocab_lookup` function to find the PID for 'instance of'.
```python
print(vocab_lookup("instance of", entity_type="property"))
```
--------------------------------
### Create and Display a Basic Canvas
Source: https://github.com/biomejs/gritql/blob/main/crates/cli_bin/fixtures/notebooks/javascript.ipynb
This example requires setting the unstable flag for the kernel runtime. It creates a 200x200 canvas, draws a red rectangle, and displays it.
```javascript
import { createCanvas } from "jsr:@gfx/canvas@0.5.6";
const canvas = createCanvas(200, 200);
const ctx = canvas.getContext("2d");
ctx.fillStyle = "red";
ctx.fillRect(10, 10, 200 - 20, 200 - 20);
canvas
```
--------------------------------
### Tree-sitter CLI: Basic Usage
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-elixir/docs/parser.md
Shows fundamental commands for interacting with the Tree-sitter CLI, including getting help, generating parsers, and running tests.
```shell
npx tree-sitter -h
```
```shell
npx tree-sitter generate
```
```shell
npx tree-sitter test
```
```shell
npx tree-sitter test --filter "access syntax"
```
--------------------------------
### Example: Run SPARQL query
Source: https://github.com/biomejs/gritql/blob/main/crates/cli_bin/fixtures/wikibase_agent.ipynb
Demonstrates executing a SPARQL query to count the number of children of 'Q1339' via property 'P40'.
```python
run_sparql("SELECT (COUNT(?children) as ?count) WHERE { wd:Q1339 wdt:P40 ?children . }")
```
--------------------------------
### HCL Example
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-hcl/docs/index.html
A basic HCL configuration block.
```hcl
example "test" {
foo = "bar"
}
```
--------------------------------
### Example: Lookup Wikibase item
Source: https://github.com/biomejs/gritql/blob/main/crates/cli_bin/fixtures/wikibase_agent.ipynb
Demonstrates calling the `vocab_lookup` function to find the QID for 'Malin 1'.
```python
print(vocab_lookup("Malin 1"))
```
--------------------------------
### Python code with pip install
Source: https://github.com/biomejs/gritql/blob/main/crates/cli_bin/fixtures/notebooks/magic.ipynb
A mix of Python code and a pip install command. This demonstrates how magic commands might be interspersed with executable Python code.
```python
x = 1
pip install maybeshow
```
--------------------------------
### Run Github Pages Server
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-sql/CONTRIBUTING.md
Commands to navigate to the docs directory, install Jekyll dependencies, and serve the Github Pages locally.
```bash
$ cd docs/
$ bundle install
$ bundle exec jekyll serve
```
--------------------------------
### Install Playwright Dependencies
Source: https://github.com/biomejs/gritql/blob/main/docs/README.md
Install Playwright if you haven't already. This is required for running end-to-end tests.
```shell
yarn playwright install
```
--------------------------------
### Compile to WebAssembly
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-kotlin/README.md
Use this command to compile the Kotlin grammar to WebAssembly, typically after installing Emscripten.
```bash
npm run build-wasm
```
--------------------------------
### Vue Code Example for Tree-sitter
Source: https://github.com/biomejs/gritql/blob/main/resources/language-metavariables/tree-sitter-vue/docs/index.html
This is a Vue.js code example used within the Tree-sitter playground. It includes template, script, and style sections.
```Vue
Hello, {{ name }}!