Skip to content

Commit 0937ec6

Browse files
edmundmillerclaude
andcommitted
feat: Add labeled text markers to pipeline example
- Add empty lines in strategic positions for label placement - Implement working labeled text markers for key pipeline components - Add custom CSS styling for labels with green background and dark text - Clean structure highlights shebang, parameters, processes, and workflow feat: Improve text markers with detailed educational labels - Replace shebang marker with more focused dataflow concepts - Add descriptive labels explaining key Nextflow paradigms - Target strategic lines that demonstrate core concepts: - Pipeline parameters for configurability - Process definitions for computational steps - Parallel processing for independent execution - Data input patterns - Dataflow programming with pipe operators 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 2f4c6fc commit 0937ec6

File tree

3 files changed

+35
-14
lines changed

3 files changed

+35
-14
lines changed

src/layouts/ExampleLayout.astro

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,21 @@ const image = frontmatter?.image || "";
3030
position: relative;
3131
}
3232

33+
/* Custom styling for Expressive Code text marker labels */
34+
.code-examples :global(.ec-line-marker-label) {
35+
background-color: #0dc09d !important;
36+
color: #1f2937 !important;
37+
}
38+
39+
.code-examples :global([data-ec-label]) {
40+
background-color: #0dc09d !important;
41+
color: #1f2937 !important;
42+
}
43+
44+
/* Alternative selectors in case the above don't work */
45+
.code-examples :global(.ec-text-marker-label) {
46+
background-color: #0dc09d !important;
47+
color: #1f2937 !important;
48+
}
49+
3350
</style>

src/pages/examples/basic-pipeline/_main.nf

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env nextflow
22

3+
34
params.in = "$baseDir/data/sample.fa"
45

5-
/*
6-
* Split a fasta file into multiple files
7-
*/
6+
87
process splitSequences {
98

109
input:
@@ -18,9 +17,7 @@ process splitSequences {
1817
"""
1918
}
2019

21-
/*
22-
* Reverse the sequences
23-
*/
20+
2421
process reverse {
2522

2623
input:
@@ -34,11 +31,11 @@ process reverse {
3431
"""
3532
}
3633

37-
/*
38-
* Define the workflow
39-
*/
34+
4035
workflow {
36+
4137
splitSequences(params.in) \
38+
4239
| reverse \
4340
| view
44-
}
41+
}

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,24 @@ import terminalOutput from "./_nextflow_run_output.log?raw";
1919
lang="nextflow"
2020
title="main.nf"
2121
frame="code"
22-
mark={[1, 3, { range: "8-19" }, { range: "24-35" }, { range: "40-44" }]}
22+
mark={[
23+
{ range: "3", label: "1. Pipeline Parameters - Make workflows configurable" },
24+
{ range: "6", label: "2. Process Definition - Define computational steps" },
25+
{ range: "20", label: "3. Parallel Process - Each split runs independently" },
26+
{ range: "36", label: "4. Data Input - Pass parameters to first process" },
27+
{ range: "38", label: "5. Dataflow Pipeline - Connect processes with pipes" },
28+
]}
2329
/>
2430

2531
### Key Concepts
2632

2733
This example demonstrates fundamental Nextflow concepts:
2834

2935
- **Pipeline Parameters**: Use `params.in` to make your pipeline configurable from the command line
30-
- **Process Definitions**: Two processes that transform data sequentially - `splitSequences` splits a FASTA file, and `reverse` reverses each sequence
31-
- **Dataflow Programming**: Output from one process automatically becomes input to the next using the `|` operator
32-
- **Parallel Execution**: Each split file is processed independently by the `reverse` process
36+
- **Process Definition**: Define computational steps as isolated, reusable processes
37+
- **Parallel Processing**: Each split file is processed independently and automatically in parallel
38+
- **Data Input**: Pass data into workflows using parameter references
39+
- **Dataflow Programming**: Connect processes using the pipe (`|`) operator for seamless data flow
3340

3441
<Code lang="ansi" title="Running the Example" frame="terminal" code={terminalOutput} />
3542

0 commit comments

Comments
 (0)