Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ const fs = require('node:fs')
const path = require('node:path')
const { execFileSync } = require('node:child_process')
const menuFactory = require('simple-terminal-menu/factory')
const msee = require('msee')
const { Marked } = require('marked')
const { markedTerminal } = require('marked-terminal')
const { diffChars } = require('diff')
const colors = require('colors/safe')
const exercises = require('./menu.json')
Expand All @@ -18,8 +19,10 @@ function localized (directory, base, language) {
return read(fs.existsSync(translated) ? translated : path.join(directory, base + '.md'))
}

const renderer = new Marked(markedTerminal({ emoji: false }))

function render (markdown) {
console.log(msee.parse(markdown))
process.stdout.write(renderer.parse(markdown))
}

function execute ([command = 'menu', ...args]) {
Expand Down
Loading