2014-12-07

Tclgumbo v0.1

Gumbo

Gumbo is an implementation of the [HTML5 parsing algorithm] implemented as a pure C99 library with no outside dependencies. It's designed to serve as a building block for other tools and libraries such as linters, validators, templating languages, and refactoring and analysis tools.
Goals and features:
* Fully conformant with the [HTML5 spec].
* Robust and resilient to bad input.
* Simple API that can be easily wrapped by other languages.
* Support for source locations and pointers back to the original text.
* Relatively lightweight, with no outside dependencies.
* Passes all [html5lib-0.95 tests].
* Tested on over 2.5 billion pages from Google's index.

Download Gumbo from:
https://github.com/google/gumbo-parser
 

Tclgumbo commands and variables

Tclgumbo is Gumbo Tcl bindings.

Implement commands:
gumbo::parse
gumbo::destroy_output
gumbo::output_get_root
gumbo::node_get_type
gumbo::element_get_tag_name
gumbo::element_get_children
gumbo::text_get_text
gumbo::element_get_attributes
gumbo::element_get_tag_open
gumbo::element_get_tag_close

Add variables:
gumbo::GUMBO_NODE_DOCUMENT
gumbo::GUMBO_NODE_ELEMENT
gumbo::GUMBO_NODE_TEXT
gumbo::GUMBO_NODE_CDATA
gumbo::GUMBO_NODE_COMMENT
gumbo::GUMBO_NODE_WHITESPACE

Installation

Installation (Linux/GCC):
cd tclgumbo
./configure
make
make install

Installation (Winodws/MSYS/MinGW):
cd tclgumbo
./configure
make
make install

Installation (Winodws/Visual Studio):
VS does not support C std99. I don't know how to use VS to build this package.


網站:
Tclgumbo

這是我自我練習的程式。我使用 tests 下的 tclgumbo.test 進行基本功能的測試。因為只有很簡單的測試,所以我不確定有沒有沒改好的部份,不過按照 GumboPHP 的說明文件,我已經把我會實作的部份都做完了。

沒有留言: