Update book-to-static.php
Added the HTML to not show random Unicode characters Added customizable css
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
$apiUrl = getenv('BS_URL') ?: '';
|
||||
$clientId = getenv('BS_TOKEN_ID') ?: '';
|
||||
$clientSecret = getenv('BS_TOKEN_SECRET') ?: '';
|
||||
$htmlCss = getenv('BS_CSS_FILE') ?: '';
|
||||
|
||||
// Output Folder
|
||||
// Can be provided as a arguments when calling the script
|
||||
@@ -132,7 +133,8 @@ function getImageFile(string $url): string {
|
||||
* Get the HTML representation of a book.
|
||||
*/
|
||||
function getBookHtmlOutput(array $book, array $chapters, array $pages): string {
|
||||
$content = "<html><link rel='stylesheet' href='markdown.css'><head></head><body>";
|
||||
global $htmlCss;
|
||||
$content = "<html><link rel='stylesheet' href='{$htmlCss}'><head></head><body>";
|
||||
$content .= "<h1>{$book['name']}</h1>";
|
||||
$content .= "<p>{$book['description']}</p>";
|
||||
$content .= "<hr>";
|
||||
@@ -157,7 +159,8 @@ function getBookHtmlOutput(array $book, array $chapters, array $pages): string {
|
||||
* Get the HTML representation of a chapter.
|
||||
*/
|
||||
function getChapterHtmlOutput(array $chapter, array $pages): string {
|
||||
$content = "<html><link rel='stylesheet' href='markdown.css'><head></head><body>";
|
||||
global $htmlCss;
|
||||
$content = "<html><link rel='stylesheet' href='{$htmlCss}'><head></head><body>";
|
||||
$content .= "<p><a href='./index.html'>Back to book</a></p>";
|
||||
$content .= "<h1>{$chapter['name']}</h1>";
|
||||
$content .= "<p>{$chapter['description']}</p>";
|
||||
@@ -176,7 +179,8 @@ function getChapterHtmlOutput(array $chapter, array $pages): string {
|
||||
* Get the HTML representation of a page.
|
||||
*/
|
||||
function getPageHtmlOutput(array $page, ?array $parentChapter): string {
|
||||
$content = "<html><link rel='stylesheet' href='markdown.css'><head></head><body>";
|
||||
global $htmlCss;
|
||||
$content = "<html><link rel='stylesheet' href='{$htmlCss}'><head></head><body>";
|
||||
if (is_null($parentChapter)) {
|
||||
$content .= "<p><a href='./index.html'>Back to book</a></p>";
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user