Compare commits

...

8 Commits
v1.0 ... main

Author SHA1 Message Date
4b49033053 add readme 2025-12-14 23:49:11 +04:00
a6adf4496c add readme 2025-12-14 23:47:55 +04:00
3e6ac2a635 add readme 2025-12-14 23:45:26 +04:00
ea73839bc4 rock 2025-12-14 22:31:17 +04:00
3cfe20b54b rock 2025-12-14 22:26:00 +04:00
a4941a5e94 change version 2025-12-13 12:33:58 +04:00
36f396868a change 2025-12-13 02:01:08 +04:00
95110f1c62 add rocks 2025-12-13 01:43:43 +04:00
3 changed files with 81 additions and 2 deletions

View File

@ -32,6 +32,82 @@ luarocks install discount3
If you get a compilation error during installation, it's because discount isn't installed as a shared library. See the solution here: https://gitlabor.ru/Datenlabor/discount
## Usage
```
local markdown = require('discount3')
local html = markdown.compile(markdown_text)
print(html.body)
```
Returns:
table:
- body - html body
- title - doc's title (if header exists)
- author - doc's autor (if header exists)
- date - docs's date (if header exists)
- css - docs's CSS (if styles exist)
- index - table of content (if flag = 'toc')
## Flags
```
markdown.compile(markdown_text,flag,flag,flag)
```
### List of flags:
- "nolinks" - dont do link processing, block tags
- "noimages" - dont do image processing, block
- "nopants" - dont run smartypants()
- "nohtml" - dont allow raw html through AT ALL
- "strict" - conform to Markdown standard as implemented in Markdown.pl
- "tagtext" - process text inside an html tag
- "noext" - dont allow pseudo-protocols
- "cdata" - generate code for xml ![CDATA[…]]
- "nosuperscript" - no A^B
- "notables" - disallow tables
- "nostrikethrough" - forbid strikethrough
- "toc" - do table-of-contents processing (index)
- "compat" - compatibility with MarkdownTest_1.0
- "autolink" - make http://foo.com link even without <>s
- "safelink" - paranoid check for link protocol
- "noheader" - dont process header blocks
- "tabstop" - expand tabs to 4 spaces
- "nodivquote" - forbid >%class% blocks
- "noalphalist" - forbid alphabetic lists
- "extrafootnote" - enable markdown extra-style footnotes
- "nostyle" - dont extract style blocks
- "dlextra" - enable extra-style definition lists
- "fencedcode" - enabled fenced code blocks
- "idanchor" - use id= anchors for TOC links
- "githubtags" - allow dash and underscore in element names
- "urlencodedanchor" - urlencode non-identifier chars instead of replacing with dots
- "latex" - handle embedded LaTeX escapes
- "html5" - handle html5 elements (maybe obsolete?)
- "normallist" - disable github-style checkbox lists
- "explicitlist" - dont combine numbered/bulletted lists
- "dldiscount" - enable discount-style definition lists
- "altastitle" - use alt text as the title if no title is listed
- "extendedattr" - allow extended attribute suffixes
Example:
```
markdown.compile(markdown_text,"extrafootnote","toc","notables")
```
License
-------

View File

@ -1,5 +1,6 @@
package = "discount3"
version = "1.0-1"
rockspec_format = '3.0'
description = {
summary = "Lua bindings for the Discount Markdown library V3",
@ -7,15 +8,17 @@ description = {
Supports all tags.
]],
homepage = "https://gitlabor.ru/Datenlabor/discount3",
labels = { 'markdown', 'discount'} ,
license = "ISC"
}
source = {
url = "https://gitlabor.ru/Datenlabor/discount3/tags/v1.0-0.tar.gz"
url = "git+https://gitlabor.ru/Datenlabor/discount3/",
tag = "1.0-1"
}
dependencies = {
"lua >= 5.1"
"lua = 5.1"
}
external_dependencies = {

BIN
discount3-1.0-1.src.rock Normal file

Binary file not shown.