Commit Graph

170 Commits

Author SHA1 Message Date
dependabot[bot] cd5b1503da
Bump regex from 1.4.6 to 1.5.3
Bumps [regex](https://github.com/rust-lang/regex) from 1.4.6 to 1.5.3.
- [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.4.6...1.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 06:39:59 +00:00
Nick Groenen 51d263439d
Merge pull request #19 from zoni/dependabot/cargo/pretty_assertions-0.7.2
Bump pretty_assertions from 0.7.1 to 0.7.2
2021-04-26 13:06:37 +02:00
Nick Groenen 5ff990ca20
Merge pull request #21 from zoni/dependabot/cargo/regex-1.4.6
Bump regex from 1.4.5 to 1.4.6
2021-04-26 12:41:05 +02:00
dependabot[bot] 9382ca2479
Bump regex from 1.4.5 to 1.4.6
Bumps [regex](https://github.com/rust-lang/regex) from 1.4.5 to 1.4.6.
- [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.4.5...1.4.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 06:31:06 +00:00
dependabot[bot] d436727f9f
Bump pretty_assertions from 0.7.1 to 0.7.2
Bumps [pretty_assertions](https://github.com/colin-kiegel/rust-pretty-assertions) from 0.7.1 to 0.7.2.
- [Release notes](https://github.com/colin-kiegel/rust-pretty-assertions/releases)
- [Changelog](https://github.com/colin-kiegel/rust-pretty-assertions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/colin-kiegel/rust-pretty-assertions/compare/v0.7.1...v0.7.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-19 06:13:42 +00:00
Nick Groenen 05b5a56d55
Release v0.7.0 2021-04-11 16:33:03 +02:00
Nick Groenen 5e8e8b9c96
Update release checklist 2021-04-11 16:33:03 +02:00
Nick Groenen 84a9abc98d
Add extra license disclaimer 2021-04-11 16:27:07 +02:00
Nick Groenen 50e9a3a3a3
Document workaround for relative links issue with Hugo 2021-04-11 16:22:35 +02:00
Nick Groenen c7b1500e6f
Merge pull request #16 from zoni/dependabot/cargo/pretty_assertions-0.7.1
Bump pretty_assertions from 0.6.1 to 0.7.1
2021-04-11 15:57:56 +02:00
Nick Groenen f2e55f285a
Merge pull request #18 from zoni/dependabot/cargo/walkdir-2.3.2
Bump walkdir from 2.3.1 to 2.3.2
2021-04-11 15:57:52 +02:00
Nick Groenen f95afd768c
Merge pull request #15 from zoni/dependabot/cargo/regex-1.4.5
Bump regex from 1.4.3 to 1.4.5
2021-04-11 15:57:46 +02:00
Nick Groenen 638e83e9dc
Simplify and improve documentation
This removes mdBook in favor of a flat docs folder generating a single
`README.md` in the repository root.

Installation and usage instructions have also been expanded slightly.
2021-04-11 15:39:54 +02:00
dependabot[bot] af403e8daf
Bump regex from 1.4.3 to 1.4.5
Bumps [regex](https://github.com/rust-lang/regex) from 1.4.3 to 1.4.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.4.3...1.4.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-11 12:10:12 +00:00
Nick Groenen 831fd162e3
Merge pull request #10 from zoni/postprocessing
Add support for postprocessing
2021-04-11 14:08:58 +02:00
Nick Groenen 58eb79e53d
new: postprocessing support
Add support for postprocessing of Markdown prior to writing converted
notes to disk.

Postprocessors may be used when making use of Obsidian export as a Rust
library to do the following:

1. Modify a note's `Context`, for example to change the destination
   filename or update its Frontmatter.
2. Change a note's contents by altering `MarkdownEvents`.
3. Prevent later postprocessors from running or cause a note to be
   skipped entirely.

Future releases of Obsidian export may come with built-in postprocessors
for users of the command-line tool to use, if general use-cases can be
identified.

For example, a future release might include functionality to make notes
more suitable for the Hugo static site generator. This functionality
would be implemented as a postprocessor that could be enabled through
command-line flags.
2021-04-11 13:52:40 +02:00
dependabot[bot] 33ea2dea47
Bump walkdir from 2.3.1 to 2.3.2
Bumps [walkdir](https://github.com/BurntSushi/walkdir) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/BurntSushi/walkdir/releases)
- [Commits](https://github.com/BurntSushi/walkdir/compare/2.3.1...2.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-29 06:26:37 +00:00
dependabot[bot] 95dee59d6c
Bump pretty_assertions from 0.6.1 to 0.7.1
Bumps [pretty_assertions](https://github.com/colin-kiegel/rust-pretty-assertions) from 0.6.1 to 0.7.1.
- [Release notes](https://github.com/colin-kiegel/rust-pretty-assertions/releases)
- [Changelog](https://github.com/colin-kiegel/rust-pretty-assertions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/colin-kiegel/rust-pretty-assertions/compare/v0.6.1...v0.7.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-15 06:24:40 +00:00
Nick Groenen f0dd6f7132
Fix: also percent-encode `?` in filenames
A recent Obsidian update expanded the list of allowed characters in
filenames, which now includes `?` as well. This needs to be
percent-encoded for proper links in static site generators like Hugo.
2021-02-16 09:13:04 +01:00
Nick Groenen 5f615e8ee0
Update lockfile 2021-02-15 21:42:35 +01:00
Nick Groenen b54d4b46e7
Release v0.6.0 2021-02-15 21:38:17 +01:00
Nick Groenen ecf55d25db
Avoid redundant "Release" in GitHub release titles 2021-02-15 21:26:10 +01:00
Nick Groenen acfacc690b
New: add `--version` flag 2021-02-15 21:24:23 +01:00
Nick Groenen e85421609e
Merge pull request #11 from zoni/notes-with-underscores
Recognize notes beginning with underscores
2021-02-15 19:46:05 +01:00
Nick Groenen cfd07dc5c7
Fix: Recognize notes beginning with underscores
Notes with an underscore would fail to be recognized within Obsidian
`[[_WikiLinks]]` due to the assumption that the underlying Markdown
parser (pulldown_cmark) would emit the text between [[ and ]] as a
single event.

The note parser has now been rewritten to use a more reliable state
machine which correctly recognizes this corner-case (and likely some
others).
2021-02-15 19:41:31 +01:00
Nick Groenen 138965a764
Add failing testcase for files with underscores 2021-02-15 19:41:27 +01:00
Nick Groenen 2635cdb3a7
Add unit tests for display of ObsidianNoteReference 2021-02-15 12:19:02 +01:00
Nick Groenen 25233cec4a
Add some unit tests for ObsidianNoteReference::from_str 2021-02-15 12:09:08 +01:00
Nick Groenen 2fa34fb5db
Also run tests on pull requests 2021-02-14 20:48:52 +01:00
Nick Groenen f94753c511
Chg: Don't Box FilterFn in WalkOptions
Previously, `filter_fn` on the `WalkOptions` struct looked like:

    pub filter_fn: Option<Box<&'static FilterFn>>,

This boxing was unneccesary and has been changed to:

    pub filter_fn: Option<&'static FilterFn>,

This will only affect people who use obsidian-export as a library in
other Rust programs, not users of the CLI.

For those library users, they no longer need to supply `FilterFn`
wrapped in a Box.
2021-02-12 13:37:00 +01:00
Nick Groenen 7c7042d1dd
Apply clippy suggestions following rust 1.50.0 2021-02-12 13:36:59 +01:00
Nick Groenen 96535aef6e
Merge pull request #9 from joshuacoles/feature-same-file-section-links
Allow references to blocks/headers within the same files
2021-02-12 13:07:08 +01:00
Joshua Coles f76fc22312 Fix infinite recursion bug with references to current file. 2021-02-09 11:32:10 +00:00
Joshua Coles 60d41672a5 Add tests for self-references
Note as there is no support for block references at the moment, the generated link goes nowhere, however it is to a reasonable ID
2021-02-09 10:36:39 +00:00
Joshua Coles 9418f20d61 Support self-references 2021-02-03 17:45:33 +00:00
Nick Groenen 8e4238645b
Merge pull request #6 from zoni/dependabot/cargo/tempfile-3.2.0
Bump tempfile from 3.1.0 to 3.2.0
2021-01-18 18:35:26 +01:00
dependabot[bot] 1158c36e7c
Bump tempfile from 3.1.0 to 3.2.0
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/Stebalien/tempfile/releases)
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/NEWS)
- [Commits](https://github.com/Stebalien/tempfile/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-18 06:46:11 +00:00
Nick Groenen 7360661fa3
Merge pull request #5 from zoni/dependabot/cargo/eyre-0.6.5
Bump eyre from 0.6.3 to 0.6.5
2021-01-16 11:47:04 +01:00
Nick Groenen 5430da2cef
Merge pull request #4 from zoni/dependabot/cargo/regex-1.4.3
Bump regex from 1.4.2 to 1.4.3
2021-01-16 11:46:53 +01:00
dependabot[bot] 751dcc39f0
Bump eyre from 0.6.3 to 0.6.5
Bumps [eyre](https://github.com/yaahc/eyre) from 0.6.3 to 0.6.5.
- [Release notes](https://github.com/yaahc/eyre/releases)
- [Changelog](https://github.com/yaahc/eyre/blob/v0.6.5/CHANGELOG.md)
- [Commits](https://github.com/yaahc/eyre/compare/v0.6.3...v0.6.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 06:36:23 +00:00
dependabot[bot] c67d4fde2c
Bump regex from 1.4.2 to 1.4.3
Bumps [regex](https://github.com/rust-lang/regex) from 1.4.2 to 1.4.3.
- [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.4.2...1.4.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 06:36:21 +00:00
Nick Groenen 63186b4370
Release v0.5.1 2021-01-10 19:55:54 +01:00
Nick Groenen e6fc611b58
fix: find uppercased notes when referenced with lowercase
This commit fixes a bug where, if a note contained uppercase characters
(for example `Note.md`) but was referred to using lowercase
`(`[[note]]`), that note would not be found.
2021-01-10 19:43:28 +01:00
Nick Groenen d330af3989
Release v0.5.0 2021-01-05 15:47:35 +01:00
Nick Groenen a0cef3d9c8
New: Add --no-recursive-embeds to break infinite recursion cycles
It's possible to end up with "recursive embeds" when two notes embed
each other. This happens for example when a `Note A.md` contains
`![[Note B]]` but `Note B.md` also contains `![[Note A]]`.

By default, this will trigger an error and display the chain of notes
which caused the recursion.

Using the new `--no-recursive-embeds`, if a note is encountered for a
second time while processing the original note, rather than embedding it
again a link to the note is inserted instead to break the cycle.

See also: https://github.com/zoni/obsidian-export/issues/1
2021-01-05 15:45:34 +01:00
Nick Groenen cdb2517365
new: make walk options configurable on CLI
By default hidden files, patterns listed in `.export-ignore` as well as
any files ignored by git are excluded from exports. This behavior has
been made configurable on the CLI using the new flags `--hidden`,
`--ignore-file` and `--no-git`.
2021-01-05 00:05:17 +01:00
Nick Groenen 4401123ea1
chg: print warnings to stderr rather than stdout
Warning messages emitted when encountering broken links/references will
now be printed to stderr as opposed to stdout.
2021-01-04 21:45:00 +01:00
Nick Groenen 6033407266
new: support links referencing headings
Previously, links referencing a heading (`[[note#heading]]`) would just
link to the file name without including an anchor in the link target.
Now, such references will include an appropriate `#anchor` attribute.

Note that neither the original Markdown specification, nor the more
recent CommonMark standard, specify how anchors should be constructed
for a given heading.

There are also some differences between the various Markdown rendering
implementations.

Obsidian-export uses the [slug] crate to generate anchors which should
be compatible with most implementations, however your mileage may vary.

(For example, GitHub may leave a trailing `-` on anchors when headings
end with a smiley. The slug library, and thus obsidian-export, will
avoid such dangling dashes).

[slug]: https://crates.io/crates/slug
2021-01-04 21:45:00 +01:00
Nick Groenen fcb4cd9dec
new: support embeds referencing headings
Previously, partial embeds (`![[note#heading]]`) would always include
the entire file into the source note. Now, such embeds will only include
the contents of the referenced heading (and any subheadings).

Links and embeds of [arbitrary blocks] remains unsupported at this time.

[arbitrary blocks]: https://publish.obsidian.md/help/How+to/Link+to+blocks
2021-01-04 19:12:51 +01:00
Nick Groenen cc58ca01a5
Include filter_fn field in WalkOptions debug display 2020-12-24 00:05:36 +01:00