Compare commits

...

5 Commits
1.0 ... master

Author SHA1 Message Date
354e9120b2
Fixed lua version errors 2021-04-10 12:39:33 +05:00
c6107ca968
Updated readme, added dependencies 2021-04-10 11:27:21 +05:00
Dm1tr1y147
73aa9bf2aa Removed automatic tests running 2020-07-24 11:46:11 +05:00
Dm1tr1y147
888e494c2a Changed config, fixed some errors 2020-07-24 11:32:56 +05:00
Dm1tr1y147
b06b2224fb Added luarocks build 2020-07-23 20:11:18 +05:00
6 changed files with 37 additions and 35 deletions

View File

@ -1,27 +0,0 @@
language: python
sudo: false
env:
- LUA="lua=5.1"
- LUA="lua=5.2"
- LUA="lua=5.3"
- LUA="lua=5.4"
before_install:
- pip install hererocks
- hererocks lua_install -r^ --$LUA
- export PATH=$PATH:$PWD/lua_install/bin
install:
- luarocks make
- luarocks install luacheck
- luarocks install busted
- luarocks install luacov
- luarocks install luacov-coveralls
script:
- luacheck --std max+busted src spec
- busted --verbose --coverage
after_success:
- luacov-coveralls -e $TRAVIS_BUILD_DIR/lua_install

21
LICENCE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Shishkov Dmitriy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -2,9 +2,17 @@
This tool helps to download all images in markdown document and put them into one folder with changed paths
## Usage:
**Warning**: lua 5.2 version is required
## Dependency installation:
```bash
luarocks install luasec
```
## Usage:
```bash
md-parser [-o <output>] [-s <server>] [-c <config>] [-u] [-h]
<input>
@ -31,4 +39,4 @@ It also has integrated functional to upload this article over ssh. As for MIT li
```
lua src/main.lua spec/assets/tmp_dir/some\ file.md -u -s dm1sh@localhost -o /tmp/art
```
```

View File

@ -59,8 +59,8 @@ describe("process_md", function()
local content = f:read('a')
local header
content, header = ProcessMD.get_header(content, assets_dir .. 'tmp_dir/some file.md', true)
local header, _
_, header = ProcessMD.get_header(content, assets_dir .. 'tmp_dir/some file.md', true)
f:close()
assert.equal('Header_:D', header)
@ -71,7 +71,7 @@ describe("process_md", function()
local content = f:read('a')
local header
local header, _
_, header = ProcessMD.get_header(content, assets_dir .. 'tmp_dir/and one more.md', true)
f:close()

View File

@ -47,7 +47,7 @@ local function upload_to_server(local_article_directory, server_cred, server_pat
os.exit(1)
end
local status, err = pcall(NetwOps.download_db, server_cred, server_path, local_article_directory)
status, err = pcall(NetwOps.download_db, server_cred, server_path, local_article_directory)
if not status then
print('Error: ' .. err)
os.exit(1)
@ -55,7 +55,7 @@ local function upload_to_server(local_article_directory, server_cred, server_pat
NetwOps.insert_article(local_article_directory, document_name)
local status, err = pcall(NetwOps.upload_db, server_cred, server_path, local_article_directory)
status, err = pcall(NetwOps.upload_db, server_cred, server_path, local_article_directory)
if not status then
print('Error: ' .. err)
os.exit(1)

View File

@ -4,7 +4,7 @@ function process_md.get_file_content(path)
local f, err = io.open(path, "r+")
assert(f, err)
local content = f:read("a")
local content = f:read("*a")
f:close()
return content