Markdown : Add Gitea renderer.

This commit is contained in:
Dmitry Voronin 2024-01-09 14:47:08 +03:00
parent 529ba993a2
commit 2af2b9a914
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,15 @@
# Render markdown in browser using Gitea API. Because I want consistency with Gitea web render.
# Works only inside LAN.
# Usage: markdown_render <FILE.md>
function markdown_render() {
local IFS=$'\n'
local file="${1}"
local render="markdown_render.html"
if [[ "${file}" = "" ]]; then
help markdown_render
return 2
fi
curl -X POST https://git.voronind.com/markdown -d "$(cat ${file})" > "${render}" && o "${render}" && sleep 2 && rm "${render}"
}

View file

@ -220,6 +220,12 @@ Command|Description
`la [DIRS]`|List all files in dirs, incl. hidden files. Current dir by default.
`lla [DIRS]`|List all files in dirs, incl. hidden files, sorted by mtime. Current dir by default.
## Markdown.
Command|Description
---|---
`markdown_render <FILE.md>`|Render markdown in browser using Gitea API. Because I want consistency with Gitea web render. Works only inside LAN.
## Name.
Command|Description