1. rosetta-markdown
Translates the content or src of scirpt tags with type attributes of 'text/markdown' or 'text/md' from markdown into html
rosetta-markdown
Package: rosetta-markdown
Created by: adamcarheden
Last modified: Sun, 26 Jun 2022 14:12:35 GMT
Version: 1.0.1
License: GPL-3.0
Downloads: 9
Repository: https://github.com/adamcarheden/rosetta-markdown

Install

npm install rosetta-markdown
yarn add rosetta-markdown

rosetta-markdown

Translates the content or src of scirpt tags with type attributes of 'text/markdown' or 'text/md' from markdown into html.

Demo

Live demo

Install

 npm install rosetta-markdown --save

or

 git clone https://github.com/adamcarheden/rosetta-markdown.git

Use

Simple

 <script src='rosetta-markdown.js'></script>
<script type='text/markdown'>
# Markdown Example
This text will be translated into html and added to the document.
</script>

Fully-featured

We use the marked markdown parser.
You can access it to do things like syntax-highlighting using highlight.js:

 <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js"></script>
<script src='rosetta-markdown.js'></script>
<script>
	window['rosetta-markdown'].marked.setOptions({
		highlight: function(code) {
			return hljs.highlightAuto(code).value;
		}
	});
</script>

Contribute

 npm install
npm run build

This just webpackifies stuff at the moment.
Some karma and nightwatch tests would be a good addition.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code