1
0

show readme for books

This commit is contained in:
Mike Schwörer 2020-01-23 12:14:13 +01:00
parent f3815c1d1c
commit 2e2d4a0d84
14 changed files with 561 additions and 37 deletions

View File

@ -79,7 +79,7 @@ print()
print('======== CALL SCSS ========')
out = subprocess.run(['ruby', 'scss', '--style=expanded', '--no-cache', '--update', fsource + ':' + finput],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print('> scss.bat --style=expanded --no-cache --update ' + fsource + ':' + finput)
print('> ruby scss --style=expanded --no-cache --update ' + fsource + ':' + finput)
print('STDOUT:')
print(out.stdout.decode('utf-8'))
print('STDERR:')

View File

@ -1886,6 +1886,14 @@ html, body {
margin: 10px;
}
.bookv_readme {
margin: 10px;
padding: 16px;
background: #EEEEEE;
color: #333333;
border: 1px solid rgba(0, 0, 0, 0.15);
}
@media (max-width: 991px) {
.bookv_content {
border: none;

View File

@ -353,6 +353,7 @@ html,body{margin:0;padding:0;height:100%}
.bookv_dl_github{background:#4078c0}
.bookv_right_lang img{display:inline;height:16pt;max-width:32px;margin:1px 2px 0 2px}
.bookv_extra{height:500px;border:1px solid #333;background:#aaa;margin:10px}
.bookv_readme{margin:10px;padding:16px;background:#eee;color:#333;border:1px solid rgba(0,0,0,0.15)}
@media(max-width:991px){
.bookv_content{border:0}
#bookv_header h1{font-size:28pt}

View File

@ -107,6 +107,14 @@
}
.bookv_readme {
margin: 10px;
padding: 16px;
background: $LAYER2_TXTBLOCK_BG;
color: $LAYER2_TXTBLOCK_FG;
border:$LAYER2_TXTBLOCK_BORDER;
}
@include rdmedia_range(0,2) {
.bookv_content { border: none; }
#bookv_header h1 { font-size: 28pt; }

View File

@ -6,8 +6,6 @@ require_once 'Utils.php';
class EGGDatabase
{
const DB_NAME = "";
/** @var string */
private $path;

View File

@ -32,6 +32,8 @@ class Books implements IWebsiteModule
$a['preview_url'] = '/data/dynamic/bookprev_' . $a['id'] . '.png';
$a['preview_path'] = __DIR__ . '/../../data/dynamic/bookprev_' . $a['id'] . '.png';
$a['file_readme'] = (__DIR__ . '/../../statics/books/' . $a['id'] . '.md');
$a['url'] = '/books/view/' . $a['id'] . '/' . destructiveUrlEncode($a['title']);
$a['extraimages_urls'] = [];
@ -68,44 +70,38 @@ class Books implements IWebsiteModule
$ids = [];
foreach ($this->staticData as $prog)
foreach ($this->staticData as $book)
{
if (in_array($prog['id'], $ids)) return ['result'=>'err', 'message' => 'Duplicate id ' . $prog['id']];
$ids []= $prog['id'];
if (in_array($book['id'], $ids)) return ['result'=>'err', 'message' => 'Duplicate id ' . $book['id']];
$ids []= $book['id'];
if (!file_exists($prog['imgfront_path'])) return ['result'=>'err', 'message' => 'Image (Front) not found ' . $prog['title_short']];
if (!file_exists($prog['imgfull_path'])) return ['result'=>'err', 'message' => 'Image (Full) not found ' . $prog['title_short']];
if (!file_exists($book['imgfront_path'])) return ['result'=>'err', 'message' => 'Image (Front) not found ' . $book['title_short']];
if (!file_exists($book['imgfull_path'])) return ['result'=>'err', 'message' => 'Image (Full) not found ' . $book['title_short']];
foreach ($prog['extraimages_paths'] as $eipath)
foreach ($book['extraimages_paths'] as $eipath)
{
if (!file_exists($eipath)) return ['result'=>'err', 'message' => 'Extra-Image not found ' . $prog['title_short']];
if (!file_exists($eipath)) return ['result'=>'err', 'message' => 'Extra-Image not found ' . $book['title_short']];
}
if ($prog['book_count'] <= 0) return ['result'=>'err', 'message' => 'BookCount must be greater than zero ' . $prog['title_short']];
if ($book['book_count'] <= 0) return ['result'=>'err', 'message' => 'BookCount must be greater than zero ' . $book['title_short']];
if ($prog['book_count'] > 1 && !is_array($prog['pdf'])) return ['result'=>'err', 'message' => 'Attribute [pdf] must be an array ' . $prog['title_short']];
if ($prog['book_count'] > 1 && count($prog['pdf']) !== $prog['book_count']) return ['result'=>'err', 'message' => 'Attribute [pdf] must be the correct size ' . $prog['title_short']];
if ($prog['book_count'] === 1 && !is_string($prog['pdf'])) return ['result'=>'err', 'message' => 'Attribute [pdf] must be an string ' . $prog['title_short']];
if ($book['book_count'] > 1 && !is_array($book['pdf'])) return ['result'=>'err', 'message' => 'Attribute [pdf] must be an array ' . $book['title_short']];
if ($book['book_count'] > 1 && count($book['pdf']) !== $book['book_count']) return ['result'=>'err', 'message' => 'Attribute [pdf] must be the correct size ' . $book['title_short']];
if ($book['book_count'] === 1 && !is_string($book['pdf'])) return ['result'=>'err', 'message' => 'Attribute [pdf] must be an string ' . $book['title_short']];
if ($prog['book_count'] > 1 && !is_array($prog['pages'])) return ['result'=>'err', 'message' => 'Attribute [pages] must be an array ' . $prog['title_short']];
if ($prog['book_count'] > 1 && count($prog['pages']) !== $prog['book_count']) return ['result'=>'err', 'message' => 'Attribute [pages] must be the correct size ' . $prog['title_short']];
if ($prog['book_count'] === 1 && !is_string($prog['pages'])) return ['result'=>'err', 'message' => 'Attribute [pages] must be an string ' . $prog['title_short']];
if ($book['book_count'] > 1 && !is_array($book['pages'])) return ['result'=>'err', 'message' => 'Attribute [pages] must be an array ' . $book['title_short']];
if ($book['book_count'] > 1 && count($book['pages']) !== $book['book_count']) return ['result'=>'err', 'message' => 'Attribute [pages] must be the correct size ' . $book['title_short']];
if ($book['book_count'] === 1 && !is_string($book['pages'])) return ['result'=>'err', 'message' => 'Attribute [pages] must be an string ' . $book['title_short']];
if (!file_exists($book['file_readme'])) return ['result'=>'err', 'message' => 'Readme not found ' . $book['title_short']];
if (!file_exists($book['preview_path'])) $warn = ['result'=>'warn', 'message' => 'Preview not found ' . $book['title_short']];
}
if ($warn != null) return $warn;
return ['result'=>'ok', 'message' => ''];
}
public function checkThumbnails()
{
foreach (self::listAll() as $book)
{
if (!file_exists($book['preview_path'])) return ['result'=>'err', 'message' => 'Preview not found ' . $book['title_short']];
}
return ['result'=>'ok', 'message' => ''];
}
public function createPreview($prog)
{
$src = $prog['imgfront_path'];
@ -139,4 +135,9 @@ class Books implements IWebsiteModule
return "Online";
}
public function getREADME($book)
{
return file_get_contents($book['file_readme']);
}
}

View File

@ -251,22 +251,14 @@ class Programs implements IWebsiteModule
{
if (!file_exists($eipath)) return ['result'=>'err', 'message' => 'Extra-Image not found ' . $prog['name'], 'long' => $eipath];
}
if (!file_exists($prog['preview_path'])) $warn = ['result'=>'warn', 'message' => 'Preview not found ' . $prog['name']];
}
if ($warn != null) return $warn;
return ['result'=>'ok', 'message' => ''];
}
public function checkThumbnails()
{
foreach ($this->staticData as $prog)
{
if (!file_exists($prog['preview_path'])) return ['result'=>'err', 'message' => 'Preview not found ' . $prog['name']];
}
return ['result'=>'ok', 'message' => ''];
}
public function createPreview($prog)
{
$src = $prog['mainimage_path'];

View File

@ -108,5 +108,9 @@ $FRAME_OPTIONS->addScript('/data/javascript/ms_basic.js', true);
</a>
</div>
<div class="bookv_readme base_markdown">
<?php echo $SITE->renderMarkdown($SITE->modules->Books()->getREADME($book)); ?>
</div>
</div>
</div>

View File

@ -0,0 +1,49 @@
A Practical Guide To Evil (LyX)
===============================
[https://practicalguidetoevil.wordpress.com/](https://practicalguidetoevil.wordpress.com/) LyX files
----------
A pdf version of *A Practical Guide To Evil* used for printing the book on [epubli.com](https://www.epubli.de/)
Font and back cover image edited with [Paint.net](http://www.getpaint.net/), [Gimp](https://www.gimp.org/) and [canva.com](https://www.canva.com)
Front image from [sandara](http://sandara.deviantart.com/art/Catherine-Foundling-608331843)
*you will need the [Crimson Text](https://www.google.com/fonts/specimen/Crimson+Text) and [ Linux Biolinum](http://sourceforge.net/projects/linuxlibertine/?source=typ_redirect) font - and [LyX 2.1.5](http://www.lyx.org/)*
###Chapters
~~~
0. Prologue
1. Knife
2. Invitation
3. Party
4. Name
5. Role
6. Aspect
7. Sword
8. Introduction
9. Claimant
10. Menace
11. Sucker Punch
12. Squire
13. Order
14. Villain
15. Company
16. Game
17. Set
18. Match
19. Pivot
20. Rise
21. Fall
22. All According To
23. Moroks Plan
24. Aishas Plan
25. Snatchers Plan
26. Junipers Plan
27. Callows Plan
28. Win Condition
29. Epilogue
~~~

View File

@ -0,0 +1,84 @@
HPMOR-LyX
=========
[Harry Potter and the Methods of Rationality](http://hpmor.com/) LyX files
----------
"Cleaner" version than the one by IlCensore: *(but still - big thanks to him, for creating all the lyx files for all the chapters)*
- Removed Images
- Split into three books (1+2 | 3+4 | 5+6)
- Same style across all three volumes
- Removed compiler errors (at least on my machine)
- etc etc
*you will need the [Crimson](https://www.google.com/fonts/specimen/Crimson+Text) and [Biolinum](http://sourceforge.net/projects/linuxlibertine/?source=typ_redirect) font - and [LyX](http://www.lyx.org/)*
### Calculations ([official](http://hpmor.com/) PDFs)
~~~
Book 1: HJPEV and the Methods of Rationality :: 351 p
Book 2: HJPEV and the Professor's Games :: 287 p
Book 3: HJPEV and the Shadows of Death :: 397 p
Book 4: HJG and the Phoenix's Call :: 393 p
Book 5: HJPEV and the Last Enemy :: 231 p
Book 6: HJPEV and the Philosopher's Stone :: 319 p
VOL 1 : 638
VOL 2 : 790
VOL 3 : 550
________________
SUM : 1978 p
~~~
### Calculations (my LyX files)
~~~
VOL 1 : Ch 001-021 + 022-037 -> 597p ( epubli: 32€ )
VOL 2 : Ch 038-064 + 065-085 -> 719p ( epubli: 45€ )
VOL 3 : Ch 086-099 + 100-122 -> 493p ( epubli: 38€ )
________________
1809p ( 115 € )
~~~
### Chapters
~~~
1. A Day of Very Low Probability
2. Everything I Believe Is False
3. Comparing Reality To Its Alternatives
4. The Efficient Market Hypothesis
5. The Fundamental Attribution Error
6. The Planning Fallacy
7. Reciprocation
8. Positive Bias
9. Title Redacted, Part I
10. Self Awareness, Part II
11. Omake Files 1, 2, 3
12. Impulse Control
13. Asking the Wrong Questions
14. The Unknown and the Unknowable
15. Conscientiousness
16. Lateral Thinking
17. Locating the Hypothesis
18. Dominance Hierarchies
19. Delayed Gratification
20. Bayes's Theorem
21. Rationalization
22. The Scientific Method
23. Belief in Belief
24. Machiavellian Intelligence Hypothesis
25. Hold Off on Proposing Solutions
26. Noticing Confusion
27. Empathy
28. Reductionism
29. Egocentric Bias
30. Working in Groups, Pt 1
31. Working in Groups, Pt 2
32. Interlude: Personal Financial Management
33. Coordination Problems, Pt 1
34. Coordination Problems, Pt 2
35. Coordination Problems, Pt 3
36. Status Differentials
37. Interlude: Crossing the Boundary
~~~

View File

@ -0,0 +1,95 @@
HPMOR-LyX
=========
[Harry Potter and the Methods of Rationality](http://hpmor.com/) LyX files
----------
"Cleaner" version than the one by IlCensore: *(but still - big thanks to him, for creating all the lyx files for all the chapters)*
- Removed Images
- Split into three books (1+2 | 3+4 | 5+6)
- Same style across all three volumes
- Removed compiler errors (at least on my machine)
- etc etc
*you will need the [Crimson](https://www.google.com/fonts/specimen/Crimson+Text) and [Biolinum](http://sourceforge.net/projects/linuxlibertine/?source=typ_redirect) font - and [LyX](http://www.lyx.org/)*
### Calculations ([official](http://hpmor.com/) PDFs)
~~~
Book 1: HJPEV and the Methods of Rationality :: 351 p
Book 2: HJPEV and the Professor's Games :: 287 p
Book 3: HJPEV and the Shadows of Death :: 397 p
Book 4: HJG and the Phoenix's Call :: 393 p
Book 5: HJPEV and the Last Enemy :: 231 p
Book 6: HJPEV and the Philosopher's Stone :: 319 p
VOL 1 : 638
VOL 2 : 790
VOL 3 : 550
________________
SUM : 1978 p
~~~
### Calculations (my LyX files)
~~~
VOL 1 : Ch 001-021 + 022-037 -> 597p ( epubli: 32€ )
VOL 2 : Ch 038-064 + 065-085 -> 719p ( epubli: 45€ )
VOL 3 : Ch 086-099 + 100-122 -> 493p ( epubli: 38€ )
________________
1809p ( 115 € )
~~~
### Chapters
~~~
38. The Cardinal Sin
39. Pretending to be Wise, Pt 1
40. Pretending to be Wise, Pt 2
41. Frontal Override
42. Courage
43. Humanism, Pt 1
44. Humanism, Pt 2
45. Humanism, Pt 3
46. Humanism, Pt 4
47. Personhood Theory
48. Utilitarian Priorities
49. Prior Information
50. Self Centeredness
51. Title Redacted, Pt 1
52. The Stanford Prison Experiment, Pt 2
53. The Stanford Prison Experiment, Pt 3
54. The Stanford Prison Experiment, Pt 4
55. The Stanford Prison Experiment, Pt 5
56. TSPE, Constrained Optimization, Pt 6
57. TSPE, Constrained Cognition, Pt 7
58. TSPE, Constrained Cognition, Pt 8
59. TSPE, Curiosity, Pt 9
60. The Stanford Prison Experiment, Pt 10
61. TSPE, Secrecy and Openness, Pt 11
62. The Stanford Prison Experiment, Final
63. TSPE, Aftermaths
64. Omake Files 4, Alternate Parallels
65. Contagious Lies
66. Self Actualization, Pt 1
67. Self Actualization, Pt 2
68. Self Actualization, Pt 3
69. Self Actualization, Pt 4
70. Self Actualization, Pt 5
71. Self Actualization, Pt 6
72. SA, Plausible Deniability, Pt 7
73. SA, The Sacred and the Mundane, Pt 8
74. SA, Escalation of Conflicts, Pt 9
75. Self Actualization Final, Responsibility
76. Interlude with the Confessor: Sunk Costs
77. SA, Aftermaths: Surface Appearances
78. Taboo Tradeoffs Prelude: Cheating
79. Taboo Tradeoffs, Pt 1
80. Taboo Tradeoffs, Pt 2, The Horns Effect
81. Taboo Tradeoffs, Pt 3
82. Taboo Tradeoffs, Final
83. Taboo Tradeoffs, Aftermath 1
84. Taboo Tradeoffs, Aftermath 2
85. Taboo Tradeoffs, Aftermath 3, Distance
~~~

View File

@ -0,0 +1,84 @@
HPMOR-LyX
=========
[Harry Potter and the Methods of Rationality](http://hpmor.com/) LyX files
----------
"Cleaner" version than the one by IlCensore: *(but still - big thanks to him, for creating all the lyx files for all the chapters)*
- Removed Images
- Split into three books (1+2 | 3+4 | 5+6)
- Same style across all three volumes
- Removed compiler errors (at least on my machine)
- etc etc
*you will need the [Crimson](https://www.google.com/fonts/specimen/Crimson+Text) and [Biolinum](http://sourceforge.net/projects/linuxlibertine/?source=typ_redirect) font - and [LyX](http://www.lyx.org/)*
### Calculations ([official](http://hpmor.com/) PDFs)
~~~
Book 1: HJPEV and the Methods of Rationality :: 351 p
Book 2: HJPEV and the Professor's Games :: 287 p
Book 3: HJPEV and the Shadows of Death :: 397 p
Book 4: HJG and the Phoenix's Call :: 393 p
Book 5: HJPEV and the Last Enemy :: 231 p
Book 6: HJPEV and the Philosopher's Stone :: 319 p
VOL 1 : 638
VOL 2 : 790
VOL 3 : 550
________________
SUM : 1978 p
~~~
### Calculations (my LyX files)
~~~
VOL 1 : Ch 001-021 + 022-037 -> 597p ( epubli: 32€ )
VOL 2 : Ch 038-064 + 065-085 -> 719p ( epubli: 45€ )
VOL 3 : Ch 086-099 + 100-122 -> 493p ( epubli: 38€ )
________________
1809p ( 115 € )
~~~
### Chapters
~~~
86. Multiple Hypothesis Testing
87. Hedonic Awareness
88. Time Pressure, Pt 1
89. Time Pressure, Pt 2
90. Roles, Pt 1
91. Roles, Pt 2
92. Roles, Pt 3
93. Roles, Pt 4
94. Roles, Pt 5
95. Roles, Pt 6
96. Roles, Pt 7
97. Roles, Pt 8
98. Roles, Final
99. Roles, Aftermath
100. Precautionary Measures, Pt 1
101. Precautionary Measures, Pt 2
102. Caring
103. Tests
104. The Truth, Pt 1, Riddles and Answers
105. The Truth, Pt 2
106. The Truth, Pt 3
107. The Truth, Pt 4
108. The Truth, Pt 5, Answers and Riddles
109. Reflections
110. Reflections, Pt 2
111. Failure, Pt 1
112. Failure, Pt 2
113. Final Exam
114. Shut Up and Do The Impossible
115. Shut Up and Do The Impossible, Pt 2
116. Aftermath, Something to Protect, Pt 0
117. Something to Protect: Minerva McGonagall
118. Something to Protect: Professor Quirrell
119. Something to Protect: Albus Dumbledore
120. Something to Protect: Draco Malfoy
121. Something to Protect: Severus Snape
122. Something to Protect: Hermione Granger
~~~

32
www/statics/books/mm.md Normal file
View File

@ -0,0 +1,32 @@
The Metropolitan Man (LyX)
===============================
[The Metropolitan Man](https://www.fanfiction.net/s/10360716/1/) LyX files
----------
A PDF version of *The Metropolitan* used for printing the book on [epubli.com](https://www.epubli.de/)
Font and back cover image created with [Paint.net](http://www.getpaint.net/) and [Gimp](https://www.gimp.org/)
Front cover art from [Justin Maller](http://justinmaller.com/wallpapers/)
*You will need the [Crimson Text](https://www.google.com/fonts/specimen/Crimson+Text) and [ Linux Biolinum](http://sourceforge.net/projects/linuxlibertine/?source=typ_redirect) font - and [LyX 2.1.5](http://www.lyx.org/)*
### Chapters
~~~
1. Literally Incredible
2. Dissemination of Information
3. The All-Seeing Eye
4. Like Clockwork
5. A Stopped Clock
6. Private Wars
7. Choices
8. Peeling Back the Veil
9. Dust to Dust
10. A Vast and Terrifying Enemy
11. Actions and Consequences
12. Finale, Part 1
13. Finale, Part 2
~~~

168
www/statics/books/mol.md Normal file
View File

@ -0,0 +1,168 @@
Mother of Learning (LyX)
===============================
[Mother of Learning](https://www.fictionpress.com/s/2961893) LyX files
----------
A PDF version of *Mother of Learning* used for printing the book on [epubli.com](https://www.epubli.de/)
Front and back cover created with [Gimp](https://www.gimp.org/) and [Paint.net](http://www.getpaint.net/)
Front cover art from [Zilch](https://www.pixiv.net/en/artworks/69959210)
Mid book art from [lonsheep](https://lonsheep.tumblr.com/post/148979172041)
*You will need the [Crimson Text](https://www.google.com/fonts/specimen/Crimson+Text) and [ Linux Biolinum](http://sourceforge.net/projects/linuxlibertine/?source=typ_redirect) font - and [LyX 2.1.5](http://www.lyx.org/)*
epubli Settings:
~~~
Titel: Mother of Learning
Autor: Domagoj Kurmaic
Bindungsart: Softcover
Papiertyp: 90 g/m² cremeweiß, matt
Format: Taschenbuch
Druck Cover: matt
Druck Inhalt: schwarz/weiß
Cover-Vorlage: epubli Cover Schwarz
~~~
| N | Book | Pages | Cost
|---|------------------|----------|-----------------
| 1 | Arc I - Part 1 | 298 (+2) | 7.76 €
| 2 | Arc I - Part 2 | 328 | 8.23 €
| 3 | Arc II - Part 1 | 330 (+2) | 8.30 €
| 4 | Arc II - Part 2 | 362 (+2) | 8.84 €
| 5 | Arc III - Part 1 | 372 | 8.97 €
| 6 | Arc III - Part 2 | 346 (+2) | 8.57 €
| 7 | Arc III - Part 3 | 396 | 9.37 €
| 8 | Arc III - Part 4 | ? | ?
### Book 1 (Arc I - Part 1)
~~~
1 Good Morning Brother
2 Lifes Little Problems
3 The Bitter Truth
4 Stars Fell
5 Start Over
6 Concentrate and Try Again
7 Of Gaps And Pretending
8 Perspective
9 Cheaters
10 Overlooked Details
11 Limiters
12 Soul Web
13 Any Second Now
~~~
### Book 2 (Arc I - Part 2)
~~~
14 The Sister Effect
15 Busy Friday
16 We Need To Talk
17 Sympathy for the Spider
18 The Pact is Sealed
19 Tangled Webs
20 A Matter of Faith
21 Wheel of Fortune
22 Complications
23 Lighting the Fuse
24 Smoke and Mirrors
25 The Unexpected
26 Soulkill
~~~
### Book 3 (Arc II - Part 1)
~~~
27 Cast Adrift
28 Cauldron
29 The Hunters and the Hunted
30 A Game of Shops
31 Marked
32 Alternatives
33 Gateways
34 Unreasonable Things
35 Mistakes Have Been Made
36 A Battle of Minds
37 Slow Burn
38 Return to Cyoria
39 Suspicious Coincidences
40 Shifting Tracks
~~~
### Book 4 (Arc II - Part 2)
~~~
41 Myriad Clashing Motives
42 Sum of its Parts
43 Overwhelmed
44 A Show of Trust
45 Fine Structures
46 The Other Side
47 Politics
48 Well of Souls
49 Substitution
50 Containment
51 Out of Control
52 Things Fall Apart
53 Phantoms
54 The Gate Is Barred
~~~
### Book 5 (Arc III - Part 1)
~~~
55 Threshold
56 Obscure
57 Unwanted
58 Questions and Answers
59 One Step Forward
60 Into the Abyss
61 Anthills
62 Improperly Used
63 The March of Days
64 Distance
65 Dangerous Ground
66 Marred Perfection
67 Convergence
68 Green Hell
~~~
### Book 6 (Arc III - Part 2)
~~~
69 Ruin
70 Carried Away
71 Shadows of the Past
72 Crossroads
73 Plodding Ahead
74 The Return
75 Soul Stealer
76 Critical Blunder
77 Testing
78 Grinding Stone
79 Crime and Evading Punishment
80 Enemies
81 A Civil Conversation
82 Ancient Circles
~~~
### Book 7 (Arc III - Part 3)
~~~
83 Scorpion
84 Powerless
85 Critical Mass
86 A New World
87 Agents of the Crown
88 Mysterious Ways
89 Victory
90 Change of Plans
91 A Path Paid in Blood
92 The Scramble
93 Shelter in the Storm
94 Ghosts
95 Betrayer
96 Contract
~~~
### Book 8 (Arc III - Part 4)
~~~
???
~~~