prometa package
Subpackages
Submodules
prometa.citation module
Citation file format (.cff) functions.
https://citation-file-format.github.io/ https://github.com/citation-file-format/citation-file-format/blob/main/schema-guide.md
prometa.common module
Common constants and functions.
prometa.config module
prometa.exception module
Exceptions.
prometa.file module
File operations.
- prometa.file.update_content(content, path, encoding='utf-8', **kwargs)[source]
Interactively compare and merge new content. If the target path does not exist, the content will be written directly to it.
- Parameters:
content – The new content to merge.
path – The target path.
encoding – The file encoding to use when writing the content. If None, the content is assumed to be bytes.
**kwargs – Keyword arguments passed through to diff().
prometa.insert module
Base class for inserting content into text files.
- class prometa.insert.Inserter(regex)[source]
Bases:
object
Insert updated content into a text file.
- class prometa.insert.MarkdownInserter[source]
Bases:
Inserter
Inserter with custom regex for invisible comments in Markdown files.
In Markdown, a link label for a simple hash results in no output for most common Markdown processors: “[comment]: #”. Note that these must be proceeded by blank lines to be recognized in Markdown.
This class recognized blocks that begin with a comment prefixed with “insert: “ and end with a comment containing only “/insert”. Both comments must have the same indentation level and the inserted text will be indented to the same level.
- static get_link(label, url)[source]
Get the Markdown link.
- Parameters:
label – The label shown for the link.
url – The URL of the link.
- Returns:
The Markdown link as a string.
- get_output(label, content)[source]
Get output to replace the given label. Override this to insert custom content.
- Parameters:
label – The label in the comment pair that was matched.
content – The content between the matched comments.
- Returns:
The content to insert, or None if the label was not recognized.
prometa.main module
prometa.project module
prometa.readme module
Module contents
Package stub.