Skip to content

Commit 9bb8559

Browse files
committed
restructure to multiple courses
1 parent a27be48 commit 9bb8559

Some content is hidden

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

83 files changed

+794
-211
lines changed

.github/workflows/deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Install quarto
3535
uses: quarto-dev/quarto-actions/setup@v2
3636
with:
37-
version: "1.2.313"
37+
version: "1.2.475" # Note cant bump passed 1.2 until quarto_cli #3973 is fixed.
3838

3939
- name: print quarto version
4040
run: |

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# OpenSourceCourse
22

3-
This is the website for OpenSourceCourse, a short course designed to help engineers and scientists contribute to
4-
the open-source scientific python ecosystem.
3+
This is the website for OpenSourceCourse, a collection of educational material designed to help engineers and scientists contribute to the open-source scientific python ecosystem.
54

65
The course website is found [here](https://opensourcecourse.dev/).
76

_extensions/mcanouil/iconify/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Mickaël Canouil
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: Iconify support
2+
author: Mickaël Canouil
3+
version: 1.0.8
4+
quarto-required: ">=1.2.280"
5+
contributes:
6+
shortcodes:
7+
- iconify.lua

_extensions/mcanouil/iconify/iconify-icon.min.js

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
--[[
2+
# MIT License
3+
#
4+
# Copyright (c) Mickaël Canouil
5+
#
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to deal
8+
# in the Software without restriction, including without limitation the rights
9+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
# copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
13+
# The above copyright notice and this permission notice shall be included in all
14+
# copies or substantial portions of the Software.
15+
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
# SOFTWARE.
23+
]]
24+
25+
local function ensure_html_deps()
26+
quarto.doc.add_html_dependency({
27+
name = 'iconify',
28+
version = '1.0.8',
29+
scripts = {"iconify-icon.min.js"}
30+
})
31+
end
32+
33+
local function is_empty(s)
34+
return s == nil or s == ''
35+
end
36+
37+
local function is_valid_size(size)
38+
if is_empty(size) then
39+
return ''
40+
end
41+
local size_table = {
42+
["tiny"] = "0.5em",
43+
["scriptsize"] = "0.7em",
44+
["footnotesize"] = "0.8em",
45+
["small"] = "0.9em",
46+
["normalsize"] = "1em",
47+
["large"] = "1.2em",
48+
["Large"] = "1.5em",
49+
["LARGE"] = "1.75em",
50+
["huge"] = "2em",
51+
["Huge"] = "2.5em",
52+
["1x"] = "1em",
53+
["2x"] = "2em",
54+
["3x"] = "3em",
55+
["4x"] = "4em",
56+
["5x"] = "5em",
57+
["6x"] = "6em",
58+
["7x"] = "7em",
59+
["8x"] = "8em",
60+
["9x"] = "9em",
61+
["10x"] = "10em",
62+
["2xs"] = "0.625em",
63+
["xs"] = "0.75em",
64+
["sm"] = "0.875em",
65+
["lg"] = "1.25em",
66+
["xl"] = "1.5em",
67+
["2xl"] = "2em"
68+
}
69+
for key, value in pairs(size_table) do
70+
if key == size then
71+
return 'font-size: ' .. value .. ';'
72+
end
73+
end
74+
return 'font-size: ' .. size .. ';'
75+
end
76+
77+
return {
78+
["iconify"] = function(args, kwargs)
79+
-- detect html (excluding epub which won't handle fa)
80+
if quarto.doc.is_format("html:js") then
81+
ensure_html_deps()
82+
local set = "fluent-emoji"
83+
local icon = pandoc.utils.stringify(args[1])
84+
if #args > 1 then
85+
set = icon
86+
icon = pandoc.utils.stringify(args[2])
87+
end
88+
89+
local attributes = ' icon="' .. set .. ':' .. icon .. '"'
90+
local label = '"Icon ' .. icon .. ' from ' .. set .. ' Iconify.design set."'
91+
92+
local size = is_valid_size(pandoc.utils.stringify(kwargs["size"]))
93+
if not is_empty(size) then
94+
attributes = attributes .. ' style="' .. size .. '"'
95+
end
96+
97+
local aria_label = pandoc.utils.stringify(kwargs["label"])
98+
if is_empty(aria_label) then
99+
aria_label = ' aria-label="' .. label .. '"'
100+
else
101+
attributes = attributes .. aria_label
102+
end
103+
local title = pandoc.utils.stringify(kwargs["title"])
104+
if is_empty(title) then
105+
title = ' title="' .. label .. '"'
106+
else
107+
attributes = attributes .. title
108+
end
109+
-- local style = pandoc.utils.stringify(kwargs["style"])
110+
-- if not is_empty(style) then
111+
-- local attributes = attributes .. ' style="' .. style .. '"'
112+
-- end
113+
local width = pandoc.utils.stringify(kwargs["width"])
114+
if not is_empty(width) and is_empty(size) then
115+
attributes = attributes .. ' width="' .. width .. '"'
116+
end
117+
local height = pandoc.utils.stringify(kwargs["height"])
118+
if not is_empty(height) and is_empty(size) then
119+
attributes = attributes .. ' height="' .. height .. '"'
120+
end
121+
local flip = pandoc.utils.stringify(kwargs["flip"])
122+
if not is_empty(flip) then
123+
attributes = attributes .. ' flip="' .. flip.. '"'
124+
end
125+
local rotate = pandoc.utils.stringify(kwargs["rotate"])
126+
if not is_empty(rotate) then
127+
attributes = attributes .. ' rotate="' .. rotate .. '"'
128+
end
129+
130+
return pandoc.RawInline(
131+
'html',
132+
'<iconify-icon inline' .. attributes .. '></iconify-icon>'
133+
)
134+
else
135+
return pandoc.Null()
136+
end
137+
end
138+
}

0 commit comments

Comments
 (0)