Skip to content

Commit e25922b

Browse files
author
Oskar Lundström
committed
Merge branch 'master' into oskar
2 parents 042cdef + e829327 commit e25922b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2630
-1679
lines changed

Bear_test/ideer.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ Vektorer:
33
flygande fåglar (vind, flaxfrekvens, resultant)
44

55
Mekanik som lådor o krafter
6-
6+
utöka befintligt krafter_på_lådor till svt
7+
78
Calculus:
89
Integrering o deriveringar:
910
medelhastigher, sträcka över tid
11+
(inge intergraler atm)
1012

1113

1214
rnd:

Bear_test/krafter_pa_lador.lhs

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ $ enh_vekt (V2 0 0)
9696
Jag skulle anta att enh_vekt bara gäller då (magnitude v) =/= 0.
9797
9898
99-
-- Fixed nollvektorn.
10099
101100
102101
*Main> fru fg (pi/4) 0
@@ -154,14 +153,36 @@ fru'
154153
(7.500000000000001 x, -4.330127018922193 y
155154
156155
157-
158-
wtf händer? Hur kan fr ha samma x-vektor för två olika vinklar inom samma kvadrant?
159-
160156
fn
161157
162158
*Main> fn fg (pi/3)
163159
(-4.330127018922194 x, -2.500000000000001 y)
164160
*Main> fn fg (pi/6)
165161
(-4.330127018922193 x, -7.500000000000001 y)
166162
163+
-------------------------------- SVT ------------------------------------
164+
165+
Hur mycket bromsar friktionen?
166+
Med F = m N
167+
168+
2.
169+
F = ma
170+
171+
3.
172+
x = v0 * t + a * t^2 / 2
173+
174+
175+
176+
177+
178+
179+
180+
181+
182+
183+
184+
185+
186+
187+
167188

Book/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore the built files
2+
build/

Book/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
run :
3+
python3 build.py

Book/build.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import os
99
import shutil
10+
from urllib.parse import quote
1011
from subprocess import Popen, PIPE
1112

1213
def read_file(filepath):
@@ -54,7 +55,7 @@ def build_sections(sources):
5455
next_chap_name = "Table of contents"
5556
if (i + 1) < len(chapters):
5657
next_section, next_chap_name, _ = chapters[i + 1]
57-
next_chap_href = "../{}/{}.html".format(next_section, next_chap_name)
58+
next_chap_href = "../{}/{}.html".format(quote(next_section, safe=''), quote(next_chap_name, safe=''))
5859
if not os.path.exists(section):
5960
os.makedirs(section)
6061
chapter_path = "../../" + chapter_source
@@ -75,10 +76,11 @@ def build_sections(sources):
7576
"lhs-source-href": lhs_source_href,
7677
"lhs-source-name": lhs_source_name,
7778
})
78-
out_path = "{}/{}.html".format(section, chapter_name)
79+
out_path = "{}/{}.html".format(section, chapter_name)
80+
out_path_u = "{}/{}.html".format(quote(section, safe=''), quote(chapter_name, safe=''))
7981
write_string_to_file(chapter, out_path)
8082
copy_images(os.path.dirname(chapter_path), section)
81-
prev_chap_href = "../" + out_path
83+
prev_chap_href = "../" + out_path_u
8284
prev_chap_name = chapter_name
8385

8486
def build_index(sources):
@@ -88,7 +90,7 @@ def build_index(sources):
8890
toc += "<div>" + section_name + "</div>\n"
8991
toc += "<ul>\n"
9092
for (chapter_name, _) in chapter_sources:
91-
chapter_path = "{}/{}.html".format(section_name, chapter_name)
93+
chapter_path = "{}/{}.html".format(quote(section_name, safe=''), quote(chapter_name, safe=''))
9294
toc += "<li><a href=\"{}\">{}</a></li>\n".format(chapter_path, chapter_name)
9395
toc += "</ul>\n</li>\n"
9496
index_template = open_template("index")
@@ -97,17 +99,20 @@ def build_index(sources):
9799

98100
sources = [
99101
("Introduction", [
100-
("Introduction'", "Physics/src/Introduction/Introduction.lhs"),
102+
("About this book", "Physics/src/Introduction/About.lhs"),
103+
("So what's a DSL?", "Physics/src/Introduction/WhatIsADsl.lhs"),
104+
("Getting started", "Physics/src/Introduction/GettingStarted.lhs"),
101105
]),
102106
("Calculus", [
103107
("Introduction", "Physics/src/Calculus/Intro.lhs"),
104108
("Function expressions", "Physics/src/Calculus/FunExpr.lhs"),
105109
("Differential calculus", "Physics/src/Calculus/DifferentialCalc.lhs"),
106110
("Integral calculus", "Physics/src/Calculus/IntegralCalc.lhs"),
107-
("Visualization", "Physics/src/Calculus/VisVerApp.lhs"),
111+
("Plotting graphs", "Physics/src/Calculus/VisVerApp.lhs"),
112+
("Syntax trees", "Physics/src/Calculus/SyntaxTree.lhs"),
108113
]),
109-
("Vectors", [
110-
("Vector", "Physics/src/Vector/Vector.lhs")
114+
("Linear algebra", [
115+
("Vectors", "Physics/src/Vector/Vector.lhs")
111116
]),
112117
("Dimensions", [
113118
("Introduction", "Physics/src/Dimensions/Intro.lhs"),
@@ -116,16 +121,17 @@ def build_index(sources):
116121
"Physics/src/Dimensions/ValueLevel/Test.lhs"),
117122
("Type-level dimensions", "Physics/src/Dimensions/TypeLevel.lhs"),
118123
("Quantities", "Physics/src/Dimensions/Quantity.lhs"),
119-
("Testing of Quantity",
124+
("Testing of Quantities",
120125
"Physics/src/Dimensions/Quantity/Test.lhs"),
121126
("Usage", "Physics/src/Dimensions/Usage.lhs"),
122127
]),
128+
("Newtonian Mechanics", [
129+
("Single particle mechanics", "Physics/src/NewtonianMechanics/SingleParticle.lhs")
130+
]),
123131
("Examples", [
124-
("Gungbräda", "Physics/src/Examples/Gungbraeda.lhs"),
125-
("krafter på lådor", "Physics/src/Examples/krafter_pa_lador.lhs"),
126-
132+
("Teeter", "Physics/src/Examples/Teeter.lhs"),
133+
("Box on an incline", "Physics/src/Examples/Box_incline.lhs"),
127134
])
128-
129135
]
130136

131137
if not os.path.exists("build"):

Book/chapter.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<a href="../index.html">Table of contents</a>
3232
<span>Next: <a href="{next-href}">{next-name}</a></span>
3333
</nav>
34-
© Kandidatboisen (2018), GPL
34+
© Björn Werner, Erik Sjöström, Johan Johansson, Oskar Lundström (2018), GPL
3535
</footer>
3636
</body>
3737
</html>

Book/includes/type.html

Lines changed: 0 additions & 63 deletions
This file was deleted.

Book/index.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</main>
2121

2222
<footer>
23-
© Kandidatboisen (2018), GPL
23+
© Björn Werner, Erik Sjöström, Johan Johansson, Oskar Lundström (2018), GPL
2424
</footer>
2525
</body>
2626
</html>

Book/style.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ div#toc ol > li > ul {
8686
border-radius: 5px;
8787
}
8888

89+
.center-img {
90+
display: block;
91+
border: 3px solid #F0F0F0;
92+
border-radius: 5px;
93+
}
94+
8995
.float-img-left, .float-img-right {
9096
width: 35%;
9197
}

Book/test.html

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)