compact-theme / utils.py
deepkyu
update renderer code
559cddd
raw
history blame contribute delete
271 Bytes
from pathlib import Path
from urllib import request
def get_snippet_from_url(url: str) -> str:
response = request.urlopen(url)
data = response.read().decode()
return data
def get_snippet_from_file(filepath: str) -> str:
return Path(filepath).read_text()