Commit Graph

199 Commits

Author SHA1 Message Date
Nick Groenen
4c74371b9e
Use /bin/bash when generating README
set -o pipefail is a bashism that not all shells support. Notably, this
fails with the default /bin/sh on GitHub Actions Linux runners
2023-09-26 09:08:56 +02:00
Nick Groenen
5985ad70d6
Run pre-commit on GitHub Actions 2023-09-26 09:06:19 +02:00
Nick Groenen
3d98d65403
Add additional common pre-commit-hooks
I have these hooks enabled on many of my projects, but for some reason
forgot them here which led to the issue described in
https://github.com/zoni/obsidian-export/pull/181

This should help prevent that from happening again.
2023-09-26 08:48:06 +02:00
Nick Groenen
06191eb66e
Regenerate README 2023-09-26 08:45:14 +02:00
Robert Sesek
43d90d7879 Rename docs/contibuting.md to docs/contribute.md
On case-insensitive filesystems, the part file conflicts with the
docs/CONTRIBUTING.md symlink.
2023-09-26 08:42:16 +02:00
Robert Sesek
cd5dbf6c3b Add a lifetime annotation to the Postprocesor type
This lets the compiler reason about the lifetimes of objects used by the
postprocessor, if the callback captures variables.

See zoni/obsidian-export#175
2023-09-25 21:50:34 +02:00
Nick Groenen
c27d7b96b6
Optimize GitHub Actions workflows
Most notably:

- Stop using unmaintained setup-rust action
- Cache cargo and target directories
- Use sccache (https://github.com/mozilla/sccache/)
2023-09-24 12:15:18 +02:00
Nick Groenen
b38e4d53b5
Remove changelog from main README file 2023-09-24 12:14:47 +02:00
Nick Groenen
b28e4913ee
Relicense to BSD-2-Clause Plus Patent License
This license achieves everything that dual-licensing under MIT + Apache
aims for, but without the weirdness of being under two licenses.

Having checked external contributions, I feel pretty confident that I
can unilaterally make this license change, as people have only
contributed a handful of one-line changes of no significance towards
copyrighted work up to this point.
2023-09-24 12:05:15 +02:00
Nick Groenen
f72ef651c0
Update transient dependencies
crates.io index
    crossbeam-deque v0.8.1 -> v0.8.3
    crossbeam-epoch v0.9.5 -> v0.9.15
    crossbeam-utils v0.8.12 -> v0.8.16
    deunicode v0.4.3 -> v0.4.4
    diff v0.1.12 -> v0.1.13
    either v1.6.1 -> v1.9.0
    futures v0.3.25 -> v0.3.28
    futures-channel v0.3.25 -> v0.3.28
    futures-core v0.3.25 -> v0.3.28
    futures-executor v0.3.25 -> v0.3.28
    futures-io v0.3.25 -> v0.3.28
    futures-macro v0.3.25 -> v0.3.28
    futures-sink v0.3.25 -> v0.3.28
    futures-task v0.3.25 -> v0.3.28
    futures-util v0.3.25 -> v0.3.28
    heck v0.4.0 -> v0.4.1
    itoa v1.0.4 -> v1.0.9
    log v0.4.14 -> v0.4.20
    memoffset v0.6.5 -> v0.9.0
    once_cell v1.9.0 -> v1.18.0
    pin-project-lite v0.2.9 -> v0.2.13
    ryu v1.0.11 -> v1.0.15
    scopeguard v1.1.0 -> v1.2.0
    semver v1.0.14 -> v1.0.19
    serde v1.0.147 -> v1.0.188
    serde_derive v1.0.188
    slab v0.4.7 -> v0.4.9
    syn v1.0.104 -> v1.0.109
    thread_local v1.1.4 -> v1.1.7
    tinyvec_macros v0.1.0 -> v0.1.1
    unicase v2.6.0 -> v2.7.0
    unicode-ident v1.0.5 -> v1.0.12
    unicode-width v0.1.10 -> v0.1.11
    winapi-util v0.1.5 -> v0.1.6
2023-09-23 10:42:07 +02:00
dependabot[bot]
143f4fe1cd
Bump rayon from 1.6.0 to 1.8.0 (#174) 2023-09-23 08:23:09 +00:00
dependabot[bot]
33707d67a5
Bump walkdir from 2.3.2 to 2.4.0 (#173) 2023-09-23 08:22:38 +00:00
dependabot[bot]
88b2378862
Bump regex from 1.9.4 to 1.9.5 (#178)
Bumps [regex](https://github.com/rust-lang/regex) from 1.9.4 to 1.9.5.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.9.4...1.9.5)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-23 09:39:47 +02:00
dependabot[bot]
52d400ff01
Bump rstest from 0.17.0 to 0.18.2 (#179) 2023-09-23 07:39:37 +00:00
dependabot[bot]
b67aef7cdc
Bump actions/checkout from 3 to 4 (#177) 2023-09-23 07:38:42 +00:00
dependabot[bot]
d76bbdb3b7
Bump ignore from 0.4.18 to 0.4.20 (#145) 2023-09-22 09:59:06 +00:00
dependabot[bot]
0dd235279e
Bump pulldown-cmark from 0.9.2 to 0.9.3 (#165) 2023-09-22 09:46:48 +00:00
dependabot[bot]
e197ac3408
Bump tempfile from 3.3.0 to 3.8.0 (#172) 2023-09-22 09:43:56 +00:00
dependabot[bot]
33c57f2322
Bump snafu from 0.7.3 to 0.7.5 (#164) 2023-09-22 09:43:30 +00:00
dependabot[bot]
ae87431847
Bump pulldown-cmark-to-cmark from 10.0.4 to 11.0.0 (#168) 2023-09-22 09:42:21 +00:00
dependabot[bot]
942b954a48
Bump serde_yaml from 0.9.14 to 0.9.25 (#167) 2023-09-22 09:39:01 +00:00
dependabot[bot]
277e057191
Bump rstest from 0.16.0 to 0.17.0 (#166) 2023-09-22 09:35:03 +00:00
dependabot[bot]
90573cab3e
Bump regex from 1.7.0 to 1.9.4 (#170) 2023-09-22 09:32:44 +00:00
dependabot[bot]
29772f8f5c
Bump percent-encoding from 2.2.0 to 2.3.0 (#171) 2023-09-22 09:32:25 +00:00
dependabot[bot]
303e2053be
Bump pretty_assertions from 1.3.0 to 1.4.0 (#169) 2023-09-22 09:31:11 +00:00
Nick Groenen
cb6abedcad
Fix code coverage CI failures 2023-09-22 11:20:32 +02:00
Nick Groenen
4b636c4402
Fix 4 new clippy lints 2023-09-22 11:16:29 +02:00
dependabot[bot]
80130260e9
Bump rstest from 0.15.0 to 0.16.0 (#135)
Bumps [rstest](https://github.com/la10736/rstest) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/la10736/rstest/releases)
- [Changelog](https://github.com/la10736/rstest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/la10736/rstest/compare/0.15.0...0.16.0)

---
updated-dependencies:
- dependency-name: rstest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 10:54:47 +01:00
dependabot[bot]
500f0fb86b
Bump rayon from 1.5.3 to 1.6.0 (#134)
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.5.3 to 1.6.0.
- [Release notes](https://github.com/rayon-rs/rayon/releases)
- [Changelog](https://github.com/rayon-rs/rayon/blob/master/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/v1.5.3...rayon-core-v1.6.0)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 10:54:28 +01:00
Nick Groenen
83ab69aedd
Release v22.11.0 2022-11-19 17:12:13 +01:00
Nick Groenen
b5b2ea2c3b
New: apply unicode normalization while resolving notes
The unicode standard allows for certain (visually) identical characters to
be represented in different ways.

For example the character ä may be represented as a single combined
codepoint "Latin Small Letter A with Diaeresis" (U+00E4) or by the
combination of "Latin Small Letter A" (U+0061) followed by "Combining
Diaeresis" (U+0308).

When encoded with UTF-8, these are represented as respectively the two
bytes 0xC3 0xA4, and the three bytes 0x61 0xCC 0x88.

A user linking to notes with these characters in their titles would
expect these two variants to link to the same file, given they are
visually identical and have the exact same semantic meaning.

The unicode standard defines a method to deconstruct and normalize these
forms, so that a byte comparison on the normalized forms of these
variants ends up comparing the same thing. This is called Unicode
Normalization, defined in Unicode® Standard Annex #15
(http://www.unicode.org/reports/tr15/).

The W3C Working Group has written an excellent explanation of the
problems regarding string matching, and how unicode normalization helps
with this process: https://www.w3.org/TR/charmod-norm/#unicodeNormalization

With this change, obsidian-export will perform unicode normalization
(specifically the C (or NFC) normalization form) on all note titles
while looking up link references, ensuring visually identical links are
treated as being similar, even if they were encoded as different
variants.

A special thanks to Hans Raaf (@oderwat) for reporting and helping track
down this issue.

---

Closes #126
2022-11-19 16:58:48 +01:00
Chang-Yen Tseng
c5ba5b7aef
Use path.Join to construct hugo links (#92)
Use path.Join so that it will render correctly on Windows
(path.Join will convert Windows backslash to forward slash)
2022-11-15 18:07:18 +01:00
dependabot[bot]
9bce284697 Bump crossbeam-utils from 0.8.5 to 0.8.12
Bumps [crossbeam-utils](https://github.com/crossbeam-rs/crossbeam) from 0.8.5 to 0.8.12.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-utils-0.8.5...crossbeam-utils-0.8.12)

---
updated-dependencies:
- dependency-name: crossbeam-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-15 17:55:54 +01:00
dependabot[bot]
f2a0d1c041 Bump regex from 1.6.0 to 1.7.0
Bumps [regex](https://github.com/rust-lang/regex) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.6.0...1.7.0)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-15 17:55:38 +01:00
dependabot[bot]
0659924635 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-05 15:41:22 +01:00
dependabot[bot]
7a3f278e4b Bump actions/upload-artifact from 2 to 3
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-05 15:41:06 +01:00
dependabot[bot]
89ad2d0e66 Bump thread_local from 1.1.3 to 1.1.4
Bumps [thread_local](https://github.com/Amanieu/thread_local-rs) from 1.1.3 to 1.1.4.
- [Release notes](https://github.com/Amanieu/thread_local-rs/releases)
- [Commits](https://github.com/Amanieu/thread_local-rs/compare/v1.1.3...1.1.4)

---
updated-dependencies:
- dependency-name: thread_local
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-05 15:39:37 +01:00
Nick Groenen
be5cf58c1a
Remove needless borrows 2022-11-05 15:37:20 +01:00
Nick Groenen
6af4c9140c
Upgrade snafu to 0.7.x 2022-11-05 14:38:02 +01:00
Nick Groenen
17d0e3df7e
Upgrade pulldown-cmark-to-cmark to 10.0.x 2022-11-05 14:38:02 +01:00
Nick Groenen
262f22ba70
Upgrade serde_yaml to 0.9.x 2022-11-05 14:38:02 +01:00
Nick Groenen
0535de53a9
Upgrade minor dependencies 2022-11-05 14:37:56 +01:00
Nick Groenen
868f1132bc
Fix new clippy lints 2022-11-05 14:18:53 +01:00
Nick Groenen
586530cac8 Add a contributor guide 2022-11-05 14:15:18 +01:00
Nick Groenen
081eb6c9ab
Simplify pre-commit setup
No need to depend on a third-party hook repository when each of these
checks is easily defined and run through system commands.

This also allows us to actually run tests, which is current unsupported
(https://github.com/doublify/pre-commit-rust/pull/19)
2022-01-16 17:06:52 +01:00
Nick Groenen
d25c6d80c6 Chg: Pass context and events as mutable references to postprocessors
Instead of passing clones of context and the markdown tree to
postprocessors, pass them a mutable reference which may be modified
in-place.

This is a breaking change to the postprocessor implementation, changing
both the input arguments as well as the return value:

```diff
-    dyn Fn(Context, MarkdownEvents) -> (Context, MarkdownEvents, PostprocessorResult) + Send + Sync;
+    dyn Fn(&mut Context, &mut MarkdownEvents) -> PostprocessorResult + Send + Sync;
```

With this change the postprocessor API becomes a little more ergonomic
to use however, especially making the intent around return statements more clear.
2022-01-16 11:53:15 +01:00
dependabot[bot]
85adc314b6 Bump tempfile from 3.2.0 to 3.3.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/Stebalien/tempfile/releases)
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/NEWS)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 20:30:36 +01:00
Nick Groenen
86af6bbf37
Release v22.1.0 2022-01-02 12:28:25 +01:00
Nick Groenen
67cd5ac738
Give release binaries file extensions
This may make it more clear to users that these are precompiled, binary
files. This is especially relevant on Windows, where the convention is
that executable files have a .exe` extension, as seen in #49.
2022-01-02 12:08:50 +01:00
Nick Groenen
84308c9f1f
New: support Obsidian's "Strict line breaks" setting
This change introduces a new `--hard-linebreaks` CLI argument. When
used, this converts soft line breaks to hard line breaks, mimicking
Obsidian's "Strict line breaks" setting.

Implementation detail: I considered naming this flag
`--strict-line-breaks` to be consistent with Obsidian itself, however I
feel the name is somewhat misleading and ill-chosen.
2022-01-02 00:42:51 +01:00