Closed benjamin-kirkbride closed 1 year ago
Weirdly enough I was just thinking about this today. I'm making some other changes which might break your refactor, but yes I think it's something this tool should offer.
After playing around with this a bit I'm going to make some small changes.
Right now the function signature is:
def strip_tags(selectors, input, minify=False):
I'm going to change that to:
def strip_tags(
input: str, selectors: Optional[List[str]] = None, *, minify: bool = False
) -> str:
input
but may not need to pass selectors
, so I'm swapping the order of those such that input
is the only required option.minify=True
a keyword-only paramater, rather than letting it be positional. This is to make it nicer to add further options in the future without worrying about breaking existing code (also I wanted to try , *,
which I have hardly ever used before)
I am working on a small modification to make this tool work as a library, instead of exclusively as a CLI tool.
I will submit a PR when I'm done, but if you are uninterested in this being included I understand :)