<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width initial-scale=1">
<script src="./marked.min.js"></script>
<script src="./jquery.min.js"></script>
<link rel="stylesheet" href="./github-markdown-light.min.css">
<style>
@media (max-width: 767px) { body { padding: 15px; } }
body { box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px; }
</style>
<title>Marked.js</title>
</head>
<body>
<div id="$m" class="markdown-body"></div>
<textarea id="$t" style="display:none">
# Hello World
*Write* `your` **Markdown** here.

https://xxrr.top/

git clone https://github.com/chinese-poetry/chinese-poetry.git

https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js

https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.7.0/github-markdown.min.css

https://cdn.jsdelivr.net/npm/marked/marked.min.js
</textarea>
<script>
// $m.innerHTML = marked.parse($t.value);
var url = '/data/chinese-poetry/README.md';
// var url = '/data/chinese-poetry/论语/README.md';
var path = getQueryVariable('path');
if(path){
url = path;
}

jQuery.get(url, function (s) {
$m.innerHTML = marked.parse(s);
});

function getQueryVariable(variable)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
}
</script>
</body>
</html>

<?php
// data/chinese-poetry
//include('md1.html');
?>

作者 meiyoufan

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注