-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
84 lines (79 loc) · 2.14 KB
/
Copy pathindex.php
File metadata and controls
84 lines (79 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>フシギにステキな素早いヤバさ</title>
<style>
body {
background: #fffefd;
font-family: "MS 明朝","Hiragino Mincho Pro",Osaka,monospace;
font-size: 16px;
}
div#contents{
font-family: "MS 明朝","Hiragino Mincho Pro",Osaka,monospace;
font-size: 16px;
width: 42em;/*折り返し字数を設定します*/
padding: 0;
margin: 10px auto;
background: #fffefd;
text-align: left;
}
h2{
color: #735344;
}
p{
font-family: "MS 明朝","Hiragino Mincho Pro",Osaka,monospace;
font-size: 16px;
margin: 0em;
padding: 0;
line-height: 1.7em;
color: #735344;
}
</style>
</head>
<body>
<div id="contents">
<?php
class fushigini{
private $phpmarkdown = 'markdown.php';
private $config = 'config.php';
private $chapters_path = 'chapters/';
public function ruby($body){
$patterns = array( "/|/", "/《/", "/》/");
$replacements = array( "<ruby><rp>(</rp><rb>", "<rt>", "</rt><rp>)</rp></ruby>" );
$body = preg_replace($patterns, $replacements, $body);
return $body;
}
public function novelmarkdown($data){
$data = preg_replace( "/\n.\n/","\n\n<p><br></p>\n\n", $data);
$data = preg_replace( "/\n.\n/","\n\n<p><br></p>\n\n", $data);
$data = preg_replace( "/\n/","\n\n", $data);
return $data;
}
public function getChapter($chapter){
include_once( $this->phpmarkdown );//マークダウンするためのファンクションを読み込みます
include( $this->config );
include( $this->chapters_path.$chapter );
$data = $this->ruby($data);
$data = $this->novelmarkdown($data);
return Markdown($data);
}
}
$fs = new fushigini();
echo $fs->getChapter("chapter01.php");
echo $fs->getChapter("chapter02.php");
echo $fs->getChapter("chapter03.php");
echo $fs->getChapter("chapter04.php");
echo $fs->getChapter("chapter05.php");
echo $fs->getChapter("chapter06.php");
echo $fs->getChapter("chapter07.php");
echo $fs->getChapter("chapter08.php");
echo $fs->getChapter("chapter09.php");
echo $fs->getChapter("chapter10.php");
echo $fs->getChapter("chapter11.php");
echo $fs->getChapter("chapter12.php");
echo $fs->getChapter("chapter13.php");
?>
</div>
</body>
</html>