This hacky plugin adds a post list to a file in post-processing, useful when you want post text out of a post list.
Use with care.
Usage:
Here is my hacky post list:
.. listofpostsgoeshereThis hacky plugin adds a post list to a file in post-processing, useful when you want post text out of a post list.
Use with care.
Usage:
Here is my hacky post list:
.. listofpostsgoeshere| for key, value in ( | |
| ("host", host,), | |
| ("port", port,), | |
| ("user", username,), | |
| ("password", password,), | |
| ): |
| if True: | |
| if True: | |
| for key, value in (("host", host,), | |
| ("port", port,), | |
| ("user", username,), | |
| ("password", password,),): | |
| pass |
| input = ['foo deinstall 1', 'foo install 2', 'bar install 3', 'bar deinstall 4', 'foo bar 5'] | |
| for i in input: | |
| # If the lines start or end with (de)install, you could try startswith/endswith instead. | |
| if 'deinstall' in i: | |
| print("Will deinstall:", i) | |
| elif 'install' in i: | |
| print("Will install:", i) | |
| else: | |
| print("Unrecognized:", i) |
| # Don’t use this, use itertools.zip_longest() instead! | |
| def alternate_all(*args): | |
| ls = [iter(i) for i in args] | |
| stops = 0 # cheat and get 9 LOC by making this a keyword argument | |
| while stops != len(ls): | |
| stops = 0 | |
| for l in ls: | |
| try: | |
| yield next(l) | |
| except StopIteration: |
| #!/usr/bin/env python3 | |
| from passlib.hash import bcrypt_sha256 | |
| print('u/u', end='') | |
| try: | |
| bcrypt_sha256.verify('admin', '$bcrypt-sha256$2a,12$St3N7xoStL7Doxpvz78Jve$3vKfveUNhMNhvaFEfJllWEarb5oNgNu') | |
| print(' +') | |
| except TypeError: | |
| print(' F') |
| #!/usr/bin/env python3 | |
| from passlib.hash import bcrypt_sha256 | |
| print('u/u', end='') | |
| try: | |
| v = bcrypt_sha256.verify('admin', '$bcrypt-sha256$2a,12$St3N7xoStL7Doxpvz78Jve$3vKfveUNhMNhvaFEfJllWEarb5oNgNu') | |
| print(' +' if v else ' -') | |
| except TypeError: | |
| print(' F') |
| NIKOLA(1) User Commands NIKOLA(1) | |
| NAME | |
| Nikola - A Static Site and Blog Generator | |
| SYNOPSIS | |
| Create an empty site (with a setup wizard): | |
| nikola init mysite |
| #!/usr/bin/env python3 | |
| import re | |
| data = """# Foo | |
| Print a string. | |
| ```sh | |
| echo "foo" | |
| ``` |