diff --git a/README.md b/README.md
index d3ca09a..7c6a897 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,10 @@
下载/clone此仓库的内容,然后拖进 php 站点根目录。
+**要求 php 环境安装了 php-xml 插件**
+(7.0及以下旧版本可能叫做 php-dom 插件)
+(安装方法应该是能 Google 到的)
+
对于 Apache(即 .htaccess 支持的 php 环境),可以直接运行。
对于 Nginx 或者别的之类的 php 环境,需要转换一下伪静态配置,以 .htaccess 文件内的内容为依据即可。
diff --git a/index.php b/index.php
index ce9fc38..d808540 100644
--- a/index.php
+++ b/index.php
@@ -47,7 +47,7 @@ try {
diff --git a/src/Element/Book.php b/src/Element/Book.php
index 03e2f98..8601f76 100644
--- a/src/Element/Book.php
+++ b/src/Element/Book.php
@@ -54,7 +54,7 @@ class Book {
}
public function getHtml (): string {
- return "
$this->name";
+ return "
getId()==$this->id?"":" href='/$this->id'") . ">$this->name";
}
/**
@@ -64,4 +64,4 @@ class Book {
return BookContented::parseString(file_get_contents("./data/$this->id/book.xml"));
}
-}
\ No newline at end of file
+}
diff --git a/src/Element/BookCollection.php b/src/Element/BookCollection.php
index 9a424da..da071dd 100644
--- a/src/Element/BookCollection.php
+++ b/src/Element/BookCollection.php
@@ -72,7 +72,7 @@ class BookCollection {
public function getHtml (): string {
$str = "";
- if ($this->name != self::ROOT) $str .= "
$this->name";
+ if ($this->name != self::ROOT) $str .= "- $this->name
";
foreach ($this->array as $node) {
$str .= $node->getHtml();
}
diff --git a/src/Element/BookContent/Chapter.php b/src/Element/BookContent/Chapter.php
index f48e262..b8abd8e 100644
--- a/src/Element/BookContent/Chapter.php
+++ b/src/Element/BookContent/Chapter.php
@@ -66,7 +66,7 @@ class Chapter {
public function getSummaryHtml (): string {
$str = "";
- if ($this->parent != null) $str .= "- $this->name
";
+ if ($this->parent != null) $str .= "- $this->name
";
foreach ($this->childs as $node) {
$str .= $node->getSummaryHtml();
}
diff --git a/src/Element/BookContent/Page.php b/src/Element/BookContent/Page.php
index bbe2cc3..a1ab0b8 100644
--- a/src/Element/BookContent/Page.php
+++ b/src/Element/BookContent/Page.php
@@ -72,7 +72,7 @@ class Page {
}
public function getSummaryHtml (): string {
- $str = "- $this->name";
+ $str = "
- getId()==$this->id?"":(PageMeta::$book->getId()." href='/".$this->id."'")) . ">$this->name";
if (sizeof($this->segues) > 0) {
$str .= "
";
foreach ($this->segues as $node) {
diff --git a/src/Element/BookContent/Segment.php b/src/Element/BookContent/Segment.php
index 7423fc3..d8e40dd 100644
--- a/src/Element/BookContent/Segment.php
+++ b/src/Element/BookContent/Segment.php
@@ -50,7 +50,7 @@ class Segment {
}
public function getSummaryHtml (): string {
- return "- $this->name
";
+ return "- $this->name
";
}
-}
\ No newline at end of file
+}
diff --git a/src/Element/LinkCollection.php b/src/Element/LinkCollection.php
index eb170fc..66ae1b8 100644
--- a/src/Element/LinkCollection.php
+++ b/src/Element/LinkCollection.php
@@ -72,7 +72,7 @@ class LinkCollection {
public function getHtml (): string {
$str = "";
- if ($this->name != self::ROOT) $str .= "- $this->name
";
+ if ($this->name != self::ROOT) $str .= "- $this->name
";
foreach ($this->array as $node) {
$str .= $node->getHtml();
}