This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
md-pdf/md_pdf/build/md.py

14 lines
361 B
Python
Raw Normal View History

2017-03-27 09:17:49 +01:00
import glob
2017-06-09 23:07:30 +01:00
from typing import Generator, List
2017-03-27 09:17:49 +01:00
2017-03-30 09:00:42 +01:00
2017-06-09 23:07:30 +01:00
def get_files_content(filenames: List[str]) -> Generator[str, None, None]:
2017-03-27 09:17:49 +01:00
for filename in filenames:
with open(filename) as f:
yield f.read()
2017-06-09 23:07:30 +01:00
def read_files(files_glob: str) -> str:
2017-04-09 15:34:01 +01:00
filenames = sorted(glob.glob(files_glob))
2017-03-27 09:17:49 +01:00
return '\n'.join(list(get_files_content(filenames)))