miroesli / remove-yaml-matter

Remove YAML front matter and update file `created` date from YAML tag

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

remove-yaml-matter

The purpose of this script is to update file creation date of all files in a directory based on the created tag in YAML front matter and remove front matter from Markdown file. Path to target directory is specified explicitly in the script.

Needed to be done after exporting notes from standardnotes application and using script from standardnotes-to-markdown-yaml-export tool to convert to markdown.

Could have created an export script of my own to keep creation date, not include a YAML front matter section, and move files to foldering structure (instead of all in one folder) used with tags in standardnotes. However, the creation date was already lost after exporting notes from standardnotes application and I had already sorted the notes manually so I decided to remedy existing exported files instead.

Requirements

  • Python 3.9

Execution

pip install -r requirements.txt
python remove-yaml-matter.py >> output.log

Resources

About

Remove YAML front matter and update file `created` date from YAML tag

License:MIT License


Languages

Language:Python 100.0%