add delete_tiddlers builder

It deletes tiddlers. Yep.
This commit is contained in:
Soren I. Bjornstad 2021-09-10 11:31:42 -05:00
parent ea02c1bd5a
commit cf42b060eb
1 changed files with 18 additions and 1 deletions

View File

@ -436,7 +436,7 @@ def set_tiddler_values(mappings: Dict[str, str]) -> None:
'$__config_sib_CurrentEditionPublicity.tid': 'public',
})
:param mappings: A dictionary whose keys are tiddler names
:param mappings: A dictionary whose keys are tiddler filenames
and whose values are the values to be inserted
in those tiddlers' ``text`` fields.
"""
@ -463,6 +463,23 @@ def set_tiddler_values(mappings: Dict[str, str]) -> None:
f.write(new_text)
@tzk_builder
def delete_tiddlers(tiddlers: Sequence[str]) -> None:
"""
Delete selected tiddlers from the output.
This is hopefully self-explanatory.
.. code-block:: python
:param mappings: A list of filenames of tiddlers to delete.
"""
assert 'public_wiki_folder' in build_state
for tiddler in tiddlers:
tiddler_path = (Path(build_state['public_wiki_folder']) / "tiddlers" / tiddler)
tiddler_path.unlink()
@tzk_builder
def publish_wiki_to_github(
output_folder: str = "output/public_site/",