Skip to content

Commit

Permalink
updated convert script
Browse files Browse the repository at this point in the history
  • Loading branch information
FacuDeLorenzo committed Aug 18, 2024
1 parent 8815553 commit dc330af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions convert-md-to-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ const markdownIt = require('markdown-it');
const markdownItMermaid = require('markdown-it-mermaid').default;

// Initialize markdown-it with the mermaid plugin
const md = markdownIt().use(markdownItMermaid);
const md = markdownIt({
html: true, // Enable HTML tags in the source
linkify: true, // Automatically convert URLs into clickable links
typographer: true // Enable some language-specific replacements
}).use(markdownItMermaid);

// Read the Markdown file
const markdown = fs.readFileSync('cool-root-doc.md', 'utf8');
Expand All @@ -14,4 +18,4 @@ const result = md.render(markdown);
// Write the HTML output to a file
fs.writeFileSync('cool-root-doc.html', result);

console.log('Markdown converted to HTML successfully.');
console.log('Markdown with Mermaid code converted to HTML successfully.');
1 change: 1 addition & 0 deletions cool-root-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This document aims to summarize each task within Aave's smart contract architect
- Paraswap.

## Core components diagram

mermaid
graph TD
subgraph Core
Expand Down

0 comments on commit dc330af

Please sign in to comment.