Add filetime dependency and preserve modified time of exported files#204
Merged
Add filetime dependency and preserve modified time of exported files#204
Conversation
3961b88 to
21a5756
Compare
Add a new argument --preserve-mtime to keep the original modified time attribute of notes being exported, instead of setting them to the current time.
Owner
|
Took me a while to get around to this, thank you for your patience! I made some small changes to ensure this is also applied to attachments that are copied over, and fixed some conflicts that occurred as I've been changing stuff in Many thanks for this contribution! |
zoni
added a commit
that referenced
this pull request
Nov 23, 2024
## [24.11.0](https://github.com/zoni/obsidian-export/tree/24.11.0) - 2024-11-23 ### New Features - Optionally preserve modified time of exported files Add a new argument `--preserve-mtime` to keep the original modified time attribute of notes being exported, instead of setting them to the current time. Contribution made by [Davis Davalos-DeLosh](https://github.com/Programmerino). ([#154](#154), [#204](#204)) ### Changes - Bump to the minimum supported Rust version to 1.80.0 Obsidian-export now uses [std::sync::LazyLock](https://doc.rust-lang.org/std/sync/struct.LazyLock.html) instead of [lazy_static](https://crates.io/crates/lazy_static), which was only stabilized in Rust 1.80.0. This change made it possible to drop the external dependency on lazy_static, though as a result of this, compiling with older versions will no longer be possible. ### Fixes - Don't escape square brackets in math expressions The upgrade to [pulldown-cmark](https://crates.io/crates/pulldown-cmark) 0.11 (see Backwards-incompatible Changes) includes official support for LaTeX-style math expressions. With the markdown parser supporting this syntax natively, math expressions are now processed correctly without edge-cases. ([#14](#14), [#252](#252)) ### Backwards-incompatible Changes - Upgrade [pulldown-cmark](https://crates.io/crates/pulldown-cmark) from 0.9 to 0.12 pulldown-cmark is the Markdown/CommonMark parser that is used to read and convert notes (together with [pulldown-cmark-to-cmark](https://crates.io/crates/pulldown-cmark-to-cmark)). For end-users that call the obsidian-export CLI this upgrade will be mostly transparent, except that Math blocks are now properly processed without getting mangled. People who use the library directly may face more significant breaking changes if they have custom postprocessors, as pulldown-cmark's events have gone through various breaking changes. For more information, see: - <#252> - <https://github.com/pulldown-cmark/pulldown-cmark/releases/tag/v0.10.0> - <https://github.com/zoni/obsidian-export/pull/276/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759> ([#14](#14), [#252](#252), [#259](#259), [#285](#285))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an option
--preserve-mtimewhich preserves the last modified time metadata on exported files with accompanying tests. For the purpose of making this cross-platform, it uses/adds the filetime crate