Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Use exclude keyword to skip markdown files #1370
This change slightly modifies the functionality of the copy_media_files() function by changing the behavior of the unused exclude option to be a list extensions rather than a list of Unix shell patterns.
This function is only called in
I also add a variable to define markdown extensions in a single place.
This change will greatly simplify life for a plugin developer who wishes to reused this functionality (namely me).
So my plugin to copy markdown files can simply consist of:
utils.copy_media_files(config['docs_dir'], config['site_dir'], exclude = , dirty=True)
I understand this may get rejected as there is a private refactor in progress for the next release, but please consider allowing for a similarly flexible util function in the future.
First of all,
Second, why would you want to switch from the more powerful Unix shell patterns to file extensions only? That would be a regression to a less powerful solution.
That said, having Markdown extensions defined in one place makes sense. And using the
Strange that I missed that call with
For the change away from patterns there is no motivation other than it appeared unused and was convenient for passing a list of extensions.
Some design choices:
Looks good. Just a few suggested changes and I would be happy to accept this.
Sorry I missed this before, but could you add an entry to the release notes? Just add a new section above the most recent release titled "Development Version" followed by a list item briefly summarizing this change and referencing this PR. Similar to what was done here. Thanks.
Otherwise, it looks good.