Skip to content

Commit 18fd5e5

Browse files
authored
Merge branch 'master' into services-for-courses
2 parents 5c8dfe2 + cbd7585 commit 18fd5e5

Some content is hidden

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

75 files changed

+1280
-825
lines changed

.gitignore

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,3 @@ site/
66
.DS_Store
77
.idea/
88
__pycache__/
9-
10-
# These are generated by catalog-hook and only
11-
# written to the filesystem when MKDOCS_ENV=test:
12-
docs/apps/index.md
13-
docs/apps/by_discipline.md
14-
docs/apps/by_system.md
15-
16-

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ script:
3737
# Use long slurm flags
3838
- bash tests/check_long_slurm_flags.sh
3939
# There should be no FIXME entires present
40-
- bash tests/check_fixme.sh
40+
# (moved to MkDocs hook) - bash tests/check_fixme.sh
4141
# Test that no files are masked by folder/index.md
4242
- bash tests/check_masked.sh
4343
# Test that all apps have an entry for license
44-
- bash tests/check_licenses.sh
45-
44+
# (moved to MkDocs hook) - bash tests/check_licenses.sh

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"focus": false,
9797
"panel": "dedicated",
9898
},
99-
"command": ". ${userHome}/miniconda3/etc/profile.d/conda.sh && conda run --name docs-env --cwd ${workspaceFolder} bash ${workspaceFolder}/tests/run_tests.sh",
99+
"command": ". ${userHome}/miniconda3/etc/profile.d/conda.sh && conda run --name docs-env --cwd ${workspaceFolder} MKDOCS_ENV=test bash ${workspaceFolder}/tests/run_tests.sh",
100100
"windows": {
101101
"command": "Write-Host \"The Test task is not configured for running on Windows.\"",
102102
},

FAQ.md

Lines changed: 85 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ The [contributing guide](CONTRIBUTING.md) outlines the basic steps of starting c
2323
- [How do I add definitions to the glossary / display definitions as tooltips?](#how-do-i-add-definitions-to-the-glossary--display-definitions-as-tooltips)
2424
- [How do I use the announcement bar?](#how-do-i-use-the-announcement-bar)
2525
- [How do I include a new software page on the "Applications" index pages](#how-do-i-add-a-new-applications-page)
26-
- [How do I add a license tag to an application page?](#how-do-I-add-a-license-tag-to-an-application-page)
27-
- [How do I tag an application as available under a web interface?](#how-do-i-tag-an-application-as-available-under-a-web-interface)
26+
- [How do I add a license tag to an application page?](#how-do-I-add-a-license-tag-to-an-application-page)
27+
- [How do I tag an application as available under a web interface?](#how-do-i-tag-an-application-as-available-under-a-web-interface)
28+
- [How do I add scientific disciplines to an application page?](#how-do-i-add-scientific-disciplines-to-an-application-page)
29+
- [What if there is no application page, but the application still needs to be listed on the index pages?](#what-if-there-is-no-application-page-but-the-application-still-needs-to-be-listed-on-the-index-pages)
2830
- [How do I make footnotes?](#how-do-i-make-footnotes)
2931
- [How do I improve search results?](#how-do-i-improve-search-results)
3032
- [How do I redirect incoming links](#how-do-i-redirect-incoming-links)
@@ -229,10 +231,10 @@ mkdocs serve --dirtyreload
229231
You can also run the tests locally with
230232

231233
```bash
232-
bash tests/run_tests.sh
234+
MKDOCS_ENV=test bash tests/run_tests.sh
233235
```
234236

235-
The tests depend on the Conda environment, so remember to activate it before running them, or use `conda run -n docs-env bash tests/run_tests.sh`.
237+
The tests depend on the Conda environment, so remember to activate it before running them, or use `conda run -n docs-env MKDOCS_ENV=test bash tests/run_tests.sh`.
236238

237239
#### Scripts
238240

@@ -356,7 +358,7 @@ Documentation for _Material for MkDocs_ has a [search feature](https://squidfunk
356358
## How do I add a new "Applications" page?
357359

358360
To include a new software page on the "Applications" index pages
359-
(`apps/index.md`, `apps/by_system.md`, `apps/by_license.md`, `apps/by_discipline`),
361+
(`apps/index.md`, `apps/by_discipline`, `apps/by_availability.md`, `apps/by_license.md`),
360362
you must add a YAML front matter at the beginning of the file (before the page title)
361363
with appropriate metadata. The frontmatter should look like this:
362364

@@ -405,18 +407,47 @@ catalog:
405407
---
406408
```
407409

410+
A missing name causes even preview builds to stop immediately with an error:
411+
412+
```text
413+
ERROR - Error reading page 'apps/doom.md':
414+
ERROR - Every application in the Software Catalog must have a name
415+
```
416+
417+
Other missing values in the front matter will generate a warning:
418+
419+
```text
420+
WARNING - catalog-hook: Doc file 'apps/doom.md' is for an application, but the YAML front matter does not ...
421+
```
422+
423+
> [!WARNING]
424+
> Warnings are **not** allowed in the test automation, so while the site can be built with warnings for a preview (local or Rahti), all of the fields must be defined for a branch to be merged into the master branch.
425+
426+
To include an app page without warnings for missing fields, the app may be marked as "unchecked".
427+
by defining a boolean-valued key `unchecked: true` inside `catalog:`.:
428+
429+
```yaml
430+
---
431+
catalog:
432+
name: A name is still required
433+
# ...
434+
unchecked: true
435+
---
436+
```
437+
408438
> [!IMPORTANT]
409-
> **Do not** edit the index pages by hand, as they are populated automatically by a script using the front matter data when the website is built.
439+
> **Do not** attempt to _include apps_ on `apps/index.md`, `apps/by_discipline`, `apps/by_availability.md`, `apps/by_license.md` pages by hand, as the indices are populated automatically by a script using the front matter data when the website is built.
410440

411441
See also:
412442

413443
* [How do I add a license tag to an application page?](#how-do-i-add-a-license-tag-to-an-application-page)
414444
* [How do I tag an application as available under a web interface?](#how-do-i-tag-an-application-as-available-under-a-web-interface)
445+
* [The 'catalog-hook' configuration file](hooks/catalog/config.yml)
415446

416-
## How do I add a license tag to an application page?
447+
### How do I add a license tag to an application page?
417448

418449
The license tag is added inside the YAML front matter. Temporarily, the license type should be placed as a
419-
list item under `tags:` _and_ as a string in `license_type:`:
450+
single list item under `tags:` _and_ as a string in `license_type:`:
420451

421452
```yaml
422453
---
@@ -432,9 +463,10 @@ catalog:
432463
where `<license>` is one of the predefined license categories: `Academic`, `Free`, `Non-commercial` or
433464
`Other`; case sensitive, without the angle brackets.
434465

435-
The application will then be included on the Applications by license page automatically.
466+
The application will then be included under the appropriate license category on the
467+
[Applications by license page](https://docs.csc.fi/apps/by_license) automatically.
436468

437-
## How do I tag an application as available under a web interface?
469+
### How do I tag an application as available under a web interface?
438470

439471
In the YAML front matter. The following would, for example, tag the application as available on
440472
Puhti, Mahti _and_ Puhti web interface.
@@ -452,6 +484,49 @@ catalog:
452484
---
453485
```
454486

487+
### How do I add scientific disciplines to an application page?
488+
489+
Similarly to license and availability above. The disciplines are to be listed under `disciplines:`:
490+
491+
```yaml
492+
---
493+
catalog:
494+
# ...
495+
disciplines:
496+
- Biosciences
497+
- Chemistry
498+
# - ...
499+
# ...
500+
---
501+
```
502+
503+
The application will then be listed under each of those disciplines on the
504+
[Applications by discipline page](https://docs.csc.fi/apps/by_discipline) automatically.
505+
506+
See [the 'catalog-hook' configuration file](hooks/catalog/config.yml) for a list of predefined
507+
disciplines.
508+
509+
### What if there is no application page, but the application still needs to be listed on the index pages?
510+
511+
There is an appendix for including such applications. It resides in [the 'catalog-hook' configuration file](hooks/catalog/config.yml). The list `appendix:` contains entries such as
512+
513+
```yaml
514+
appendix:
515+
- name: "Chipster"
516+
description: "Easy-to-use analysis platform for RNA-seq, single cell RNA-seq and other NGS data"
517+
disciplines:
518+
- "Biosciences"
519+
doc: "https://chipster.csc.fi/"
520+
- name: "MaxQuant"
521+
description: "A proteomics software for processing of Mass-spectromtery data"
522+
disciplines:
523+
- "Biosciences"
524+
doc: "support/tutorials/MaxQuant-tutorial.md"
525+
# - ...
526+
```
527+
528+
where `doc:` can point either to an external page or a `.md` source file on Docs. For the other fields, see the instructions for application pages above. The fields `name:`, `description:`, `disciplines:` and `doc:` are all required and no other fields are allowed.
529+
455530
## How do I add footnotes?
456531

457532
Usage of the footnotes feature is described

csc-overrides/apps-index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{% extends "main.html" %}
2+
{% block content %}
3+
{% block breadcrumbs %}
4+
{{ super() }}
5+
{% endblock breadcrumbs %}
6+
{% include "partials/tags.html" %}
7+
{{ page.content }}
8+
{% from "partials/apps-list.html" import apps_list with context %}
9+
{{ apps_list() }}
10+
{% include "partials/source-file.html" %}
11+
{% include "partials/feedback.html" %}
12+
{% endblock content %}
Lines changed: 30 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,49 @@
1-
.md-typeset .app-heading-row {
1+
.md-typeset .catalog-toc {
2+
max-width: 80%;
3+
}
4+
5+
.md-typeset .catalog-toc ul {
26
display: flex;
37
justify-content: start;
4-
align-content: center;
5-
margin: 0 0 1.25em;
8+
flex-wrap: wrap;
9+
margin-left: 0;
10+
gap: .25em;
611
}
712

8-
.md-typeset .app-heading {
9-
margin: unset;
13+
.md-typeset .catalog-toc ul li {
14+
list-style-type: none;
15+
margin: 0;
1016
}
1117

12-
.md-typeset .app-description {
13-
font-weight: 300;
14-
text-align: center;
15-
color: var(--c-tertiary-800);
16-
margin-left: .5ch;
18+
.md-typeset .catalog-toc ul li a:hover {
19+
background-color: unset;
1720
}
1821

19-
.md-typeset .app-heading-row .app-description {
20-
font-size: 1.50em;
22+
.md-typeset .catalog-toc ul li a[href^="#mahti"] .md-tag {
23+
color: var(--c-accent-800);
24+
border-color: var(--c-accent-800);
2125
}
2226

23-
.md-typeset .app-link {
24-
margin-right: 1em;
27+
.md-typeset .catalog-toc ul li a[href^="#mahti"] .md-tag:is(:active, :hover) {
28+
background-color: var(--c-accent-100);
2529
}
2630

27-
.md-typeset nav .app-tags {
28-
margin: 0 0 .75em;
31+
.md-typeset .catalog-toc ul li a[href^="#puhti"] .md-tag {
32+
color: var(--c-info-800);
33+
border-color: var(--c-info-800);
2934
}
3035

31-
.md-typeset c-accordion-item {
32-
margin-bottom: 1em;
36+
.md-typeset .catalog-toc ul li a[href^="#puhti"] .md-tag:is(:active, :hover) {
37+
background-color: var(--c-info-100);
3338
}
3439

35-
.md-typeset .alpha-toc {
36-
max-width: 80%;
40+
.md-typeset .catalog-toc ul li a[href^="#lumi"] .md-tag {
41+
color: var(--c-black);
42+
border-color: var(--c-black);
3743
}
3844

39-
.md-typeset .alpha-toc ul {
40-
display: flex;
41-
justify-content: start;
42-
flex-wrap: wrap;
43-
margin-left: 0;
45+
.md-typeset .catalog-toc ul li a[href^="#lumi"] .md-tag:is(:active, :hover) {
46+
/* background-color: hsl(from black h s calc(l + 96)); */
47+
background-color: var(--c-black);
48+
color: var(--c-white);
4449
}
45-
46-
.md-typeset .alpha-toc ul li {
47-
list-style-type: none;
48-
margin: 0 .25em;
49-
text-align: center;
50-
}
51-
52-
.md-typeset .alpha-toc a {
53-
padding: .125em .5em;
54-
border-radius: 25%;
55-
font-size: large;
56-
font-weight: var(--csc-font-weight--bold);
57-
}
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
.md-typeset .md-tag {
2-
border: 1px solid var(--md-primary-fg-color);
3-
color: var(--md-primary-fg-color);
4-
background-color: transparent;
2+
border: 1px solid var(--c-link-700);
3+
color: var(--c-link-700);
4+
background-color: var(--c-white);
55
border-radius: 15px;
66
font-weight: 400;
77
text-decoration: none;
8+
transition:
9+
color 125ms,
10+
background-color 125ms;
11+
}
12+
13+
.md-typeset .md-tag:is(:active, :hover) {
14+
background-color: var(--c-link-100);
815
}
916

1017
.md-typeset :target>.md-tag {
11-
color: var(--md-primary-bg-color);
12-
background-color: var(--md-primary-fg-color);
18+
color: var(--c-white);
19+
background-color: var(--c-link-700);
1320
}
1421

15-
.md-typeset .md-tag:is(:active, :hover) {
16-
background-color: var(--md-accent-bg-color);
22+
.md-typeset :target>.md-tag:is(:active, :hover) {
23+
background-color: var(--c-link-500);
1724
}

csc-overrides/partials/announcement.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
a comment (#) to a statement (%)) a line below. Only a
55
single line can be uncommented at a time.
66
#}
7-
{# import ".icons/material/coffee.svg" as icon #}
7+
{% import ".icons/material/coffee.svg" as icon %}
88
{# import ".icons/material/chat.svg" as icon #}
99
{# import ".icons/material/information.svg" as icon #}
1010
{# import ".icons/material/alert.svg" as icon #}
@@ -15,11 +15,11 @@
1515
{# import ".icons/material/dna.svg" as icon #}
1616
{# import ".icons/material/atom.svg" as icon #}
1717
{# import ".icons/material/telescope.svg" as icon #}
18-
{% import ".icons/material/fire.svg" as icon %}
18+
{# import ".icons/material/fire.svg" as icon #}
1919
<div class="announcement-icon">{{ icon }}</div>
2020
{# Put the announcement, in HTML, right under this comment! #}
2121
<p>
22-
Call for Roihu pilot projects is now open! <a href="https://research.csc.fi/2025/10/07/roihu-pilot/" target="_blank">Read the article to learn more & apply for early access</a>.
22+
Welcome to our weekly research support coffee hour on Zoom! <a href="https://csc.fi/en/training-calendar/csc-research-support-coffee-every-wednesday-at-1400-finnish-time-2-2/" target="_blank">Click here for more information.</a>
2323
</p>
2424
{# ...and right above _this_ comment. #}
2525
<div class="announcement-icon announcement-icon-end">{{ icon }}</div>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{%- macro link(app) -%}
2+
{% set external = app.page is none %}
3+
{% set internal = not external and not app.is_appendix_app %}
4+
{% set href = app.url %}
5+
{%- set props -%}
6+
href="{{ href }}"{% if external %} target="_blank"{% endif %}
7+
{%- endset -%}
8+
{% if external %}
9+
{% set icon = ".icons/material/open-in-new.svg" %}
10+
{% elif not internal %}
11+
{% set icon = ".icons/material/arrow-right-bold-box-outline.svg" %}
12+
{% endif %}
13+
{%- set text -%}
14+
{{ app.name | string }}{%- if external or not internal -%}&nbsp;<span class="twemoji">{%- include icon -%}</span>{%- endif -%}
15+
{%- endset -%}
16+
<a {{ props }}>{{ text }}</a>
17+
{%- endmacro -%}
18+
19+
{%- macro description(app) -%}
20+
{%- if app.description -%}
21+
&nbsp;&mdash;&nbsp;{{ app.description }}
22+
{%- elif app.unchecked -%}
23+
*
24+
{%- endif -%}
25+
{%- endmacro -%}
26+
27+
{%- macro app_item(app) -%}
28+
<li>{{ link(app) }}{{ description(app) }}</li>
29+
{%- endmacro -%}

0 commit comments

Comments
 (0)