mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2026-05-15 01:21:12 +08:00
restructure recipes
This commit is contained in:
parent
7ff82d6fb6
commit
3d00d41153
36 changed files with 13618 additions and 11920 deletions
12
source/recipes/python-nixpkg/shebang/main.adoc0
Normal file
12
source/recipes/python-nixpkg/shebang/main.adoc0
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
= In a Python script
|
||||
|
||||
[source,python,linenums]
|
||||
.Script
|
||||
....
|
||||
include::my-script.sh[]
|
||||
....
|
||||
|
||||
.Output
|
||||
....
|
||||
$# ./my-script.sh
|
||||
....
|
||||
11
source/recipes/python-nixpkg/shebang/my-script.sh
Executable file
11
source/recipes/python-nixpkg/shebang/my-script.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i python3 -p python3Packages.html-sanitizer
|
||||
|
||||
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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue