Adapted part of sec-scripts, this repo is intended to be an easy-to-find place for templates commonly used in writing emails, without extra baggage when re-using.
template.htmlcontains the base template, with placeholders fortitle,contentandsponsorsthat should all be replaced with the relevant HTML (or removed)./sponsorscontains tier-separated markdown for sponsorsmd2html.pycontains a simple script that converts given markdown into HTML:- For this script, you need
markdown-it-py==3.0.0,mdit-py-plugins==0.4.2and (if below Python 3.11)tomli==2.2.1 - You can install these via
python -m pip install -r requirements.txt - The script can be run via the command line or via importing and calling
create_htmlwith keyword arguments, with the following options provided:- Command line:
-b/--basic, function argument:no_template- Generate a plain HTML equivalent of the markdown file, without usingtemplate.htmlorsponsors.md. This isFalseif not provided. - Command line:
-f/--filename, function argument:filename- Target markdown file to generate HTML for. This isyour_content_here.mdif not provided. Example:-f woah.md. Assumes current working directory rather than script invocation path (important when submoduling). - Command line:
-rt/--remove-title, function argument:remove_title- Ignore anytitlefield found in markdown frontmatter - only relevant if you're e.g. trying to convert a markdown file fromstardust. This isFalseif not provided. - Command line:
-rb/--remove-bronze-sponsors, function argument:remove_bronze_sponsors- Don't insert HTML forsponsors/03-bronze.md. This is False if not provided. - Command line:
-rs/--remove-sponsors, function argument:remove_sponsors- Don't insert HTML forsponsors.md. This isFalseif not provided. This takes precedence overremove_bronze_sponsors.
- Command line:
- For this script, you need