Skip to content

Commit 32d1aa2

Browse files
committed
feat: Reorganize pipeline examples into clean directory structure
Restructure pipeline examples from flat files to organized subdirectories under /examples/, with colocated docs and code files. - Move examples.astro → examples/index.astro - Create subdirs: basic-pipeline/, blast-pipeline/, rna-seq-pipeline/, machine-learning-pipeline/, mixing-scripting-languages/ - Extract embedded Nextflow code from .md to separate main.nf files - Convert .md to .mdx with Expressive Code imports - Clean URLs without trailing slashes (/examples/basic-pipeline) - Update all navigation and links to new structure - Fix active page highlighting in side navigation - Add backward compatibility redirects Better organization, consistent patterns, maintainable structure.
1 parent b40db46 commit 32d1aa2

File tree

18 files changed

+294
-258
lines changed

18 files changed

+294
-258
lines changed

netlify.toml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,41 @@
2323

2424
[[redirects]]
2525
from = "/example1.html"
26-
to = "/basic-pipeline.html"
26+
to = "/examples/basic-pipeline"
2727

2828
[[redirects]]
2929
from = "/example2.html"
30-
to = "/mixing-scripting-languages.html"
30+
to = "/examples/mixing-scripting-languages"
3131

3232
[[redirects]]
3333
from = "/example3.html"
34-
to = "/blast-pipeline.html"
34+
to = "/examples/blast-pipeline"
3535

3636
[[redirects]]
3737
from = "/example4.html"
38-
to = "/rna-seq-pipeline.html"
38+
to = "/examples/rna-seq-pipeline"
3939

4040
[[redirects]]
4141
from = "/example5.html"
42-
to = "/machine-learning-pipeline.html"
42+
to = "/examples/machine-learning-pipeline"
43+
44+
# Direct redirects from old .html files to new structure
45+
[[redirects]]
46+
from = "/basic-pipeline.html"
47+
to = "/examples/basic-pipeline"
48+
49+
[[redirects]]
50+
from = "/mixing-scripting-languages.html"
51+
to = "/examples/mixing-scripting-languages"
52+
53+
[[redirects]]
54+
from = "/blast-pipeline.html"
55+
to = "/examples/blast-pipeline"
56+
57+
[[redirects]]
58+
from = "/rna-seq-pipeline.html"
59+
to = "/examples/rna-seq-pipeline"
60+
61+
[[redirects]]
62+
from = "/machine-learning-pipeline.html"
63+
to = "/examples/machine-learning-pipeline"

src/components/Footer.astro

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,29 +86,30 @@ import LogoSeqera from "../../public/img/assets/Logo_Seqera_whote.svg";
8686
<ul class="examples-list pl-0">
8787
<li class="title text-white font-inter text-xs font-bold">Examples</li>
8888
<li>
89-
<a class="text-white font-inter text-xs font-normal leading-normal" href="/basic-pipeline.html"
89+
<a class="text-white font-inter text-xs font-normal leading-normal" href="/examples/basic-pipeline"
9090
>Basic pipeline</a
9191
>
9292
</li>
9393
<li>
9494
<a
9595
class="text-white font-inter text-xs font-normal leading-normal"
96-
href="/mixing-scripting-languages.html">Mixing scripting languages</a
96+
href="/examples/mixing-scripting-languages">Mixing scripting languages</a
9797
>
9898
</li>
9999
<li>
100-
<a class="text-white font-inter text-xs font-normal leading-normal" href="/blast-pipeline.html"
100+
<a class="text-white font-inter text-xs font-normal leading-normal" href="/examples/blast-pipeline"
101101
>BLAST pipeline</a
102102
>
103103
</li>
104104
<li>
105-
<a class="text-white font-inter text-xs font-normal leading-normal" href="/rna-seq-pipeline.html"
105+
<a class="text-white font-inter text-xs font-normal leading-normal" href="/examples/rna-seq-pipeline"
106106
>RNA-Seq pipeline</a
107107
>
108108
</li>
109109
<li>
110-
<a class="text-white font-inter text-xs font-normal leading-normal" href="/machine-learning-pipeline.html"
111-
>Machine Learning pipeline</a
110+
<a
111+
class="text-white font-inter text-xs font-normal leading-normal"
112+
href="/examples/machine-learning-pipeline">Machine Learning pipeline</a
112113
>
113114
</li>
114115
<li>

src/components/Menu/Menu.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,27 +192,27 @@ const Menu = ({}) => {
192192
</a>
193193
<ul className="dropdown-menu" role="menu" onClick={handleMenuItemClick}>
194194
<li>
195-
<a href="/basic-pipeline.html" tabIndex={0}>
195+
<a href="/examples/basic-pipeline" tabIndex={0}>
196196
Basic pipeline
197197
</a>
198198
</li>
199199
<li>
200-
<a href="/mixing-scripting-languages.html" tabIndex={0}>
200+
<a href="/examples/mixing-scripting-languages" tabIndex={0}>
201201
Mixing scripting languages
202202
</a>
203203
</li>
204204
<li>
205-
<a href="/blast-pipeline.html" tabIndex={0}>
205+
<a href="/examples/blast-pipeline" tabIndex={0}>
206206
BLAST pipeline
207207
</a>
208208
</li>
209209
<li>
210-
<a href="/rna-seq-pipeline.html" tabIndex={0}>
210+
<a href="/examples/rna-seq-pipeline" tabIndex={0}>
211211
RNA-Seq pipeline
212212
</a>
213213
</li>
214214
<li>
215-
<a href="/machine-learning-pipeline.html" tabIndex={0}>
215+
<a href="/examples/machine-learning-pipeline" tabIndex={0}>
216216
Machine Learning pipeline
217217
</a>
218218
</li>

src/components/SideNavigation/ExamplesSideNav.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ const ExamplesSideNav = () => {
77
useEffect(() => {
88
if (typeof window !== 'undefined') {
99
const path = window.location.pathname;
10-
const filename = path.split('/').pop();
11-
12-
if (filename) {
13-
const match = filename.match(/example(\d+)/);
14-
if (match && match[1]) {
15-
setActiveId(`example${match[1]}`);
16-
}
10+
11+
// Extract pipeline name from /examples/pipeline-name/ format
12+
const match = path.match(/\/examples\/([^\/]+)\/?$/);
13+
if (match && match[1]) {
14+
setActiveId(match[1]);
1715
}
1816
}
1917
}, []);
@@ -22,27 +20,27 @@ const ExamplesSideNav = () => {
2220
{
2321
id: 'basic-pipeline',
2422
title: 'Basic pipeline',
25-
href: 'basic-pipeline.html'
23+
href: '/examples/basic-pipeline'
2624
},
2725
{
2826
id: 'mixing-scripting-languages',
2927
title: 'Mixing scripting languages',
30-
href: 'mixing-scripting-languages.html'
28+
href: '/examples/mixing-scripting-languages'
3129
},
3230
{
3331
id: 'blast-pipeline',
3432
title: 'BLAST pipeline',
35-
href: 'blast-pipeline.html'
33+
href: '/examples/blast-pipeline'
3634
},
3735
{
3836
id: 'rna-seq-pipeline',
3937
title: 'RNA-Seq pipeline',
40-
href: 'rna-seq-pipeline.html'
38+
href: '/examples/rna-seq-pipeline'
4139
},
4240
{
4341
id: 'machine-learning-pipeline',
4442
title: 'Machine Learning pipeline',
45-
href: 'machine-learning-pipeline.html'
43+
href: '/examples/machine-learning-pipeline'
4644
}
4745
];
4846

src/pages/basic-pipeline.mdx renamed to src/pages/examples/basic-pipeline/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ layout: "@layouts/ExampleLayout.astro"
44
---
55

66
import { Code } from "astro-expressive-code/components";
7-
import pipelineCode from "../examples/basic-pipeline.nf?raw";
7+
import pipelineCode from "./main.nf?raw";
88

99
<div class="blg-summary example">
1010
<h2>Basic pipeline</h2>
File renamed without changes.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: BLAST pipeline
3+
layout: "@layouts/ExampleLayout.astro"
4+
---
5+
6+
import { Code } from "astro-expressive-code/components";
7+
import pipelineCode from "./main.nf?raw";
8+
9+
<div class="blg-summary example">
10+
<h2>BLAST pipeline</h2>
11+
12+
<p class="">
13+
This example splits a FASTA file into chunks and executes a BLAST query for each chunk in parallel. Then, all the
14+
sequences for the top hits are collected and merged into a single result file.
15+
</p>
16+
17+
<Code code={pipelineCode} lang="nextflow" />
18+
19+
</div>
20+
21+
### Try it on your computer
22+
23+
To run this pipeline on your computer, you will need:
24+
25+
- Unix-like operating system
26+
- Java 17 (or higher)
27+
- Docker
28+
29+
Install Nextflow by entering the following command in the terminal:
30+
31+
$ curl -fsSL https://get.nextflow.io | bash
32+
33+
Then launch the pipeline with this command:
34+
35+
$ ./nextflow run blast-example -with-docker
36+
37+
It will automatically download the pipeline [GitHub repository](https://github.com/nextflow-io/blast-example) and the associated Docker images, thus the first execution may take a few minutes to complete depending on your network connection.
38+
39+
**NOTE**: To run this example with versions of Nextflow older than 22.04.0, you must include the `-dsl2` flag with `nextflow run`.

src/pages/blast-pipeline.md renamed to src/pages/examples/blast-pipeline/main.nf

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
---
2-
title: BLAST pipeline
3-
layout: "@layouts/ExampleLayout.astro"
4-
---
5-
6-
<div class="blg-summary example">
7-
<h2>BLAST pipeline</h2>
8-
9-
<p class="">
10-
This example splits a FASTA file into chunks and executes a BLAST query for each chunk in parallel. Then, all the sequences for the top hits are collected and merged into a single result file.
11-
</p>
12-
13-
```groovy
141
#!/usr/bin/env nextflow
152

163
/*
@@ -85,27 +72,4 @@ process extract {
8572
"""
8673
blastdbcmd -db $db/$db_name -entry_batch top_hits | head -n 10 > sequences
8774
"""
88-
}
89-
```
90-
91-
</div>
92-
93-
### Try it on your computer
94-
95-
To run this pipeline on your computer, you will need:
96-
97-
- Unix-like operating system
98-
- Java 17 (or higher)
99-
- Docker
100-
101-
Install Nextflow by entering the following command in the terminal:
102-
103-
$ curl -fsSL https://get.nextflow.io | bash
104-
105-
Then launch the pipeline with this command:
106-
107-
$ ./nextflow run blast-example -with-docker
108-
109-
It will automatically download the pipeline [GitHub repository](https://github.com/nextflow-io/blast-example) and the associated Docker images, thus the first execution may take a few minutes to complete depending on your network connection.
110-
111-
**NOTE**: To run this example with versions of Nextflow older than 22.04.0, you must include the `-dsl2` flag with `nextflow run`.
75+
}

src/pages/examples.astro renamed to src/pages/examples/index.astro

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,37 @@ import ExamplesSideNav from "@components/SideNavigation/ExamplesSideNav";
2525
<p class="mb-4">
2626
Learn how to create a simple pipeline with two processes that communicate via channels.
2727
</p>
28-
<a href="basic-pipeline.html" class="text-nextflow-green hover:underline">View example →</a>
28+
<a href="/examples/basic-pipeline" class="text-nextflow-green hover:underline">View example →</a>
2929
</div>
3030

3131
<div class="border rounded-lg p-6 hover:shadow-md transition-shadow">
3232
<h3 class="text-xl font-medium mb-2">Multiple inputs</h3>
3333
<p class="mb-4">
3434
Discover how to manage multiple inputs and complex data dependencies in your workflows.
3535
</p>
36-
<a href="mixing-scripting-languages.html" class="text-nextflow-green hover:underline">View example →</a>
36+
<a href="/examples/mixing-scripting-languages" class="text-nextflow-green hover:underline"
37+
>View example →</a
38+
>
3739
</div>
3840

3941
<div class="border rounded-lg p-6 hover:shadow-md transition-shadow">
4042
<h3 class="text-xl font-medium mb-2">Channel operators</h3>
4143
<p class="mb-4">Explore powerful channel operators for transforming and manipulating data streams.</p>
42-
<a href="blast-pipeline.html" class="text-nextflow-green hover:underline">View example →</a>
44+
<a href="/examples/blast-pipeline" class="text-nextflow-green hover:underline">View example →</a>
4345
</div>
4446

4547
<div class="border rounded-lg p-6 hover:shadow-md transition-shadow">
4648
<h3 class="text-xl font-medium mb-2">Processes and Channels</h3>
4749
<p class="mb-4">See advanced techniques for connecting processes through different channel types.</p>
48-
<a href="rna-seq-pipeline.html" class="text-nextflow-green hover:underline">View example →</a>
50+
<a href="/examples/rna-seq-pipeline" class="text-nextflow-green hover:underline">View example →</a>
4951
</div>
5052

5153
<div class="border rounded-lg p-6 hover:shadow-md transition-shadow">
5254
<h3 class="text-xl font-medium mb-2">Error strategies</h3>
5355
<p class="mb-4">Learn how to handle errors and implement robust error recovery strategies.</p>
54-
<a href="machine-learning-pipeline.html" class="text-nextflow-green hover:underline">View example →</a>
56+
<a href="/examples/machine-learning-pipeline" class="text-nextflow-green hover:underline"
57+
>View example →</a
58+
>
5559
</div>
5660
</div>
5761
</div>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: Error strategies
3+
layout: "@layouts/ExampleLayout.astro"
4+
---
5+
6+
import { Code } from "astro-expressive-code/components";
7+
import pipelineCode from "./main.nf?raw";
8+
9+
<div class="blg-summary example">
10+
<h2>Machine Learning pipeline</h2>
11+
12+
<p class="">
13+
This example shows how to put together a basic Machine Learning pipeline. It fetches a dataset from OpenML, trains a
14+
variety of machine learning models on a prediction target, and selects the best model based on some evaluation
15+
criteria.
16+
</p>
17+
18+
<Code code={pipelineCode} lang="nextflow" />
19+
20+
</div>
21+
22+
### Try it in your computer
23+
24+
To run this pipeline on your computer, you will need:
25+
26+
- Unix-like operating system
27+
- Java 17 (or higher)
28+
- Docker
29+
30+
Install Nextflow by entering the following command in the terminal:
31+
32+
$ curl -fsSL get.nextflow.io | bash
33+
34+
Then launch the pipeline with this command:
35+
36+
$ nextflow run ml-hyperopt -profile wave
37+
38+
It will automatically download the pipeline [GitHub repository](https://github.com/nextflow-io/ml-hyperopt) and build a Docker image on-the-fly using [Wave](https://seqera.io/wave/), thus the first execution may take a few minutes to complete depending on your network connection.
39+
40+
**NOTE**: Nextflow 22.10.0 or newer is required to run this pipeline with Wave.

0 commit comments

Comments
 (0)