initial commit

This commit is contained in:
Amy de Buitléir 2023-11-28 16:12:09 +00:00
parent 7761303cd4
commit 7ff82d6fb6
4 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1,8 @@
from html_sanitizer import Sanitizer
sanitizer = Sanitizer() # default configuration
original='<span style="font-weight:bold">some text</span>'
print('original: ', original)
sanitized=sanitizer.sanitize(original)
print('sanitized: ', sanitized)

View file

@ -0,0 +1,24 @@
= In `shell.nix`
[source,nix,linenums]
.shell.nix
....
include::shell.nix[]
....
Here's a short Python program that uses it.
[source,python,linenums]
.Main.hs
....
include::Main.py[]
....
Here's a demonstration using the program.
....
$# echo '$ nix-shell'
$# nix-shell --run bash <<EOL
$ python Main.py
$# EOL
....

View file

@ -0,0 +1,9 @@
with (import <nixpkgs> {});
let
customPython = python3.withPackages (ps: with ps; [ html_sanitizer ]);
in
mkShell {
buildInputs = [
customPython
];
}