Change portions of static config files
* Python 3.9 through 3.13, PyPy
New in 1.0.x
integration with drain-swamp-action; all badges; docs to py310;
New in 0.0.x
move snip from package drain-swamp;
Within a configuration, there are times when some bit of text needs to be changed.
The only requirement is the file format should recognize pound symbol #
as a comment.
A snippet without an snippet code (id)
before snippet
# @@@ editable
code block
# @@@ end
after snippet
A snippet with an snippet code (id)
before snippet
# @@@ i_am_a_snippet_co
code block
# @@@ end
after snippet
None
This is a base package. Other authors are encouraged to:
- not reinvent the wheel
- avoid packages with snippet implementations, when only just want the base class, Snip
Packages using drain-swamp-snippet-pypi
The technique and initial implementation is from Ned Batchelder
Ned Batchelder is also the author of cog which creates content by embedding both Python code and output in the original file.
Check out introduction to cog
Note
[original code] supports replacing one snippet per file, not idiot proof, nor unittested.