Skip to content

Commit da913b1

Browse files
committed
eerste commit - basis structuur
1 parent 8e7f45f commit da913b1

20 files changed

+786
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/site

CNAME

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
osmws.osgeo.n

README.md

+59-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,59 @@
1-
# osmws
2-
OpenStreetMap Workshop - FOSS4GNL 2023
1+
# osmws.osgeo.nl website
2+
3+
The files and dirs below are content for an OpenStreetMap Workshop.
4+
5+
This workshop was initially provided at the [FOSS4GNL 2023](https://foss4g.nl) but
6+
is also intended to be reused and expanded for other/future events.
7+
8+
The documentation is powered by [MkDocs](https://www.mkdocs.org)
9+
which facilitates easy management
10+
of content and publishing. Content is written in Markdown.
11+
12+
Using [GitHub Workflows](.github/workflows/deploy.docs.yml) the website is automatically rebuilt and deployed
13+
(to the `gh-pages` branch on GitHub) on commit/pushes to the `main` branch.
14+
The site is hosted as a static html website at [osmws.osgeo.nl](https://osmws.osgeo.nl)
15+
on GitHub using GitHub Pages.
16+
17+
## Build/test locally
18+
19+
```bash
20+
# build a virtual Python environment in isolation
21+
# For example, or use pyenv.
22+
python3 -m venv .
23+
. bin/activate
24+
25+
# fork or clone from GitHub
26+
git clone https://github.com/osgeonl/osmws.osgeo.nl.git
27+
cd docs
28+
29+
# install required dependencies
30+
31+
# Optional: install lxml quickly using package
32+
apt-get install -y python3-lxml
33+
34+
# install Python libs
35+
pip install -r requirements.txt
36+
37+
# build the website
38+
mkdocs build
39+
40+
# serve locally
41+
mkdocs serve # website is made available on http://localhost:8000
42+
43+
# or locally on specific port
44+
mkdocs serve -a localhost:8001
45+
46+
```
47+
48+
## Deploying to live site
49+
50+
Website updates are automatically published
51+
via [GitHub Actions](.github/workflows/deploy.docs.yml).
52+
53+
Or to publish manually, but this is in general not needed:
54+
55+
```bash
56+
# NOTE: you require access privileges to the GitHub repository
57+
# to publish live updates
58+
mkdocs gh-deploy -m 'add new page on topic x'
59+
```

docs/README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Guidelines
2+
3+
## Video
4+
5+
We use https://pypi.org/project/mkdocs-video/. A YoutTube video can be
6+
embedded as follows;
7+
8+
`![type:video](https://www.youtube.com/embed/S_Sp7dRDbW0)`
9+
10+
## Gallery
11+
12+
Uses GLightbox https://blueswen.github.io/mkdocs-glightbox/.
13+
14+
After install need to copy JS and CSS:
15+
16+
```
17+
cp (path-to)/site-packages/mkdocs_glightbox/glightbox/glightbox.min.js src/assets/javascripts/
18+
cp (path-to)/site-packages/mkdocs_glightbox/glightbox/glightbox.min.css src/assets/stylesheets/
19+
20+
```

docs/mkdocs.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
site_name: OSM Workshop
2+
site_description: "Deze site bevat materiaal voor een OpenStreetMap Workshop"
3+
site_author: Just van den Broecke Casper Kersten
4+
copyright: "© 2023 osgeo.nl"
5+
site_url: https://osmws.osgeo.nl
6+
repo_url: https://github.com/osgeonl/osmws.osgeo.nl
7+
edit_uri: '/docs/src'
8+
docs_dir: src
9+
nav:
10+
- Thuis: index.md
11+
# - Intro:
12+
# - Specification: design/spec.md
13+
# - Architecture: design/architecture.md
14+
# - Data: design/data.md
15+
# - Deployment: design/gitops.md
16+
17+
use_directory_urls: true
18+
19+
theme:
20+
name: material
21+
palette:
22+
# See https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#color-scheme
23+
# Default is indigo (blue)
24+
scheme: default
25+
primary: green
26+
features:
27+
- navigation.sections
28+
favicon: assets/favicon.ico
29+
logo: assets/images/osmnl-logo.png
30+
31+
plugins:
32+
- search
33+
- mkdocs-video
34+
- glightbox:
35+
touchNavigation: true
36+
loop: false
37+
effect: zoom
38+
slide_effect: slide
39+
width: 100%
40+
height: auto
41+
zoomable: true
42+
draggable: true
43+
skip_classes:
44+
- skip-lightbox
45+
auto_caption: false
46+
caption_position: bottom
47+
48+
markdown_extensions:
49+
- meta # option to add some meta tags on top, title, author, date, etc
50+
- admonition # adds the note, question, tip boxes, eg: !!! tip "my tip"
51+
- pymdownx.details # advanced collapsible panels
52+
- pymdownx.superfences # advanced features; such as line number, flow chart, python shell
53+
- footnotes # notes bottom of page
54+
- attr_list # used to size images
55+
- md_in_html # used to size images
56+
57+
extra_css:
58+
# light and dark variations from material.io
59+
# https://material.io/resources/color/#!/?view.left=0&view.right=1
60+
- assets/stylesheets/termynal.css
61+
- assets/stylesheets/custom.css
62+
63+
extra_javascript:
64+
- assets/javascripts/termynal.js
65+
- assets/javascripts/custom.js

docs/requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mkdocs
2+
mkdocs-material
3+
mkdocs-video
4+
mkdocs-glightbox

docs/src/CNAME

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
map5topo.nl

docs/src/assets/favicon.ico

14.7 KB
Binary file not shown.

docs/src/assets/images/osmnl-logo.png

63.5 KB
Loading
445 KB
Loading

docs/src/assets/javascripts/custom.js

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
document.querySelectorAll(".use-termynal").forEach(node => {
2+
node.style.display = "block";
3+
new Termynal(node, {
4+
lineDelay: 500
5+
});
6+
});
7+
const progressLiteralStart = "---> 100%";
8+
const promptLiteralStart = "$ ";
9+
const customPromptLiteralStart = "# ";
10+
const termynalActivateClass = "termy";
11+
let termynals = [];
12+
13+
function createTermynals() {
14+
document
15+
.querySelectorAll(`.${termynalActivateClass} .highlight`)
16+
.forEach(node => {
17+
const text = node.textContent;
18+
const lines = text.split("\n");
19+
const useLines = [];
20+
let buffer = [];
21+
function saveBuffer() {
22+
if (buffer.length) {
23+
let isBlankSpace = true;
24+
buffer.forEach(line => {
25+
if (line) {
26+
isBlankSpace = false;
27+
}
28+
});
29+
dataValue = {};
30+
if (isBlankSpace) {
31+
dataValue["delay"] = 0;
32+
}
33+
if (buffer[buffer.length - 1] === "") {
34+
// A last single <br> won't have effect
35+
// so put an additional one
36+
buffer.push("");
37+
}
38+
const bufferValue = buffer.join("<br>");
39+
dataValue["value"] = bufferValue;
40+
useLines.push(dataValue);
41+
buffer = [];
42+
}
43+
}
44+
for (let line of lines) {
45+
if (line === progressLiteralStart) {
46+
saveBuffer();
47+
useLines.push({
48+
type: "progress"
49+
});
50+
} else if (line.startsWith(promptLiteralStart)) {
51+
saveBuffer();
52+
const value = line.replace(promptLiteralStart, "").trimEnd();
53+
useLines.push({
54+
type: "input",
55+
value: value
56+
});
57+
} else if (line.startsWith("// ")) {
58+
saveBuffer();
59+
const value = "💬 " + line.replace("// ", "").trimEnd();
60+
useLines.push({
61+
value: value,
62+
class: "termynal-comment",
63+
delay: 0
64+
});
65+
} else if (line.startsWith(customPromptLiteralStart)) {
66+
saveBuffer();
67+
const promptStart = line.indexOf(promptLiteralStart);
68+
if (promptStart === -1) {
69+
console.error("Custom prompt found but no end delimiter", line)
70+
}
71+
const prompt = line.slice(0, promptStart).replace(customPromptLiteralStart, "")
72+
let value = line.slice(promptStart + promptLiteralStart.length);
73+
useLines.push({
74+
type: "input",
75+
value: value,
76+
prompt: prompt
77+
});
78+
} else {
79+
buffer.push(line);
80+
}
81+
}
82+
saveBuffer();
83+
const div = document.createElement("div");
84+
node.replaceWith(div);
85+
const termynal = new Termynal(div, {
86+
lineData: useLines,
87+
noInit: true,
88+
lineDelay: 500
89+
});
90+
termynals.push(termynal);
91+
});
92+
}
93+
94+
function loadVisibleTermynals() {
95+
termynals = termynals.filter(termynal => {
96+
if (termynal.container.getBoundingClientRect().top - innerHeight <= 0) {
97+
termynal.init();
98+
return false;
99+
}
100+
return true;
101+
});
102+
}
103+
window.addEventListener("scroll", loadVisibleTermynals);
104+
createTermynals();
105+
loadVisibleTermynals();

docs/src/assets/javascripts/glightbox.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)