Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dyne/markdown-inline-tag
Render the content of <markdown></markdown> tags inside an HTML file using Pandoc
https://github.com/dyne/markdown-inline-tag
html inline markdown pandoc website
Last synced: about 2 months ago
JSON representation
Render the content of <markdown></markdown> tags inside an HTML file using Pandoc
- Host: GitHub
- URL: https://github.com/dyne/markdown-inline-tag
- Owner: dyne
- License: agpl-3.0
- Created: 2018-09-23T13:39:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-23T17:38:20.000Z (over 6 years ago)
- Last Synced: 2024-05-01T09:46:59.459Z (9 months ago)
- Topics: html, inline, markdown, pandoc, website
- Language: Shell
- Size: 19.5 KB
- Stars: 4
- Watchers: 8
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING.txt
Awesome Lists containing this project
README
# Markdown inline HTML tag
This is a minimalist tool to process HTML files that contain a
`` tag, rendering their content inline inside HTML.This tool is a shell script pre-processor meant to render files before
publication and is suitable to use inside any POSIX system including
basic GNU or BSD implementations providing Grep and Awk, like
Apple/OSX and the GNU/Linux Subsystem in MS/Windows 10. It will likely
perform very well on both x86 and ARM platforms, thanks to the
adoption of [Pandoc](http://pandoc.org) and [Zsh](http://pandoc.org)
for the implementation.Markdown-inline-tag is derived from this other software
[Webnomad](https://github.com/dyne/webnomad). Here the script is
published externally to be more portable inside larger setups and
other web publishing software based on npm, yarn and similar tools.## Requirements and portability
This tool requires the following dependencies to be installed:
```
zsh pandoc awk grep
```Given the above components are installed, it is expected to run on any
platform: GNU/Linux, Apple/OSX and MS/Windows.## Simple usage
Imagine having an `input.html` file containing plain HTML and then
using a special tag `` which is not recognized by any
browser. In order to publish the file then the contents included
inside the tag would have to be transformed in HTML at the same place
inside the file (and the tag removed of course). This is exactly what
this tool does, for instance with the input file:```html
Mixing Markdown and HTML is fun
# This is a Title in markdownThis is a paragraph in markdown
- This
- Is a list
- of items
- in markdown| This | Is | A Table | In Markdown |
| --- | --- | --- | --- |
| And | It | Is Also | In HTML |
| Once | Is | Rendered | By Pandoc |
This is a footer in HTML
```
Will be tranformed into:
```html
Mixing Markdown and HTML is fun
This is a Title in markdown
This is a paragraph in markdown
- This
- Is a list
- of items
- in markdown
This
Is
A Table
In MarkdownAnd
It
Is Also
In HTMLOnce
Is
Rendered
By Pandoc
This is a footer in HTML
```
To be run, our tool takes two arguments: input file and output file
```sh
markdown-inline-tag input.html output.html
```launching it this way will not modify the input.html and will
overwrite the output.html without confirmation.## NodeJS usage
The typical use of a NodeJs setup will be watching file changes and
live updating. The option `-w` runs markdown-inline-tag in a loop
refreshing results at every change of the input file. For instance
inside a `package.json` npm file one can add into the `scripts`
section:```json
"scripts": {
"index": "markdown-inline-tag -w views/index.html pub/index.html",
}
```
To live render the contents of `views/index.html` into
`pub/index.html`.## Acknowledgements
Markdown-inline-tag is Copyright (C) 2012-2018 by Dyne.org foundation
Designed, written and maintained by Denis Roio
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.You should have received a copy of the GNU Affero General Public
License along with this program. If not, see
http://www.gnu.org/licenses