Skip to content

Add filetime dependency and preserve modified time of exported files#204

Merged
zoni merged 1 commit intozoni:mainfrom
Programmerino:preserve_mtime
Aug 4, 2024
Merged

Add filetime dependency and preserve modified time of exported files#204
zoni merged 1 commit intozoni:mainfrom
Programmerino:preserve_mtime

Conversation

@Programmerino
Copy link
Contributor

Adds an option --preserve-mtime which 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

@zoni zoni force-pushed the preserve_mtime branch 2 times, most recently from 3961b88 to 21a5756 Compare August 4, 2024 11:50
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.
@zoni zoni merged commit 564bee1 into zoni:main Aug 4, 2024
@zoni
Copy link
Owner

zoni commented Aug 4, 2024

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 main.

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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants