Skip to content

Commit f9ac0d8

Browse files
authored
Merge pull request #7 from mapswipe/feat/theme
Restructures the docs site
2 parents 6e8730d + 413625c commit f9ac0d8

99 files changed

Lines changed: 19349 additions & 1404 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
.env
33
_site
4+
.jekyll-metadata

.pre-commit-config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ repos:
44
hooks:
55
- id: lychee
66
files: \.md$
7-
args: ["--no-progress", "--root-dir=.", "."]
7+
args:
8+
- "--no-progress"
9+
- "--root-dir=."
10+
- "--exclude-path=_includes"
11+
- "--exclude-path=_layouts"
12+
- "--exclude-path=_site"
13+
- "."
814
pass_filenames: false
915

1016
- repo: https://github.com/crate-ci/typos

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ group :jekyll_plugins do
88
gem "github-pages"
99
gem "jekyll-timeago"
1010
gem "jekyll-gfm-admonitions"
11+
gem "jekyll-sitemap"
12+
gem "jekyll-commonmark-ghpages"
13+
gem "jekyll-toc"
1114
end

Gemfile.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ GEM
224224
mini_i18n (>= 0.8.0)
225225
jekyll-titles-from-headings (0.5.3)
226226
jekyll (>= 3.3, < 5.0)
227+
jekyll-toc (0.19.0)
228+
jekyll (>= 3.9)
229+
nokogiri (~> 1.12)
227230
jekyll-watch (2.2.1)
228231
listen (~> 3.0)
229232
jemoji (0.13.0)
@@ -313,8 +316,11 @@ PLATFORMS
313316
DEPENDENCIES
314317
github-pages
315318
jekyll (~> 3.10.0)
319+
jekyll-commonmark-ghpages
316320
jekyll-gfm-admonitions
321+
jekyll-sitemap
317322
jekyll-timeago
323+
jekyll-toc
318324

319325
BUNDLED WITH
320326
2.7.2

README.md

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,76 @@
11
# MapSwipe Docs!
2+
23
This repository contains all the documents related to MapSwipe
34

45
- [Overview](/docs/overview.md)
56
- [About Data](/docs/about_data.md)
67
- [For project managers](/docs/for_project_managers.md)
78

8-
- [Docs local development](/docs/docs_local_development.md)
9+
## Getting Started
10+
11+
```bash
12+
# Get the repository
13+
git clone https://github.com/mapswipe/mapswipe-docs
14+
15+
# Install jekyll
16+
gem install jekyll bundler --verbose
17+
18+
# Install dependencies
19+
bundle install
20+
```
21+
22+
> [!IMPORTANT]
23+
> Run this after changing the Gemfile
24+
25+
## Run Docs in Dev Mode
26+
27+
```bash
28+
bundle exec jekyll serve --livereload
29+
```
30+
31+
## Refreshing the Sample Export Data
32+
33+
The point of this workflow is to keep the example exports under
34+
`assets/docs/about_data/files/` consistent. Once exports are updated, the data
35+
can also be used to keep the description for exports up-to-date.
36+
37+
Two helper scripts under `examples/` fetch the data from the MapSwipe GraphQL backend.
38+
39+
### Fetch Project Exports
40+
41+
```bash
42+
uv run examples/fetch-project-data/run.py 2962 \
43+
--sample 10 \
44+
--out assets/docs/about_data/files/project_exports
45+
```
46+
47+
### Fetch Global Exports
48+
49+
```bash
50+
uv run examples/fetch-global-data/run.py \
51+
--sample 10 \
52+
--out assets/docs/about_data/files/global_exports
53+
```
54+
55+
### Projects Mapping
56+
57+
| Name | id | firebaseId |
58+
| --- | --- | --- |
59+
| Find Features - Find Buildings - Mozambique Floods 2026 - Chibuto (1) HOT | 2962 | 01KMMX0C9MG396SCV8W8CZ8RY3 |
60+
61+
62+
## Changing the Syntax Highlighting Theme
63+
64+
Fenced code blocks are colored by [Rouge](https://github.com/rouge-ruby/rouge),
65+
wired into CommonMark via `syntax_highlighter: rouge` in `_config.yml`. The
66+
active theme is generated to `assets/css/syntax.css`.
67+
68+
To switch themes, run the following commands:
69+
70+
```bash
71+
# List every theme Rouge ships with
72+
bundle exec rougify help style
73+
74+
# Regenerate the stylesheet
75+
bundle exec rougify style gruvbox.dark > assets/css/syntax.css
76+
```

_config.yml

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,111 @@
1-
markdown: GFM
1+
# Site metadata
2+
title: MapSwipe Docs
3+
description: Documentation for MapSwipe platform
4+
url: https://docs.mapswipe.org
25
repository: mapswipe/mapswipe-docs
36

7+
# Plugins
48
plugins:
9+
- jekyll-remote-theme
10+
- jekyll-commonmark-ghpages
511
- jekyll-gfm-admonitions
12+
- jekyll-seo-tag
13+
- jekyll-sitemap
14+
- jekyll-toc
15+
- jekyll-relative-links
16+
17+
# Rewrite Markdown links to *.md files into their rendered permalinks at build
18+
# time. Lets us author plain relative .md links (which lychee can verify on
19+
# disk) instead of hand-maintaining permalink URLs.
20+
relative_links:
21+
enabled: true
22+
collections: false
23+
24+
# Markdown processor (jekyll-commonmark-ghpages)
25+
markdown: CommonMarkGhPages
26+
commonmark:
27+
options:
28+
- SMART
29+
- UNSAFE
30+
extensions:
31+
- strikethrough
32+
- autolink
33+
- table
34+
- tagfilter
35+
- tasklist
36+
syntax_highlighter: rouge
37+
syntax_highlighter_opts:
38+
default_lang: text
39+
40+
# Theme: just-the-docs (loaded via jekyll-remote-theme)
41+
remote_theme: just-the-docs/just-the-docs
42+
color_scheme: mapswipe
43+
44+
# UI: Search
45+
search_enabled: true
46+
search:
47+
heading_level: 3
48+
previews: 2
49+
preview_words_before: 3
50+
preview_words_after: 3
51+
tokenizer_separator: /[\s\-/]+/
52+
rel_url: true
53+
button: false
54+
55+
# UI: Anchor links on headings
56+
heading_anchors: true
57+
58+
# UI: Top-right auxiliary links
59+
aux_links:
60+
Community: https://community.mapswipe.org
61+
Website: https://mapswipe.org
62+
Manager Dashboard: https://managers.mapswipe.org
63+
aux_links_new_tab: true
64+
65+
# UI: "Edit this page" footer link
66+
gh_edit_link: true
67+
gh_edit_link_text: "Edit this page"
68+
gh_edit_repository: "https://github.com/mapswipe/mapswipe-docs"
69+
gh_edit_branch: "main"
70+
gh_edit_view_mode: "edit"
71+
72+
# UI: Footer
73+
footer_content: 'Copyright &copy; MapSwipe. Distributed under the project license.'
74+
last_edit_timestamp: true
75+
76+
# UI: Back-to-top link
77+
back_to_top: true
78+
back_to_top_text: "Back to top"
79+
80+
# UI: Copy-to-clipboard button on fenced code blocks
81+
enable_copy_code_button: true
82+
83+
# UI: Mermaid diagrams in fenced ```mermaid blocks (just-the-docs theme)
84+
# Version picked from https://www.jsdelivr.com/package/npm/mermaid
85+
mermaid:
86+
version: "11.4.1"
87+
88+
# In-page Table of Contents (jekyll-toc)
89+
toc:
90+
min_level: 2
91+
max_level: 4
92+
ordered_list: false
93+
no_toc_section_class: no-toc
94+
95+
# Page defaults (Jekyll core)
96+
defaults:
97+
- scope:
98+
path: ""
99+
values:
100+
layout: page
101+
toc: true
102+
103+
# Build exclusions (Jekyll core)
104+
exclude:
105+
- Gemfile
106+
- Gemfile.lock
107+
- README.md
108+
- pre-push.sh
109+
- .pre-commit-config.yaml
110+
- typos.toml
111+
- .lycheeignore

_includes/head_custom.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<link rel="preconnect" href="https://fonts.googleapis.com">
2+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=DM+Sans:wght@400;500;600;700&family=Patrick+Hand&display=swap">
4+
5+
<!-- Rouge syntax theme. -->
6+
<link rel="stylesheet" href="{{ '/assets/css/syntax.css' | relative_url }}">

_includes/mermaid_config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
theme: "neutral",
3+
look: "handDrawn",
4+
themeVariables: {
5+
fontSize: "18px",
6+
fontFamily: "'Patrick Hand', 'Caveat', cursive"
7+
},
8+
flowchart: {
9+
nodeSpacing: 160,
10+
rankSpacing: 80,
11+
padding: 20
12+
},
13+
state: {
14+
padding: 30,
15+
titleTopMargin: 30,
16+
dividerMargin: 20,
17+
nodeSpacing: 160,
18+
rankSpacing: 80
19+
}
20+
}

_includes/toc_heading_custom.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h2 class="text-delta">Continue reading</h2>

_layouts/page.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
layout: default
3+
---
4+
{%- assign anchored = content | inject_anchors -%}
5+
{%- if page.toc and content contains '<h2' and anchored contains '</h1>' -%}
6+
{%- assign parts = anchored | split: '</h1>' -%}
7+
{{ parts[0] }}</h1>
8+
<nav class="page-toc" aria-label="Table of contents">
9+
<p class="page-toc-title">Table of contents</p>
10+
{{ content | toc_only }}
11+
</nav>
12+
{{ parts | slice: 1, 999 | join: '</h1>' }}
13+
{%- elsif page.toc and content contains '<h2' -%}
14+
<nav class="page-toc" aria-label="Table of contents">
15+
<p class="page-toc-title">Table of contents</p>
16+
{{ content | toc_only }}
17+
</nav>
18+
{{ anchored }}
19+
{%- else -%}
20+
{{ anchored }}
21+
{%- endif -%}

0 commit comments

Comments
 (0)