Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Delete old Markdown file when editing the EXPORT_FILE_NAME #34
Comments
kaushalmodi
added
the
requirement/spec
label
Jul 13, 2017
kaushalmodi
added
enhancement
and removed
requirement/spec
labels
Jul 22, 2017
|
One idea could be to maintain a "database" of the posts that have been exported from If we go with this idea, we could also store a hash of the subtree/post contents, to detect changes to any of the posts, and let "export all subtrees" identify and export only the changed ones. |
|
Would you like to implement this? Also I don't know what the performance impact would be for big blogs if the hash has to be calculated for dozens/hundreds of posts with, let's say, 2000 words each, for each export. Poor man solution would be to rely on git diff to see which posts changed, and export just those :) Git diff also helps catch any unintended text change in older posts. About the implementation specific to deleting old Markdown files, here's my thought: Each time a post is exported, this one property should be saved to the subtree: So.. Before first export
After first export
(assuming the extension to be always After
Here as After
.. and after the export, the |
I would like to try using the after save hook that you have provided with
This seems like a reasonable way to go about it. |
kaushalmodi commentedJul 13, 2017
If the EXPORT_FILE_NAME was "a" and then we changed that to "b", we will end up with both
a.mdandb.md.Need to figure out how to delete the old file when new file is created.