Skip to content
Crystal C bindings for Gumbo library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
spec
src
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
shard.yml

README.md

gumbo-crystal Build Status

Crystal C bindings for Gumbo library, an HTML5 parsing library made by Google - see gumbo-parser

NOTE: actually not all functions are mapped - if you find something missing contact me

Requirements

  • gumbo must be installed - see installation
  • pkg-config must be available

Installation

Add this to your application's shard.yml:

dependencies:
  gumbo-crystal:
    github: blocknotes/gumbo-crystal

Usage

Wrapper access:

require "gumbo-crystal"
output = Gumbo::Output.new LibGumbo.gumbo_parse "<h1>A test</h1>" # wrapper init
p output.root.type
output.uninitialize # wrapper deinit

Direct lib access:

require "gumbo-crystal"
output = LibGumbo.gumbo_parse "<h1>A test</h1>" # lib init
p output.value.root.value.type
LibGumbo.gumbo_destroy_output Gumbo::DefaultOptions, output # lib deinit

More examples

See examples folder.

Contributors

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.