Skip to content

Instantly share code, notes, and snippets.

@maxmarchuk
maxmarchuk / CKEditor specialChar description getter
Last active January 31, 2017 23:50
A python script for getting the descriptions of special characters (such as greek letters or math symbols) by parsing http://www.dionysia.org/html/entities/symbols.html. The output is in a format used for CKEditor's specialChars configuration to use the description as the tooltip for the characters.
#!/usr/local/bin/python3
from lxml import html
import requests
try:
file = open("./symbols.txt")
file_string = file.read().split()
except:
file_string = 'Α α Β β Γ γ Δ δ Ε ε Ζ ζ Η η Θ θ Ι'.split()