|
|
@ -2,7 +2,7 @@ import * as fs from 'fs';
|
|
|
|
import * as path from 'path';
|
|
|
|
import * as path from 'path';
|
|
|
|
import marked from 'marked';
|
|
|
|
import marked from 'marked';
|
|
|
|
import PrismJS from 'prismjs';
|
|
|
|
import PrismJS from 'prismjs';
|
|
|
|
import { extract_frontmatter, extract_metadata, langs } from '../../../utils/markdown';
|
|
|
|
import { extract_frontmatter, extract_metadata, langs, link_renderer } from '../../../utils/markdown';
|
|
|
|
|
|
|
|
|
|
|
|
const cache = new Map();
|
|
|
|
const cache = new Map();
|
|
|
|
|
|
|
|
|
|
|
@ -33,6 +33,8 @@ function get_tutorial(slug) {
|
|
|
|
|
|
|
|
|
|
|
|
const renderer = new marked.Renderer();
|
|
|
|
const renderer = new marked.Renderer();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
renderer.link = link_renderer;
|
|
|
|
|
|
|
|
|
|
|
|
renderer.code = (source, lang) => {
|
|
|
|
renderer.code = (source, lang) => {
|
|
|
|
source = source.replace(/^ +/gm, match =>
|
|
|
|
source = source.replace(/^ +/gm, match =>
|
|
|
|
match.split(' ').join('\t')
|
|
|
|
match.split(' ').join('\t')
|
|
|
|