PyJsonContentTransformerBase
class PyJsonContentTransformerBase
Bases: Generic[TPublish]
Generic base class for JSON transformers.
__init__()
Methods
__init__() |
|
|---|---|
needs_json_transforming(ctx) |
Finds whether the content item needs any JSON changes, returning false prevents file IO from occurring. |
transform(ctx, json_obj) |
Transforms the JSON of the content item. |
needs_json_transforming(ctx)
Finds whether the content item needs any JSON changes, returning false prevents file IO from occurring.
Args: : ctx: The content item to inspect.
Returns: Whether or not the content item needs JSON changes.
- Parameters: ctx (TPublish)
- Return type: bool
transform(ctx, json_obj)
Transforms the JSON of the content item.
Args: : ctx: The content item being transformed. json_obj: The JSON of the content item to transform. Any changes made to the JSON are persisted back to the file before publishing.
- Parameters: ctx (TPublish)
- Return type: None