readFile¶
-
EditFrontMatter.readFile(file_path=None, *args, **kwargs) → None[source]¶ - Read a file into
file_lineslist (if applicable) and seperate the front matter into
fmatteryaml object. This function resetsfmatter.
- Parameters
file_path (str) – optional file path
Hint
If local file_path:None and
file_path:None,file_linesshould be populated before calling this function.In the example below, the initialization would fail if do_readFile:True:
proc = EditFrontMatter(do_readFile=False) proc.file_lines = ''.join(open(RUN_PATH + "example.md", "r").readlines()) # initialize proc.fmatter and record data position proc.readFile() ...
Note
If the file source content is empty
file_emptyis set to True. This affectsdumpFileData()andwriteFile()behavior- Read a file into