Skip to content

Commit

Permalink
try to convert to html 2
Browse files Browse the repository at this point in the history
  • Loading branch information
FacuDeLorenzo committed Aug 18, 2024
1 parent f7636ef commit b2aee92
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ jobs:
node-version: 20

- name: Install markdown-it and markdown-it-mermaid
run: |
npm install -g markdown-it-cli
npm install markdown-it markdown-it-mermaid
run: npm install markdown-it markdown-it-mermaid

- name: Convert Markdown to HTML
run: |
npx markdown-it cool-root-doc.md --use=markdown-it-mermaid > cool-root-doc.html
run: node convert-md-to-html.js

- name: Upload HTML file as an artifact
uses: actions/upload-artifact@v3
with:
name: html-file
path: README.html
path: cool-root-doc.html
17 changes: 17 additions & 0 deletions convert-md-to-html.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const fs = require('fs');
const markdownIt = require('markdown-it');
const markdownItMermaid = require('markdown-it-mermaid').default;

// Initialize markdown-it with the mermaid plugin
const md = markdownIt().use(markdownItMermaid);

// Read the Markdown file
const markdown = fs.readFileSync('cool-root-doc.md', 'utf8');

// Convert it to HTML
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.');
1 change: 0 additions & 1 deletion cool-root-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ This document aims to summarize each task within Aave's smart contract architect
- Staking.
- Paraswap.


## Core components diagram
```mermaid
graph TD
Expand Down

0 comments on commit b2aee92

Please sign in to comment.