making luarocks loader optional

This commit is contained in:
Vadim A. Misbakh-Soloviov 2015-05-11 15:36:08 +06:00
parent a64b0aaf5f
commit 2651bea029
No known key found for this signature in database
GPG Key ID: 26503D349B3B334B
2 changed files with 3 additions and 3 deletions

View File

@ -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:

View File

@ -1,4 +1,4 @@
require("luarocks.loader") pcall(require, "luarocks.loader")
local Set = require("Set") local Set = require("Set")
local ElementNode = {} local ElementNode = {}