mirror of
https://github.com/msva/lua-htmlparser.git
synced 2024-11-27 12:44:22 +00:00
making luarocks loader optional
This commit is contained in:
parent
a64b0aaf5f
commit
2651bea029
@ -9,12 +9,12 @@ Parse HTML text into a tree of elements with selectors
|
|||||||
Htmlparser is a listed [LuaRock](http://luarocks.org/repositories/rocks/). Install using [LuaRocks](http://www.luarocks.org/): `luarocks install htmlparser`
|
Htmlparser is a listed [LuaRock](http://luarocks.org/repositories/rocks/). Install using [LuaRocks](http://www.luarocks.org/): `luarocks install htmlparser`
|
||||||
|
|
||||||
###Dependencies
|
###Dependencies
|
||||||
Htmlparser depends on [Lua 5.2](http://www.lua.org/download.html), and on the ["set"][1] LuaRock, which is installed along automatically. To be able to run the tests, [lunitx](https://github.com/dcurrie/lunit) also comes along as a LuaRock
|
Htmlparser depends on [Lua 5.2](http://www.lua.org/download.html) (while work with LuaJIT, which provides 5.1-compatible ABI), and on the ["lua-set"][1] package, which is installed along automatically. To be able to run the tests, [lunitx](https://github.com/dcurrie/lunit) also comes along as a LuaRock
|
||||||
|
|
||||||
##Usage
|
##Usage
|
||||||
Start off with
|
Start off with
|
||||||
```lua
|
```lua
|
||||||
require("luarocks.loader")
|
pcall(require, "luarocks.loader")
|
||||||
local htmlparser = require("htmlparser")
|
local htmlparser = require("htmlparser")
|
||||||
```
|
```
|
||||||
Then, parse some html:
|
Then, parse some html:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
require("luarocks.loader")
|
pcall(require, "luarocks.loader")
|
||||||
local Set = require("Set")
|
local Set = require("Set")
|
||||||
|
|
||||||
local ElementNode = {}
|
local ElementNode = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user