Skip to content

Commit 778647c

Browse files
committed
Merging
2 parents 8576901 + 4f29121 commit 778647c

Some content is hidden

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

55 files changed

+1661
-1508
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/build.py

Lines changed: 24 additions & 12 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,7 +99,19 @@ 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"),
105+
]),
106+
("Calculus", [
107+
("Introduction", "Physics/src/Calculus/Intro.lhs"),
108+
("Function expressions", "Physics/src/Calculus/FunExpr.lhs"),
109+
("Differential calculus", "Physics/src/Calculus/DifferentialCalc.lhs"),
110+
("Integral calculus", "Physics/src/Calculus/IntegralCalc.lhs"),
111+
("Plotting graphs", "Physics/src/Calculus/VisVerApp.lhs"),
112+
]),
113+
("Linear algebra", [
114+
("Vectors", "Physics/src/Vector/Vector.lhs")
101115
]),
102116
("Dimensions", [
103117
("Introduction", "Physics/src/Dimensions/Intro.lhs"),
@@ -106,7 +120,7 @@ def build_index(sources):
106120
"Physics/src/Dimensions/ValueLevel/Test.lhs"),
107121
("Type-level dimensions", "Physics/src/Dimensions/TypeLevel.lhs"),
108122
("Quantities", "Physics/src/Dimensions/Quantity.lhs"),
109-
("Testing of Quantity",
123+
("Testing of Quantities",
110124
"Physics/src/Dimensions/Quantity/Test.lhs"),
111125
("Usage", "Physics/src/Dimensions/Usage.lhs"),
112126
]),
@@ -122,13 +136,11 @@ def build_index(sources):
122136
]),
123137
("Newtonian Mechanics", [
124138
("Single particle mechanics", "Physics/src/NewtonianMechanics/SingleParticle.lhs")
125-
]),
126-
("Examples", [
127-
("Gungbräda", "Physics/src/Examples/Gungbraeda.lhs"),
128-
("krafter på lådor", "Physics/src/Examples/krafter_pa_lador.lhs"),
129-
130139
])
131-
140+
# ("Examples", [
141+
# ("Gungbräda", "Physics/src/Examples/Gungbraeda.lhs"),
142+
# ("krafter på lådor", "Physics/src/Examples/krafter_pa_lador.lhs"),
143+
# ])
132144
]
133145

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

Book/style.css

Lines changed: 25 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
}
@@ -99,6 +105,12 @@ div#toc ol > li > ul {
99105
float: left;
100106
margin-right: 10px;
101107
}
108+
.img-center {
109+
display: block;
110+
margin-left: auto;
111+
margin-right: auto;
112+
width: 100%;
113+
}
102114

103115
figcaption {
104116
font-size: 70%;
@@ -126,6 +138,19 @@ blockquote {
126138
border-left: 3px solid #BABABA;
127139
}
128140

141+
details {
142+
margin-bottom: 30px;
143+
}
144+
145+
/* Exercise solutions / spoilers */
146+
details > div {
147+
margin-top: 10px;
148+
margin-left: 30px;
149+
padding: 10px 20px;
150+
border-radius: 10px;
151+
background-color: #fcfbf0;
152+
}
153+
129154
/* VVVV GENERATED BY PANDOC BELOW VVV */
130155

131156
code {

Physics/Instruktioner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
# Pandoc
1515

16-
Komilera med ` pandoc FILNAMN.lhs -f markdown+lhs -t html -o FILNAMN.html -s --mathjax`.
16+
Komilera med `pandoc FILNAMN.lhs -f markdown+lhs -t html -o FILNAMN.html -s --mathjax`.
1717

1818
# Python
1919

0 commit comments

Comments
 (0)