mdrip
mdrip copied to clipboard
[minor] make filter.go Markdown determination more granular
Problem Statement
It appears - mdrip print - checks files for their suffixes, which means you can't extract md from non .md files,
i.e. in internal/loader/filter.go:
if filepath.Ext(info.Name()) != ".md" {
return NotMarkDownErr
}
Solution
Maybe pre-parse / validate a markdown file instead of checking its syntax.
Background
When debugging a series of markdown scripts, i started making temp files , named funny things like "try-1" , and "try-2". I didnt want MDRip to parse them by default, but i DID want to use mdrip imperatively to generate scripts from them via mdrip print.