0.0.2 • Published 2 years ago
tayparser v0.0.2
Markdown For Tailwinds
⚡ Markdown parser compatible with Tailwind Css. Prism.js themes can be found here.
Installation
<!-- Main File -->
<script src="https://cdn.jsdelivr.net/npm/tailmark/src/index.min.js"></script>
<!-- For Code Snippets -->
<script src="https://cdn.jsdelivr.net/npm/tailmark/src/prism.min.js"></script>
<link
href="https://cdn.jsdelivr.net/npm/tailmark/styles/dracula.min.css"
rel="stylesheet"
/>
Usage
// Initialized
const Parser = new Tayparser();
// Parse Markdown
const MarkdownCode = `
# Blog Post
`;
const Code = Parser.parse(MarkdownCode);
console.log(Code);
// Highlight All <pre> Snippets
Prism.highlightAll();
// Escape HTML
const Markdown = new TailDown({ escapeHTML: true });
Config
const Markdown = new TailDown({
a: {
customClass: "hover:text-blue-500",
extendStyle: "display: block;",
},
h3: {
customClass: "text-gray-600",
extendStyle: "display: block;",
},
});
0.0.2
2 years ago