Skip to content

Commit c30f9fb

Browse files
feat: prod-style module-grid landing pages + tutorial cards + working TOC anchors + YT iframe width
Five threads bundled because they all surfaced while making the /documentation and /documentation/userguide pages look like reactome.org/userguide on prod: 1. Replace the post-marked `__[Label]` heading-with-icon pattern on /documentation/index.mdx and /documentation/userguide.mdx with inline `<div class="module-grid">` of `<a class="module-card">` tiles. Eight subpage cards on userguide (Pathway Browser / Details Panel / Searching / Analysis / Diseases / Cytomics / Review Status / ReactomeFIViz), three on /documentation (For Users / For Developers / Citing us). Each card has a Material Symbols icon, label, and optional description; hover lifts and highlights the border. Matches prod's icon-card grid. 2. Tutorial cards (Quick tour / Exploring Pathways / Analysis Tools) on /documentation/userguide use a `.tutorial-card` variant that puts the actual training_N.png screenshot at the top of the card instead of an icon glyph -- closer to prod's layout. Thumbnail capped at 140px wide to stay compact. 3. Extends addAnchorIds.ts: previously it only added id="X" to headings whose first child was an anchor link to "#X". Now it also adds id="X" to plain headings (no inner anchor) whose slugified text (spaces -> underscores) matches a #fragment used anywhere on the page -- fixes the broken TOC jumps on /documentation/userguide/reactome-fiviz (e.g. #Probabilistic_Graphical_Model_based_Pathway_Analysis). 4. Embedded YouTube/Vimeo iframes default to ~300x150 since the markdown doesn't set width/height. Make them fill the content column with a 16:9 aspect-ratio in page.component.scss. 5. The new .module-grid gets bigger min-column-width, more gap, a subtle drop shadow + transform on hover so the cards feel less cramped (adam's feedback). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4e7d350 commit c30f9fb

5 files changed

Lines changed: 240 additions & 72 deletions

File tree

projects/website-angular/content/documentation/index.mdx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@ title: "Documentation"
33
category: "documentation"
44
---
55

6-
[ ![](/uploads/documentation/for_users_110x110.png) ](</documentation/userguide>)
7-
8-
Take the most out of our tools and data analysis. All you need is our User Guide.
9-
10-
#### [__For Users](</documentation/userguide>)
11-
12-
[ ![](/uploads/documentation/for_developers_110x110.png) ](</documentation/dev>)
13-
14-
Are you interested in programatically querying our data or integrating our Widgets ?
15-
16-
#### [__For Developers](</documentation/dev>)
17-
18-
[ ![](/uploads/documentation/citing_us_110x110.png) ](</documentation/cite>)
19-
20-
Have our data been useful in your research or experiment ? Please, remember to cite us!
21-
22-
#### [__Citing us](</documentation/cite>)
6+
<div class="module-grid">
7+
<a class="module-card" href="/documentation/userguide">
8+
<span class="material-symbols-rounded module-icon">help</span>
9+
<span class="module-label">For Users</span>
10+
<span class="module-desc">Take the most out of our tools and data analysis. All you need is our User Guide.</span>
11+
</a>
12+
<a class="module-card" href="/documentation/dev">
13+
<span class="material-symbols-rounded module-icon">code</span>
14+
<span class="module-label">For Developers</span>
15+
<span class="module-desc">Are you interested in programatically querying our data or integrating our Widgets?</span>
16+
</a>
17+
<a class="module-card" href="/documentation/cite">
18+
<span class="material-symbols-rounded module-icon">format_quote</span>
19+
<span class="module-label">Citing us</span>
20+
<span class="module-desc">Have our data been useful in your research or experiment? Please, remember to cite us!</span>
21+
</a>
22+
</div>
2323

2424
The online [User’s Guide](</documentation/userguide>) begins with entry-level information that describes what our resource contains and how its pathways are organized. The guide leads users through the process of browsing Reactome, searching for particular biological and chemical molecules or pathways of interest, interpreting experimental datasets through the website and the more specialized [ReactomeFIViz app](</documentation/userguide/reactome-fiviz>).
2525

2626
### Introduction to the Reactome Pathway Knowledgebase
2727

28-
Please visit our "Getting Started with Reactome" playlist to get an overview of Reactome!
28+
Please visit our "Getting Started with Reactome" playlist to get an overview of Reactome!
2929

3030
<iframe allowfullscreen="" frameborder="0" src="https://www.youtube.com/embed/videoseries?si=ZgK9G3Ws-Zxin16h&amp;list=PLLc8-qElSrCxhMsCVjYIO8OmO-Im_lQ6D"></iframe>
3131

Lines changed: 55 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,69 @@
11
---
2-
title: Pathway Browser
2+
title: User Guide
33
category: "documentation"
44
---
55

66
### What is Reactome?
77

8-
Reactome is a curated database of pathways and reactions in human biology. Reactions can be considered as pathway ‘steps’. Reactome defines a ‘reaction’ as any event in biology that changes the state of a biological molecule. Binding, activation, translocation, degradation and classical biochemical events involving a catalyst are all reactions. Information in the database is authored by expert biologists, entered and maintained by Reactome’s team of Curators and Editorial staff. Reactome content frequently cross-references other resources e.g. [NCBI](<http://www.ncbi.nlm.nih.gov>), [Ensembl](<http://www.ensembl.org>), [UniProt](<http://www.uniprot.org/>), KEGG ([Gene ](<http://www.genome.jp/kegg/genes.html>)and [Compound](<http://www.genome.jp/dbget-bin/www_bfind?compound>)), [ChEBI](<http://www.ebi.ac.uk/chebi/init.do>), [PubMed](<http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?CMD=&DB=PubMed>) and [GO](<http://www.geneontology.org>). [Inferred orthologous reactions](</documentation/inferred-events>) Inferred orthologous reactions are available for 15 non-human species including mouse, rat, chicken, puffer fish, worm, fly, yeast, rice, and Arabidopsis
8+
Reactome is a curated database of pathways and reactions in human biology. Reactions can be considered as pathway ‘steps’. Reactome defines a ‘reaction’ as any event in biology that changes the state of a biological molecule. Binding, activation, translocation, degradation and classical biochemical events involving a catalyst are all reactions. Information in the database is authored by expert biologists, entered and maintained by Reactome’s team of Curators and Editorial staff. Reactome content frequently cross-references other resources e.g. [NCBI](<http://www.ncbi.nlm.nih.gov>), [Ensembl](<http://www.ensembl.org>), [UniProt](<http://www.uniprot.org/>), KEGG ([Gene](<http://www.genome.jp/kegg/genes.html>) and [Compound](<http://www.genome.jp/dbget-bin/www_bfind?compound>)), [ChEBI](<http://www.ebi.ac.uk/chebi/init.do>), [PubMed](<http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?CMD=&DB=PubMed>) and [GO](<http://www.geneontology.org>). [Inferred orthologous reactions](</documentation/inferred-events>) are available for 15 non-human species including mouse, rat, chicken, puffer fish, worm, fly, yeast, rice, and Arabidopsis.
99

1010
### What is this guide For?
1111

1212
This guide introduces features of the Reactome website using a combination of short explanations and exercises. You will learn how to search, interpret the views, use the tools and if necessary find documentation or [help@reactome.org](<mailto:help@reactome.org>) for help.
1313

14-
[ __ ](</documentation/userguide/pathway-browser>)
15-
16-
## [ Pathway Browser ](</user/guide/pathway-browser>)
17-
18-
[ __ ](</documentation/userguide/details-panel>)
19-
20-
## [ Details Panel ](</user/guide/details-panel>)
21-
22-
[ __ ](</documentation/userguide/searching>)
23-
24-
## [ How do I search? ](</user/guide/searching>)
25-
26-
[ __ ](</documentation/userguide/analysis>)
27-
28-
## [ Analysis Tools ](</user/guide/analysis>)
29-
30-
[ __ ](</user/guide/cytomics>)
31-
32-
## [ Cytomics ](</user/guide/cytomics>)
33-
34-
[ __ ](</documentation/userguide/diseases>)
35-
36-
## [ Diseases ](</user/guide/diseases>)
37-
38-
[ __ ](</tools/reactome-fiviz>)
39-
40-
## [ ReactomeFIVIz ](</user/reactome-fiviz>)
14+
<div class="module-grid">
15+
<a class="module-card" href="/documentation/userguide/pathway-browser">
16+
<span class="material-symbols-rounded module-icon">account_tree</span>
17+
<span class="module-label">Pathway Browser</span>
18+
</a>
19+
<a class="module-card" href="/documentation/userguide/details-panel">
20+
<span class="material-symbols-rounded module-icon">laptop</span>
21+
<span class="module-label">Details Panel</span>
22+
</a>
23+
<a class="module-card" href="/documentation/userguide/searching">
24+
<span class="material-symbols-rounded module-icon">search</span>
25+
<span class="module-label">Searching</span>
26+
</a>
27+
<a class="module-card" href="/documentation/userguide/analysis">
28+
<span class="material-symbols-rounded module-icon">analytics</span>
29+
<span class="module-label">Analysis</span>
30+
</a>
31+
<a class="module-card" href="/documentation/userguide/diseases">
32+
<span class="material-symbols-rounded module-icon">stethoscope</span>
33+
<span class="module-label">Diseases</span>
34+
</a>
35+
<a class="module-card" href="/documentation/userguide/cytomics">
36+
<span class="material-symbols-rounded module-icon">grain</span>
37+
<span class="module-label">Cytomics</span>
38+
</a>
39+
<a class="module-card" href="/documentation/userguide/review-status">
40+
<span class="material-symbols-rounded module-icon">verified</span>
41+
<span class="module-label">Review Status</span>
42+
</a>
43+
<a class="module-card" href="/documentation/userguide/reactome-fiviz">
44+
<span class="material-symbols-rounded module-icon">hub</span>
45+
<span class="module-label">ReactomeFIViz</span>
46+
</a>
47+
</div>
4148

4249
### Online Tutorial
4350

44-
Available via the EBI Train Online system
45-
46-
[ ![](/uploads/documentation/userguide/training_1.png) ](<https://www.ebi.ac.uk/training/online/course/reactome-quick-tour>)
47-
48-
This quick tour provides a brief introduction to Reactome knowledgebase and its various features.
49-
50-
#### [__Quick tour](<https://www.ebi.ac.uk/training/online/course/reactome-quick-tour>)
51-
52-
[ ![](/uploads/documentation/userguide/training_2.png) ](<https://www.ebi.ac.uk/training/online/course/reactome-exploring-biological-pathways>)
53-
54-
This course provides a more detailed view of the Reactome pathway database web interface and the database content.
55-
56-
#### [__Exploring Pathways](<https://www.ebi.ac.uk/training/online/course/reactome-exploring-biological-pathways>)
57-
58-
[ ![](/uploads/documentation/userguide/training_3.png) ](<https://www.ebi.ac.uk/training/online/course/reactome-tools-analysis-biological-pathways>)
59-
60-
This course introduces the analysis tools available via the Reactome pathway database web interface.
61-
62-
#### [__Analysis Tools](<https://www.ebi.ac.uk/training/online/course/reactome-tools-analysis-biological-pathways>)
51+
Available via the EBI Train Online system.
52+
53+
<div class="module-grid tutorial-grid">
54+
<a class="tutorial-card" href="https://www.ebi.ac.uk/training/online/course/reactome-quick-tour">
55+
<img src="/uploads/documentation/userguide/training_1.png" alt="" />
56+
<span class="module-label">Quick tour</span>
57+
<span class="module-desc">A brief introduction to the Reactome knowledgebase and its various features.</span>
58+
</a>
59+
<a class="tutorial-card" href="https://www.ebi.ac.uk/training/online/course/reactome-exploring-biological-pathways">
60+
<img src="/uploads/documentation/userguide/training_2.png" alt="" />
61+
<span class="module-label">Exploring Pathways</span>
62+
<span class="module-desc">A more detailed view of the Reactome pathway database web interface and the database content.</span>
63+
</a>
64+
<a class="tutorial-card" href="https://www.ebi.ac.uk/training/online/course/reactome-tools-analysis-biological-pathways">
65+
<img src="/uploads/documentation/userguide/training_3.png" alt="" />
66+
<span class="module-label">Analysis Tools</span>
67+
<span class="module-desc">An introduction to the analysis tools available via the Reactome pathway database web interface.</span>
68+
</a>
69+
</div>

projects/website-angular/src/app/page/page.component.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@
1717
max-height: 110px;
1818
margin: 0 auto;
1919
}
20+
21+
// Embedded YouTube / Vimeo / similar iframes default to ~300x150
22+
// because the source HTML doesn't set width/height. Make them fill
23+
// the content column with a 16:9 aspect ratio.
24+
::ng-deep iframe[src*="youtube.com"],
25+
::ng-deep iframe[src*="youtu.be"],
26+
::ng-deep iframe[src*="vimeo.com"] {
27+
display: block;
28+
width: 100%;
29+
aspect-ratio: 16 / 9;
30+
height: auto;
31+
margin: 1rem 0;
32+
border: 0;
33+
border-radius: 6px;
34+
}
2035
}
2136

2237
.page-content {

projects/website-angular/src/utils/addAnchorIds.ts

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
// Adds id="X" to headings whose first child is an anchor link to "#X".
2-
// The Joomla->MDX export stripped explicit id="X" attributes from section
3-
// headings, leaving same-page jump links with no target. When the same href
4-
// appears in multiple headings (e.g. an H2 jump card at the top of the page
5-
// plus the matching H3 section heading below it), only the LAST occurrence
6-
// receives the id so clicks land on the actual section, not the jump card.
1+
// Adds id="X" attributes to headings so same-page #fragment links jump
2+
// to them. Handles two patterns the Joomla -> MDX export left behind:
3+
//
4+
// 1. Headings whose first child is an anchor link to "#X" (the
5+
// pattern used by pages that explicitly link each heading to
6+
// itself, like the jump-card pages). When the same href appears
7+
// in multiple headings (e.g. an H2 jump card at the top plus the
8+
// matching H3 section below it), only the LAST occurrence gets
9+
// the id so clicks land on the section, not the jump card.
10+
//
11+
// 2. Plain `<hN>Section Text</hN>` headings whose slugified text
12+
// matches a same-page #fragment used elsewhere on the page
13+
// (typically a TOC list at the top). The fragment format follows
14+
// the legacy Joomla convention: spaces -> underscores, with
15+
// heading text used verbatim.
716
export default function addAnchorIds(html: string): string {
17+
// Pass 1: existing behaviour -- headings whose first child is the anchor.
818
const re = /<(h[1-6])>\s*(<a\s[^>]*href="#([^"]+)"[^>]*>)/g;
919
const matches: { index: number; length: number; tag: string; href: string; full: string }[] = [];
1020
for (let m = re.exec(html); m !== null; m = re.exec(html)) {
@@ -24,5 +34,27 @@ export default function addAnchorIds(html: string): string {
2434
cursor = m.index + m.length;
2535
});
2636
out += html.slice(cursor);
37+
38+
// Pass 2: plain headings (no inner anchor) whose slugified text
39+
// matches a #fragment referenced anywhere on the page.
40+
const fragments = new Set<string>();
41+
for (const m of out.matchAll(/href="#([^"]+)"/g)) fragments.add(m[1]);
42+
if (fragments.size === 0) return out;
43+
44+
out = out.replace(
45+
/<(h[1-6])(\s[^>]*)?>([\s\S]*?)<\/\1>/g,
46+
(full, tag, attrs, inner) => {
47+
// Skip headings that already have an id (pass 1 added one).
48+
if (attrs && /\bid=/.test(attrs)) return full;
49+
// Skip headings whose content is itself a link (pass 1 would have
50+
// handled them if the link target matched).
51+
// Use the heading's plain text to compute the slug.
52+
const text = inner.replace(/<[^>]+>/g, '').trim();
53+
if (!text) return full;
54+
const slug = text.replace(/\s+/g, '_');
55+
if (!fragments.has(slug)) return full;
56+
return `<${tag}${attrs || ''} id="${slug}">${inner}</${tag}>`;
57+
},
58+
);
2759
return out;
2860
}

src/styles.scss

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,3 +517,117 @@ body {
517517
border-left-color: var(--primary);
518518
background: rgba(0, 110, 144, 0.08);
519519
}
520+
521+
// Inline module-card grid used by MDX landing pages
522+
// (/documentation, /documentation/userguide). Each card is a single
523+
// anchor wrapping an icon, label, and optional description.
524+
.module-grid {
525+
display: grid;
526+
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
527+
gap: 1.5rem;
528+
margin: 1.75rem 0 2rem;
529+
}
530+
531+
.module-card {
532+
display: flex;
533+
flex-direction: column;
534+
align-items: center;
535+
text-align: center;
536+
gap: 0.6rem;
537+
padding: 1.75rem 1.25rem;
538+
border: 1px solid var(--outline-variant);
539+
border-radius: 10px;
540+
background: var(--surface-container-low, rgba(0, 0, 0, 0.03));
541+
color: var(--on-surface);
542+
text-decoration: none;
543+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
544+
transition: background 0.15s, border-color 0.15s, transform 0.15s,
545+
box-shadow 0.15s;
546+
547+
&:hover,
548+
&:focus-visible {
549+
background: var(--surface-container, rgba(0, 0, 0, 0.06));
550+
border-color: var(--primary);
551+
text-decoration: none;
552+
transform: translateY(-3px);
553+
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
554+
color: var(--on-surface);
555+
}
556+
557+
.module-icon {
558+
font-size: 44px;
559+
width: 44px;
560+
height: 44px;
561+
line-height: 44px;
562+
color: var(--primary);
563+
margin-bottom: 0.25rem;
564+
}
565+
566+
.module-label {
567+
font-size: 1.05rem;
568+
font-weight: 600;
569+
color: var(--on-surface);
570+
}
571+
572+
.module-desc {
573+
font-size: 0.875rem;
574+
font-weight: 400;
575+
color: var(--on-surface-variant, rgba(0, 0, 0, 0.65));
576+
line-height: 1.45;
577+
}
578+
}
579+
580+
// Tutorial card variant -- shows a screenshot/thumbnail image at the
581+
// top instead of an icon glyph. Used by /documentation/userguide for
582+
// the EBI Online Tutorial section, where each card previews a real
583+
// course landing page.
584+
.tutorial-card {
585+
display: flex;
586+
flex-direction: column;
587+
align-items: center;
588+
text-align: center;
589+
gap: 0.75rem;
590+
padding: 1rem;
591+
border: 1px solid var(--outline-variant);
592+
border-radius: 8px;
593+
background: var(--surface-container-low, rgba(0, 0, 0, 0.03));
594+
color: var(--on-surface);
595+
text-decoration: none;
596+
transition: background 0.15s, border-color 0.15s, transform 0.15s;
597+
598+
&:hover,
599+
&:focus-visible {
600+
background: var(--surface-container, rgba(0, 0, 0, 0.06));
601+
border-color: var(--primary);
602+
text-decoration: none;
603+
transform: translateY(-2px);
604+
color: var(--on-surface);
605+
}
606+
607+
img {
608+
width: 100%;
609+
max-width: 140px;
610+
height: auto;
611+
border-radius: 6px;
612+
display: block;
613+
}
614+
615+
.module-label {
616+
font-size: 1rem;
617+
font-weight: 600;
618+
color: var(--on-surface);
619+
}
620+
621+
.module-desc {
622+
font-size: 0.85rem;
623+
font-weight: 400;
624+
color: var(--on-surface-variant, rgba(0, 0, 0, 0.6));
625+
line-height: 1.4;
626+
}
627+
}
628+
629+
// Tutorial grid wants slightly wider columns so the screenshot thumbs
630+
// have room to breathe.
631+
.module-grid.tutorial-grid {
632+
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
633+
}

0 commit comments

Comments
 (0)