Skip to content

Evref-BL/FASTHTML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

FASTHTML

FASTHTML is a recently created project that integrates with Moose and leverages the Tree-Sitter parser to analyze HTML files in Pharo.

Features

FASTHTML relies on:

  • [FAST][fast], to ensure compatibility with Moose.
  • [Pharo-Tree-Sitter][pharo-tree-sitter], implemented in Pharo via the FFI protocol to efficiently parse HTML files. It is also used to do incremental parsing.

FASTHTML metamodel is defined in a way where nodes align with those generated by Tree-Sitter.

Installation

To load FASTHTML in Pharo, execute the following in a Moose image:

Metacello new  
  baseline: 'FASTHTML';  
  repository: 'github://Evref-BL/FASTHTML:main';  
  load.

Usage

To use it, please ensure that you have installed the corresponding libraries for Tree Sitter on your machine, to ensure parsing succeeds. Normally, this has been automated for different operating systems. But for more details, you can have a look at this [blog-post][tree-sitter-blog].

To use it in Pharo, you can check example below:

res := FASTHTMLParser new parse: '<p>
    <button disabled>Click Me!</button>
  </p>'. 

NB

The project is still at the very beginning. But at least now it can parse and generate a model of FASTHTML. Still need to:

  • Reorder classes
  • Add new properties
  • Check traits
  • Add tests

Your contribution is more than welcome. Happy coding with HTML :)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published