Skip to content

Instantly share code, notes, and snippets.

@thomp
thomp / dtk-11.el
Created February 24, 2020 18:23
fn to query diatheke and return "parsed" diatheke output
;; variant of dtk-bible--insert-using-diatheke which returns parsed diatheke output
(defun dtk-bible--parse-diatheke (book chapter-verse &optional module diatheke-output-format)
"Insert content specified by BOOK and CHAPTER-VERSE into the current buffer. CHAPTER-VERSE is a string of the form CC:VV (chapter number and verse number separated by the colon character).
Optional argument MODULE specifies the module to use."
(unless diatheke-output-format
(setq diatheke-output-format :plain))
(let ((module (or module dtk-module)))
(with-temp-buffer
(dtk-diatheke (list book chapter-verse) module t diatheke-output-format nil)
(cond ((dtk-check-for-text-obesity)
@thomp
thomp / standalone_html.py
Created December 4, 2019 22:34 — forked from pansapiens/standalone_html.py
Convert HTML to a self contained file with inline Base64 encoded PNG images
#!/usr/bin/env python
# A simple script to suck up HTML, convert any images to inline Base64
# encoded format and write out the converted file.
#
# Usage: python standalone_html.py <input_file.html> <output_file.html>
#
# TODO: Consider MHTML format: https://en.wikipedia.org/wiki/MHTML
import os
from bs4 import BeautifulSoup