Watch 1 Star 0 Fork 0

netnr / jcuteJavaScriptMIT

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
Clone or download
view.html 2.42 KB
Copy Edit Web IDE Raw Blame History
netnr authored 2019-03-08 09:49 . update css
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>jCute JavaScript Library</title>
<link href="https://lib.baomitu.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://lib.baomitu.com/remarkable/1.7.1/remarkable.min.js"></script>
<link href="https://lib.baomitu.com/highlight.js/9.12.0/styles/github.min.css" rel="stylesheet">
<script src="https://lib.baomitu.com/highlight.js/9.12.0/highlight.min.js" defer async="async"></script>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-12 my-4">
<h1><a href="/" id="tname"></a></h1>
<hr />
<div id="vc"></div>
</div>
</div>
</div>
<script src="src/jCute.all.js"></script>
<script>
var vw = {
url: 'src/' + location.search.substring(1).replace('jcute', 'jCute'),
parsemd: function (md) {
return new Remarkable({
html: false,
xhtmlOut: false,
langPrefix: 'language-',
linkify: true,
typographer: false,
quotes: '“”‘’',
highlight: function (str, lang) {
if (window.hljs && hljs.getLanguage(lang)) {
try {
return hljs.highlight(lang, str).value;
} catch (__) { }
}
try {
return hljs.highlightAuto(str).value;
} catch (__) { }
return '';
}
}).render(md);
},
init: function (url) {
jCute.ajax({
url: url,
success: function (data) {
var urs = url.split('/'), tn = document.getElementById('tname');
tn.innerHTML = urs[urs.length - 1];
tn.href = url;
vw.text = data;
var md = '```\r\n' + data + '\r\n```';
document.getElementById('vc').innerHTML = vw.parsemd(md);
}
})
}
}
vw.init(vw.url);
</script>
</body>
</html>

Comment ( 0 )

You need to Sign in for post a comment

Help Search