|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "Running Aditi Journey on Specific Files: Three Powerful Options" |
| 4 | +date: 2025-09-02 16:32:16 -0400 |
| 5 | +author: Aditi Team |
| 6 | +tags: [tips, workflow, journey] |
| 7 | +summary: "Learn three different ways to run aditi journey on specific files for targeted DITA preparation" |
| 8 | +--- |
| 9 | + |
| 10 | +When working with large documentation repositories, you often need to fix issues in specific files rather than processing an entire directory. The `aditi journey` command supports multiple ways to target specific files, giving you flexibility in your workflow. |
| 11 | + |
| 12 | +## The Challenge |
| 13 | + |
| 14 | +Imagine you've identified a set of files with `TaskStep` violations that need fixing: |
| 15 | + |
| 16 | +``` |
| 17 | +TaskStep: DITA task steps should contain simple instructions. |
| 18 | +
|
| 19 | +These files have this issue: |
| 20 | + • modules/network-observability-filtering-ebpf-rule.adoc |
| 21 | + • modules/network-observability-enriched-flows.adoc |
| 22 | + • modules/network-observability-working-with-topology.adoc |
| 23 | + • modules/network-observability-flowmetrics-charts.adoc |
| 24 | + • modules/network-observability-dns-tracking.adoc |
| 25 | + • modules/network-observability-flowcollector-kafka-config.adoc |
| 26 | + • modules/network-observability-packet-translation.adoc |
| 27 | + • modules/network-observability-viewing-dashboards.adoc |
| 28 | + • modules/network-observability-working-with-overview.adoc |
| 29 | + • modules/network-observability-working-with-trafficflow.adoc |
| 30 | +``` |
| 31 | + |
| 32 | +Instead of processing your entire `modules/` directory, you want to focus just on these files. Here are three ways to do it. |
| 33 | + |
| 34 | +## Option 1: Direct File Listing |
| 35 | + |
| 36 | +The most straightforward approach is to list all files directly on the command line: |
| 37 | + |
| 38 | +```bash |
| 39 | +aditi journey \ |
| 40 | + modules/network-observability-filtering-ebpf-rule.adoc \ |
| 41 | + modules/network-observability-enriched-flows.adoc \ |
| 42 | + modules/network-observability-working-with-topology.adoc \ |
| 43 | + modules/network-observability-flowmetrics-charts.adoc \ |
| 44 | + modules/network-observability-dns-tracking.adoc \ |
| 45 | + modules/network-observability-flowcollector-kafka-config.adoc \ |
| 46 | + modules/network-observability-packet-translation.adoc \ |
| 47 | + modules/network-observability-viewing-dashboards.adoc \ |
| 48 | + modules/network-observability-working-with-overview.adoc \ |
| 49 | + modules/network-observability-working-with-trafficflow.adoc |
| 50 | +``` |
| 51 | + |
| 52 | +**Pros:** |
| 53 | +- Explicit and clear about which files are being processed |
| 54 | +- Works on all shells and platforms |
| 55 | +- Easy to modify by adding or removing specific files |
| 56 | + |
| 57 | +**Cons:** |
| 58 | +- Can be verbose for many files |
| 59 | +- Requires typing or copying each filename |
| 60 | + |
| 61 | +**Tip:** Use backslashes (`\`) for line continuation to make the command more readable. |
| 62 | + |
| 63 | +## Option 2: Shell Brace Expansion |
| 64 | + |
| 65 | +When your files share a common prefix, you can use shell brace expansion for a more compact command: |
| 66 | + |
| 67 | +```bash |
| 68 | +aditi journey modules/network-observability-{filtering-ebpf-rule,enriched-flows,working-with-topology,flowmetrics-charts,dns-tracking,flowcollector-kafka-config,packet-translation,viewing-dashboards,working-with-overview,working-with-trafficflow}.adoc |
| 69 | +``` |
| 70 | + |
| 71 | +Or with line breaks for readability: |
| 72 | + |
| 73 | +```bash |
| 74 | +aditi journey modules/network-observability-{filtering-ebpf-rule,\ |
| 75 | +enriched-flows,\ |
| 76 | +working-with-topology,\ |
| 77 | +flowmetrics-charts,\ |
| 78 | +dns-tracking,\ |
| 79 | +flowcollector-kafka-config,\ |
| 80 | +packet-translation,\ |
| 81 | +viewing-dashboards,\ |
| 82 | +working-with-overview,\ |
| 83 | +working-with-trafficflow}.adoc |
| 84 | +``` |
| 85 | + |
| 86 | +**Pros:** |
| 87 | +- More compact than listing full paths |
| 88 | +- Reduces repetition of common path components |
| 89 | +- Still explicit about which files are included |
| 90 | + |
| 91 | +**Cons:** |
| 92 | +- Requires bash or zsh (doesn't work in all shells) |
| 93 | +- Can be hard to read with many items |
| 94 | +- All files must share the same prefix and suffix |
| 95 | + |
| 96 | +**Tip:** This works great when your files follow a naming convention! |
| 97 | + |
| 98 | +## Option 3: File List with xargs |
| 99 | + |
| 100 | +For maximum flexibility, maintain a list of files in a text file and use `xargs`: |
| 101 | + |
| 102 | +First, create your file list: |
| 103 | + |
| 104 | +```bash |
| 105 | +cat > taskstep-files.txt << EOF |
| 106 | +modules/network-observability-filtering-ebpf-rule.adoc |
| 107 | +modules/network-observability-enriched-flows.adoc |
| 108 | +modules/network-observability-working-with-topology.adoc |
| 109 | +modules/network-observability-flowmetrics-charts.adoc |
| 110 | +modules/network-observability-dns-tracking.adoc |
| 111 | +modules/network-observability-flowcollector-kafka-config.adoc |
| 112 | +modules/network-observability-packet-translation.adoc |
| 113 | +modules/network-observability-viewing-dashboards.adoc |
| 114 | +modules/network-observability-working-with-overview.adoc |
| 115 | +modules/network-observability-working-with-trafficflow.adoc |
| 116 | +EOF |
| 117 | +``` |
| 118 | + |
| 119 | +Then run the journey: |
| 120 | + |
| 121 | +```bash |
| 122 | +xargs aditi journey < taskstep-files.txt |
| 123 | +``` |
| 124 | + |
| 125 | +**Pros:** |
| 126 | +- File list is reusable and version-controllable |
| 127 | +- Easy to maintain and update |
| 128 | +- Can generate file lists programmatically |
| 129 | +- Works well with other Unix tools |
| 130 | + |
| 131 | +**Cons:** |
| 132 | +- Requires creating an additional file |
| 133 | +- Less immediate than direct command-line options |
| 134 | + |
| 135 | +**Tip:** You can generate file lists from Vale output or other tools: |
| 136 | + |
| 137 | +```bash |
| 138 | +# Example: Find all files with a specific violation |
| 139 | +aditi check --rule TaskStep | grep "^ •" | cut -d' ' -f4 > taskstep-files.txt |
| 140 | +``` |
| 141 | + |
| 142 | +## Practical Workflow Tips |
| 143 | + |
| 144 | +### Using Wildcards |
| 145 | + |
| 146 | +For files matching a pattern, you can also use shell wildcards: |
| 147 | + |
| 148 | +```bash |
| 149 | +# Process all network-observability files |
| 150 | +aditi journey modules/network-observability-*.adoc |
| 151 | + |
| 152 | +# Process specific patterns |
| 153 | +aditi journey modules/network-observability-working-with-*.adoc |
| 154 | +``` |
| 155 | + |
| 156 | +### Skipping to Specific Rules |
| 157 | + |
| 158 | +When targeting specific files for a known issue, you'll often want to skip to the relevant rule. Just press `s` (skip) for rules you don't need: |
| 159 | + |
| 160 | +```bash |
| 161 | +aditi journey modules/my-files-*.adoc |
| 162 | +# Press 's' to skip ContentType if already handled |
| 163 | +# Press 's' to skip EntityReference if not relevant |
| 164 | +# Press 'A' when you reach the rule you want to fix |
| 165 | +``` |
| 166 | + |
| 167 | +### Combining with Git |
| 168 | + |
| 169 | +Track your progress by creating targeted commits: |
| 170 | + |
| 171 | +```bash |
| 172 | +# Fix EntityReference issues in specific files |
| 173 | +aditi journey modules/api-*.adoc |
| 174 | +git add modules/api-*.adoc |
| 175 | +git commit -m "fix: Resolve EntityReference violations in API modules" |
| 176 | + |
| 177 | +# Fix TaskStep issues in another set |
| 178 | +xargs aditi journey < taskstep-files.txt |
| 179 | +git add -p # Review changes |
| 180 | +git commit -m "fix: Simplify task steps for DITA compliance" |
| 181 | +``` |
| 182 | + |
| 183 | +## Which Option Should You Use? |
| 184 | + |
| 185 | +- **Use Option 1 (direct listing)** when you have a small, specific set of files that don't follow a pattern |
| 186 | +- **Use Option 2 (brace expansion)** when files share a common naming pattern |
| 187 | +- **Use Option 3 (xargs with file list)** when: |
| 188 | + - You have many files to process |
| 189 | + - You want to reuse the same file list multiple times |
| 190 | + - You're generating the file list from another tool |
| 191 | + - You want to track which files need processing in version control |
| 192 | + |
| 193 | +## Conclusion |
| 194 | + |
| 195 | +The `aditi journey` command's flexibility in accepting file arguments makes it powerful for targeted DITA preparation work. Whether you're fixing issues reported in a ticket, working through a specific rule across multiple files, or focusing on a particular documentation module, these options give you the control you need for an efficient workflow. |
| 196 | + |
| 197 | +Remember: the journey tracks your progress, so you can always interrupt and resume later with the same command. This makes it perfect for working through large sets of files incrementally. |
| 198 | + |
| 199 | +Happy documenting! 🚀 |
0 commit comments