replace index.php with index.html
The index doesn’t have to be a PHP file since there is no need to generate the list of chapters anew every time the ToC is opened. Instead, the list of chapters is generated once, ahead of time, and saved to the index.html. As an added bonus, this allows the ToC to be generated and used as a local file.master
parent
bea947d6ff
commit
6a2f7e3d34
|
@ -0,0 +1 @@
|
||||||
|
/index.html
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> Unlikely Encounter </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> Unlikely Encounter </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> Unlikely Encounter </h1>
|
<h1> Unlikely Encounter </h1>
|
||||||
<p class="light">
|
<p class="light">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> Wake Up! </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> Wake Up! </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> Wake Up! </h1>
|
<h1> Wake Up! </h1>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> A Simple Errand </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> A Simple Errand </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> A Simple Errand</h1>
|
<h1> A Simple Errand</h1>
|
||||||
<p class="comment">
|
<p class="comment">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> Eventful Evening </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> Eventful Evening </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> Eventful Evening</h1>
|
<h1> Eventful Evening</h1>
|
||||||
<p class="comment">
|
<p class="comment">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> Library At Night </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> Library At Night </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> Library At Night</h1>
|
<h1> Library At Night</h1>
|
||||||
<p class="comment">
|
<p class="comment">
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
cp html_resources/index_template.html index.html
|
||||||
|
|
||||||
|
function genlinks {
|
||||||
|
for FILE in $(find . -maxdepth 1 -type f -name "*.html"); do
|
||||||
|
echo -ne " <li><a href=\"$FILE\">\n"
|
||||||
|
grep -oe "<title>.*</title>" $FILE | sed -e 's/<title> / /;s| </title>||'
|
||||||
|
echo " </a></li>"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
sed -ne '/ <!-- chapter_list_here -->/q;p' html_resources/index_template.html > index.html
|
||||||
|
# for some fucking reason, there is no way to tell wc to only print the number so we do cat abuse to get rid of the filename
|
||||||
|
LINE_NUMBER=$(("$(cat index.html | wc -l)"+2))
|
||||||
|
genlinks >> index.html
|
||||||
|
tail -n+$LINE_NUMBER html_resources/index_template.html >> index.html
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> Who died today? </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> Who died today? </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> Who Died Today?</h1>
|
<h1> Who Died Today?</h1>
|
||||||
<p class="comment">
|
<p class="comment">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html><html><head><title> <Post Apocalypse Story< </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> <Post Apocalypse Story> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body>
|
||||||
<h1> <Post Apocalypse Story< </h1>
|
<h1> <Post Apocalypse Story> </h1>
|
||||||
<p class="comment">
|
<p class="comment">
|
||||||
Yeah, there is no real title yet.
|
Yeah, there is no real title yet.
|
||||||
</p>
|
</p>
|
||||||
|
@ -7,11 +7,6 @@
|
||||||
Table of Contents:
|
Table of Contents:
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<?php
|
<!-- chapter_list_here -->
|
||||||
//TODO: get list of all html files
|
|
||||||
//TODO: get the chapter numbers from the filenames
|
|
||||||
//TODO: get the chapter titles from within the files
|
|
||||||
//TODO: build a list of links sorted by chapter number
|
|
||||||
?>
|
|
||||||
</ul>
|
</ul>
|
||||||
<script>let spans = ["<span class=\"paper_green\">", "<span>"];let paper_sections = document.getElementsByClassName("paper");for (let i = 0; i < paper_sections.length; i++) {let lines = paper_sections[i].innerHTML.split("\n");let result = "";for (let j = 0; j < lines.length; j++) {result = result + spans[j%2] + lines[j] + " ".repeat(80-lines[j].length) + "</span>\n";}paper_sections[i].innerHTML = result;}</script></body></html>
|
<script>let spans = ["<span class=\"paper_green\">", "<span>"];let paper_sections = document.getElementsByClassName("paper");for (let i = 0; i < paper_sections.length; i++) {let lines = paper_sections[i].innerHTML.split("\n");let result = "";for (let j = 0; j < lines.length; j++) {result = result + spans[j%2] + lines[j] + " ".repeat(80-lines[j].length) + "</span>\n";}paper_sections[i].innerHTML = result;}</script></body></html>
|
|
@ -5,7 +5,7 @@
|
||||||
<link rel="stylesheet" type="text/css" href="style.css">
|
<link rel="stylesheet" type="text/css" href="style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href="index.php">
|
<a href="index.html">
|
||||||
<button class="back"><</button>
|
<button class="back"><</button>
|
||||||
</a>
|
</a>
|
||||||
<h1> Layout Test Page </h1>
|
<h1> Layout Test Page </h1>
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
<!DOCTYPE html><html><head><title> Chapter Name </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> Chapter Name </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
<script>let spans = ["<span class=\"paper_green\">", "<span>"];let paper_sections = document.getElementsByClassName("paper");for (let i = 0; i < paper_sections.length; i++) {let lines = paper_sections[i].innerHTML.split("\n");let result = "";for (let j = 0; j < lines.length; j++) {result = result + spans[j%2] + lines[j] + " ".repeat(80-lines[j].length) + "</span>\n";}paper_sections[i].innerHTML = result;}</script></body></html>
|
<script>let spans = ["<span class=\"paper_green\">", "<span>"];let paper_sections = document.getElementsByClassName("paper");for (let i = 0; i < paper_sections.length; i++) {let lines = paper_sections[i].innerHTML.split("\n");let result = "";for (let j = 0; j < lines.length; j++) {result = result + spans[j%2] + lines[j] + " ".repeat(80-lines[j].length) + "</span>\n";}paper_sections[i].innerHTML = result;}</script></body></html>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> <chapter name> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> <chapter name> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> <chapter name></h1>
|
<h1> <chapter name></h1>
|
||||||
<p class="comment">
|
<p class="comment">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> Escape From Dome City </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> Escape From Dome City </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> Escape From Dome City</h1>
|
<h1> Escape From Dome City</h1>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> First Steps Outside </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> First Steps Outside </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> First Steps Outside</h1>
|
<h1> First Steps Outside</h1>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> <Emily Lab Incident> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> <Emily Lab Incident> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> <Emily Lab Incident> </h1>
|
<h1> <Emily Lab Incident> </h1>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> Basic Needs </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> Basic Needs </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> Basic Needs</h1>
|
<h1> Basic Needs</h1>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> <Emily First Contact> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> <Emily First Contact> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> <Emily First Contact></h1>
|
<h1> <Emily First Contact></h1>
|
||||||
<p class="comment">
|
<p class="comment">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> Alone </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> Alone </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> Alone</h1>
|
<h1> Alone</h1>
|
||||||
<p class="comment">
|
<p class="comment">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> <Story End Outline> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> <Story End Outline> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
<h1><Story End Outline></h1>
|
<h1><Story End Outline></h1>
|
||||||
<p class="comment">
|
<p class="comment">
|
||||||
This is not intended to be a chapter. It's more of an overview for
|
This is not intended to be a chapter. It's more of an overview for
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> <Reaching Nova Metropolis> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> <Reaching Nova Metropolis> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
<h1>
|
<h1>
|
||||||
<Reaching Nova Metropolis>
|
<Reaching Nova Metropolis>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> <Nova Metropolis> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> <Nova Metropolis> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
<h1><Nova Metropolis></h1>
|
<h1><Nova Metropolis></h1>
|
||||||
<p>
|
<p>
|
||||||
Michelle continues driving the bus for a couple hours without further
|
Michelle continues driving the bus for a couple hours without further
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> Landing Troubles </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> Landing Troubles </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
<h1>Landing Troubles</h1>
|
<h1>Landing Troubles</h1>
|
||||||
<p>
|
<p>
|
||||||
The escape pod <span class="comment">Is there a word that makes this sound
|
The escape pod <span class="comment">Is there a word that makes this sound
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html><html><head><title> <End> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.php"><button class="back"><</button></a>
|
<!DOCTYPE html><html><head><title> <End> </title><link rel="stylesheet" type="text/css" href="html_resources/style.css"></head><body><a href="index.html"><button class="back"><</button></a>
|
||||||
|
|
||||||
<h1> <End></h1>
|
<h1> <End></h1>
|
||||||
<p class="comment">
|
<p class="comment">
|
||||||
|
|
Loading…
Reference in New Issue