www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Gumbo-d - D binding for Gumbo HTML 5 Parser

reply "Christopher Bertels" <chris fancy-lang.org> writes:
Hey everyone,

I started using D recently and have enjoyed the experience so far.
I've used vibe.d for a web service I wrote for work and I've 
recently started working on a D binding for Google's new Gumbo 
HTML 5 parser library that was recently released [1].

Here's a comparison of one of the examples that comes with gumbo:

Original:    
https://github.com/google/gumbo-parser/blob/master/examples/get_title.c
gumbo-d: 
https://github.com/bakkdoor/gumbo-d/blob/master/examples/get_title.d

I've added some helper methods for searching & dealing with child 
nodes in the DOM, and it's been really easy as a newcomer to come 
up with the right compile-time templates. Can't say it's ever 
been this easy in C++ or any other language.

Let me know what you think of the code. I started reading TDPL, 
but I haven't gotten very far yet and I've learned mostly by 
checking out other code, reading the online docs and playing 
around. The language seems pretty easy to learn so far and I 
really like the power of it.

The code is on github: https://github.com/bakkdoor/gumbo-d
I've also added it to dub's package repository.

Any feedback is welcome :)

Cheers,
Christopher.

[1] 
http://google-opensource.blogspot.de/2013/08/gumbo-c-library-for-parsing-html.html
Aug 18 2013
parent "Suliman" <evermind live.ru> writes:
Look like binding have some issues.
I am getting next error, after inducing:
import gumbo.node, gumbo.parse;
to my App

Compiling using dmd...
Linking...
OPTLINK (R) for Win32  Release 8.00.15
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
C:\Users\Dima\AppData\Roaming\dub\packages\gumbo-d-0.2.2\gumbo-d.lib(parse)
  Error 42: Symbol Undefined _gumbo_destroy_output
C:\Users\Dima\AppData\Roaming\dub\packages\gumbo-d-0.2.2\gumbo-d.lib(parse)
  Error 42: Symbol Undefined _gumbo_parse
--- errorlevel 2
FAIL 
.dub\build\application-debug-windows-x86-dmd_2066-E9FCE136882C663918FD5E784
D7D2C14\ seismodownloader executable
Error executing command run: dmd failed with exit code 2.
Dec 14 2014