diff --git a/.htaccess b/.htaccess
new file mode 100644
index 0000000..068e7a2
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,6 @@
+# URL Rewrite
+RewriteEngine On
+RewriteCond $0 !^index.php.*
+RewriteCond $0 !^debug.php.*
+RewriteCond $0 !^assets.*
+RewriteRule .* index.php?p=$0 [QSA]
diff --git a/assets/gitbook-fix.js b/assets/gitbook-fix.js
new file mode 100644
index 0000000..d8f1f11
--- /dev/null
+++ b/assets/gitbook-fix.js
@@ -0,0 +1,23 @@
+const WITH_SUMMARY_CLASS = "with-summary"
+
+var bookRoot;
+
+function summaryOnOrOff () {
+
+ if (bookRoot.classList.contains(WITH_SUMMARY_CLASS)) {
+ bookRoot.classList.remove(WITH_SUMMARY_CLASS);
+ } else {
+ bookRoot.classList.add(WITH_SUMMARY_CLASS);
+ }
+
+}
+
+window.onload = function () {
+
+ bookRoot = document.getElementsByClassName("book")[0];
+
+ if (window.innerWidth > 600) {
+ bookRoot.classList.add(WITH_SUMMARY_CLASS);
+ }
+
+};
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..475b64b
--- /dev/null
+++ b/index.php
@@ -0,0 +1,105 @@
+getRootBook();
+ PageMeta::$page = PageMeta::$book->getChilds()->getChilds()[0];
+ PageMeta::$isMainPage = true;
+
+ require "./template/header.php";
+
+ ?>
+
+
+
+
+
+
+
+
+
+
+ 1. 占位主页面
+
+ 歌德说过一句富有哲理的话,没有人事先了解自己到底有多大的力量,直到他试过以后才知道。这句话语虽然很短,但令我浮想联翩。 在这种困难的抉择下,本人思来想去,寝食难安。 经过上述讨论, 佚名说过一句富有哲理的话,感激每一个新的挑战,因为它会锻造你的意志和品格。这启发了我。
+ 我们都知道,只要有意义,那么就必须慎重考虑。 一般来讲,我们都必须务必慎重的考虑考虑。 本人也是经过了深思熟虑,在每个日日夜夜思考这个问题。 问题的关键究竟为何? 带着这些问题,我们来审视一下占位内容。 就我个人来说,占位内容对我的意义,不能不说非常重大。
+ 鲁巴金曾经说过,读书是在别人思想的帮助下,建立起自己的思想。我希望诸位也能好好地体会这句话。
+ 既然如此, 占位内容因何而发生? 经过上述讨论, 占位内容,发生了会如何,不发生又会如何。
+ `喵~`
+ 我们一般认为,抓住了问题的关键,其他一切则会迎刃而解。
+
+
+
+
+
+
+
+
+
+ ERROR" . $e->getMessage() . "
";
+
+}
diff --git a/src/Data/SiteMeta.php b/src/Data/SiteMeta.php
index af85b9d..ca01ecb 100644
--- a/src/Data/SiteMeta.php
+++ b/src/Data/SiteMeta.php
@@ -24,25 +24,13 @@ class SiteMeta {
public static function getGitbookStylesheetsList (): array {
return array(
"/assets/gitbook/style.css",
- "/assets/gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css",
- "/assets/gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css",
- "/assets/gitbook/gitbook-plugin-highlight/website.css",
- "/assets/gitbook/gitbook-plugin-search/search.css",
- "/assets/gitbook/gitbook-plugin-fontsettings/website.css"
);
}
public static function getGitbookJavascriptList (): array {
return array(
"/assets/gitbook/gitbook.js",
- "/assets/gitbook/theme.js",
- "/assets/gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js",
- "/assets/gitbook/gitbook-plugin-search/search-engine.js",
- "/assets/gitbook/gitbook-plugin-search/search.js",
- "/assets/gitbook/gitbook-plugin-lunr/lunr.min.js",
- "/assets/gitbook/gitbook-plugin-lunr/search-lunr.js",
- "/assets/gitbook/gitbook-plugin-sharing/buttons.js",
- "/assets/gitbook/gitbook-plugin-fontsettings/fontsettings.js"
+ "/assets/gitbook-fix.js",
);
}
diff --git a/src/Element/Book.php b/src/Element/Book.php
index d2ab2d8..f45687a 100644
--- a/src/Element/Book.php
+++ b/src/Element/Book.php
@@ -52,4 +52,8 @@ class Book {
return $this->parent;
}
+ public function getHtml (): string {
+ return "$this->name";
+ }
+
}
\ No newline at end of file
diff --git a/src/Element/BookCollection.php b/src/Element/BookCollection.php
index cb32958..23299ce 100644
--- a/src/Element/BookCollection.php
+++ b/src/Element/BookCollection.php
@@ -12,9 +12,9 @@ class BookCollection {
private array $array;
private ?BookCollection $parent;
- private function __construct (string $name, array $a, ?BookCollection $parent) {
+ private function __construct (string $name, ?BookCollection $parent) {
$this->name = $name;
- $this->array = $a;
+ $this->array = array();
$this->parent = $parent;
}
@@ -34,7 +34,7 @@ class BookCollection {
else $name = $attrName->nodeValue;
} else throw new Exception("BookCollection (not root) xml data missing attributes");
}
- $node = new BookCollection($name, array(), $parent);
+ $node = new BookCollection($name, $parent);
for ($child = $root->firstChild; $child != null; $child = $child->nextSibling) {
switch ($child->nodeName) {
case "Book":
@@ -70,4 +70,14 @@ class BookCollection {
return $this->parent;
}
+ public function getHtml (): string {
+ $str = "";
+ if ($this->name != self::ROOT) $str .= "$this->name";
+ foreach ($this->array as $node) {
+ $str .= $node->getHtml();
+ }
+ if ($this->name != self::ROOT) $str .= "
";
+ return $str;
+ }
+
}
diff --git a/src/Element/Bookshelf.php b/src/Element/Bookshelf.php
index 99f197f..8c88e17 100644
--- a/src/Element/Bookshelf.php
+++ b/src/Element/Bookshelf.php
@@ -70,4 +70,14 @@ class Bookshelf {
return $this->rootBook;
}
+ public function getHtml (): string {
+ $str = "";
+ $str .= $this->links->getHtml();
+ $str .= "";
+ $str .= $this->books->getHtml();
+ $str .= "
";
+ // TODO books list
+ return $str;
+ }
+
}
diff --git a/src/Element/Link.php b/src/Element/Link.php
index 4f45516..7323456 100644
--- a/src/Element/Link.php
+++ b/src/Element/Link.php
@@ -52,4 +52,8 @@ class Link {
return $this->parent;
}
+ public function getHtml (): string {
+ return "$this->name";
+ }
+
}
diff --git a/src/Element/LinkCollection.php b/src/Element/LinkCollection.php
index 5d6caf8..560fb69 100644
--- a/src/Element/LinkCollection.php
+++ b/src/Element/LinkCollection.php
@@ -12,9 +12,9 @@ class LinkCollection {
private array $array;
private ?LinkCollection $parent;
- private function __construct (string $name, array $a, ?LinkCollection $parent) {
+ private function __construct (string $name, ?LinkCollection $parent) {
$this->name = $name;
- $this->array = $a;
+ $this->array = array();
$this->parent = $parent;
}
@@ -34,7 +34,7 @@ class LinkCollection {
else $name = $attrName->nodeValue;
} else throw new Exception("LinkCollection (not root) xml data missing attributes");
}
- $node = new LinkCollection($name, array(), $parent);
+ $node = new LinkCollection($name, $parent);
for ($child = $root->firstChild; $child != null; $child = $child->nextSibling) {
switch ($child->nodeName) {
case "Link":
@@ -70,4 +70,14 @@ class LinkCollection {
return $this->parent;
}
+ public function getHtml (): string {
+ $str = "";
+ if ($this->name != self::ROOT) $str .= "$this->name";
+ foreach ($this->array as $node) {
+ $str .= $node->getHtml();
+ }
+ if ($this->name != self::ROOT) $str .= "
";
+ return $str;
+ }
+
}