Markdown convert is a conversion tool used to, you guessed it, convert markdown to HTML.
- π Markdown to HTML parser
- β‘Built different, for performance
- βοΈ light-weight while also having custom markdown conversions built-in
- βΎοΈ Works in browsers, clients, servers, and (soon) command line interfaces (CLI)
- π₯ Support for HTTP request blocks to be rendered with custom Markdown
Planned; convert Markdown into regular string without Markdown formatting.
Get started by running the install command π
npm install markdownconvert
Currently you can use markdownconvert in the following ways.
Node.js
const mdconvert = require('markdownconvert');
let string = "This is some **cool** Markdown to **HTML**, generated by `markdownconvert` for ~~me~~ you.";
let converted = mdconvert.convert(string);
/* Output:
<p>This is some <strong>cool</strong> Markdown to <strong>HTML</strong>, generated by <code>markdownconvert</code> for <s>me</s> you.</p>
*/
Browser
<script src="https://cdn.jsdelivr.net/npm/markdownconvert/index.min.js"></script>
<script>
document.write(markdownconvert.convert("I **love** HTML don't *you*?"))
</script>
convert(string) // Converts Markdown to HTML
render(string) // Another function name, same as convert()
registerBlock(function) // Registers a block replacement that is executed, good for custom addons
registerInline(function) // Registers an in-line block replacement. Again, good for custom addons
getStyle(index) // Returns the registered style (class name) for the associated element
updateStyle(index, newProperty) // Create or overwrite existing style for the defined element
Markdownconvert allows you to change the CSS properties of a tag to allow your own customisation. There's a list of Default Styles available.
To update a style you can use the updateStyle()
function.
const mdconvert = require('markdownconvert');
mdconvert.updateStyle('contDanger', 'converterDangerCSS');
// To fetch this property you can use the `getStyle()` function
mdconvert.getStyle('contDanger');
If contDanger
wasn't found in the list, it would be created and added, perfect for adding your own rules with registerBlock()
or registerInline()
.
This works in modern broswers and in Node.js current and LTS versions.
Markdownconvert is created by Weblutions & FAXES.