topmark.pipeline.steps.renderer ¶
Header renderer step for the TopMark pipeline (view-based).
This step takes the selected field mapping built in the previous step
(ctx.views.build.selected) and renders it into header text using the active
file type's formatting rules. It preserves the file's newline convention,
mutates only the processing context, and performs no I/O.
Outputs
ctx.views.render.lines- rendered header lines (keepends).ctx.views.render.block- concatenated rendered text.
Notes
- The builder remains the single source of field dictionaries
(
ctx.views.build.builtins/ctx.views.build.selected). - The renderer does not compute diffs nor write to disk.
RendererStep ¶
Bases: BaseStep
Render expected header text from the selected field mapping.
Consumes BuilderView.selected, validates the exact configured fields at
the processor boundary, and produces a RenderView with lines/block only
when validation succeeds. Preserves newline style and indentation where
applicable.
Axes written
- render
Sets
- RenderStatus: {PENDING, RENDERED, SKIPPED, FAILED}
Source code in src/topmark/pipeline/steps/renderer.py
may_proceed ¶
Determine if processing can proceed to the render step.
Processing can proceed if:
- Field generation completed with GENERATED or NO_FIELDS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
ProcessingContext
|
The processing context for the current file. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if processing can proceed to the render step, False otherwise. |
Source code in src/topmark/pipeline/steps/renderer.py
run ¶
Render the expected header text from ctx.views.build.selected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
ProcessingContext
|
Mutable context with:
* |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If header processor is not defined. |
Mutations
ProcessingContext: The same context with ctx.views.render populated depending on
the generation status:
* NO_FIELDS - renders a markers-only header when allowed by policy; otherwise
sets ctx.views.render = RenderView(lines=None, block=None) and skips.
* GENERATED - sets ctx.views.render.lines and ctx.views.render.block.
If the selected mapping is empty, produces a completed empty render defensively.
* any other status - returns unchanged.
Notes
This step mutates ctx in place and performs no I/O.
Source code in src/topmark/pipeline/steps/renderer.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |
hint ¶
Attach render hints (non-binding).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
ProcessingContext
|
The processing context. |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the context contains an unexpected render status value. |