Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/blocknotes/gumbo-crystal

Crystal C bindings for Gumbo library
https://github.com/blocknotes/gumbo-crystal

crystal gumbo

Last synced: about 1 month ago
JSON representation

Crystal C bindings for Gumbo library

Awesome Lists containing this project

README

        

# gumbo-crystal - PROJECT UNMAINTAINED [![Build Status](https://travis-ci.org/blocknotes/gumbo-crystal.svg)](https://travis-ci.org/blocknotes/gumbo-crystal)

> *This project is not maintained anymore*
>
> *If you like it or continue to use it fork it please.*

* * *
* * *

Crystal C bindings for Gumbo library, an HTML5 parsing library made by Google - see [gumbo-parser](https://github.com/google/gumbo-parser)

**NOTE**: actually not all functions are mapped - if you find something missing [contact me](http://www.blocknot.es/me)

## Requirements

- *gumbo* must be installed - see [installation](https://github.com/google/gumbo-parser#installation)
- *pkg-config* must be available

## Installation

Add this to your application's `shard.yml`:

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

## Usage

Wrapper access:

```ruby
require "gumbo-crystal"
output = Gumbo::Output.new LibGumbo.gumbo_parse "

A test

" # wrapper init
p output.root.type
output.uninitialize # wrapper deinit
```

Direct lib access:

```ruby
require "gumbo-crystal"
output = LibGumbo.gumbo_parse "

A test

" # lib init
p output.value.root.value.type
LibGumbo.gumbo_destroy_output Gumbo::DefaultOptions, output # lib deinit
```

## More examples

See [examples](https://github.com/blocknotes/gumbo-crystal/tree/master/examples) folder.

## Contributors

- [Mattia Roccoberton](http://blocknot.es) - creator, maintainer, Crystal fan :)