home page
Message Board
About us
Friendly Links
Search
one
Using idle mobile phones to build a local WEB environment+ngrok intranet penetration to achieve external network access
47922 Reading
two
Xiaomi 8 installs Google Play service suite
30935 Reading
three
The single player landlords' non networked green version is suitable for the elderly
23671 Reading
four
Chinese and English names of 224 countries in the world
21289 Reading
five
Emlog, wordpress, typecho articles, whether Baidu has included detection codes
16667 Reading
Default classification
Source code tutorial
Life essay
Code Notes
Sign in
Search
Tag Search
SSL
vps
CentOS
AppNode
Intranet penetration
Node.js
Hairpin
GitHub
python
Google Voice
Local environment
Linux panel
Google Play
MarkDown
Vue
yarn
Small shop
Applet
Remote Desktop
frp
www.9ywk.com
Accumulated writing
seventy-two
Articles
Accumulated receipt
sixty-four
Comments
home page
column
Default classification
Source code tutorial
Life essay
Code Notes
page
Message Board
About us
Friendly Links
Search to
one
Article and
Results for
2020-07-27
PHP parsing MarkDown
ParsedownGitHub: Parsedown first method<?
php
include 'Parsedown.php'; //
Introduction and analysis
function md2html($title, $file)
{
echo '<!
doctype html>';
echo '<html>';
echo '<head>';
echo '<meta charset = "utf-8">';
echo '<title>'.$
title.'</
title>';
echo '</head>';
echo '<body>';
$parser = new Parsedown();
$markdown = file_
get_
contents($file);
echo $parser->text($markdown);
echo '</body>';
echo '</html>';
}
Md2html ('This is the title ','1. md')//
Title and MD file
?>
The second method<?
php
require_
once "Parsedown.php"; //
Introduction and analysis
$Parsedown = new Parsedown();
echo '<meta charset="utf-8">';
echo $Parsedown->text('www.9ywk.com <br/>
> Parsedown
#First level title
##Secondary Title
###Third level title
####Fourth level title
#####Five level title
######Sixth level title
');
?>
Marked.jsGitHub:Marked.js<!
doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Marked in the browser</title>
</head>
<body>
<div id="content"></div>
<script src="
https://cdn.jsdelivr.net/npm/marked/marked.min.js
"></script>
<script>
document.getElementById('content').innerHTML =
Marked ('# Level I n The second line * * Bold * * n # # # marked. min. js');
</script>
</body>
</html>Parsedown self use<!
DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<link rel="stylesheet" href="
https://cdn.jsdelivr.net/gh/jiuyueidc/9ywk_com
@web/Markdown/markdown.css">
</head>
<body>
<div class="wonderpen-page fixed-width">
<div id="wonderpen-content" class="wonderpen-content">
<div class="markdown-body align-null">
<?
php
include 'Parsedown.php';
function md2html($title, $file)
{
echo '<!
doctype html>';
echo '<html>';
echo '<head>';
echo '<meta charset = "utf-8">';
echo '<title>'.$
title.'</
title>';
echo '</head>';
echo '<body>';
$parser = new Parsedown();
$markdown = file_
get_
contents($file);
echo $parser->text($markdown);
echo '</body>';
echo '</html>';
}
md2html('title', 'url.md');
?>
</div>
</div>
</div>
<script type="text/javascript">//External link target=_
blank
function add() {
var all_
a = document.getElementsByTagName("a");
host_
url=window.location.host;
for (var i = 0; i < all_a.length; i++) {
var domain = all_
a[i].href.split("/"); //
Split with "/"
if (domain[2]!=host_url) {
all_
a[i].target = "_blank";
}
}
}
add();
</script>
<center><h1>
<a href="/">Doc list</a>
</h1></center>
</body>
</html>
July 27, 2020
1983 Reading
3 Comments
0 likes
//