Shikensu.Contrib
Premade functions to manipulate your bundles/definitions with.
Contrib
Clear metadata.
Clone.
For each definition that has the given relativePath
(1st argument),
make a clone with a new relativePath
(2nd argument),
and add that into the compendium just after the matching definition.
>>> clone "index.html" "200.html" bundle
Copy definition properties into the metadata.
Exclude.
Filter out the definitions that have the given relativePath
.
Insert additional metadata.
Permalink.
Append the baseName to the directoryPath and change the baseName to the given string. It will NOT change definitions that already have the new baseName.
>>> permalink "index" compendium
Rename.
Change the relativePath
of the definitions that match a given relativePath
.
For example, if you have a definition with the relativePath path a/b/example.html
:
>>> rename
..> (Path.file [ "a", "b", "example.html" ])
..> (Path.file [ "example", "index.html" ])
..> compendium
Rename extension.
Example:
>>> renameExtension "markdown" "html" compendium
..> -- The definitions that had the extensionName "markdown"
..> -- now have the extensionName "html"
Render content.
Replace the content
property by providing a renderer.
A renderer is a function with the signature Definition -> Maybe Bytes
.
You can use this to render templates, markdown, etc.
Replace metadata.
Replace the current metadata dictionary with another one.
Set content.
Set content directly.
Transform content.
Alias for renderContent
.
Only keep definitions with the given base name.
Only keep definitions with the given directory path.
Only keep definitions with the given extension.
Only keep definitions with the given metadata.