diff --git a/Cargo.lock b/Cargo.lock index 3f9d224c..9696cc68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -416,9 +416,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" +checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" dependencies = [ "memchr", "serde", @@ -3515,9 +3515,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "self_cell" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c309e515543e67811222dbc9e3dd7e1056279b782e1dacffe4242b718734fb6" +checksum = "e388332cd64eb80cd595a00941baf513caffae8dce9cfd0467fc9c66397dade6" [[package]] name = "semver" @@ -3670,9 +3670,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "socket2" @@ -4026,7 +4026,7 @@ dependencies = [ [[package]] name = "tpnote" -version = "1.22.13" +version = "1.23.0" dependencies = [ "arboard", "directories", @@ -4049,7 +4049,7 @@ dependencies = [ "thiserror", "time", "toml 0.8.8", - "tpnote-lib", + "tpnote-lib 0.30.4 (registry+https://github.com/rust-lang/crates.io-index)", "webbrowser", "win32job", "windows-sys 0.48.0", @@ -4086,6 +4086,38 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "tpnote-lib" +version = "0.30.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24ee1d427130fc51900e146094f2704958686026e75af7b775af99616248ac8b" +dependencies = [ + "html-escape", + "latex2mathml", + "lazy_static", + "lingua", + "log", + "parking_lot", + "parse-hyperlinks", + "parse-hyperlinks-extras", + "percent-encoding", + "pulldown-cmark", + "rst_parser", + "rst_renderer", + "sanitize-filename-reader-friendly", + "self_cell", + "serde", + "serde_json", + "serde_yaml", + "substring", + "syntect", + "tera", + "thiserror", + "toml 0.8.8", + "win32job", + "windows-sys 0.48.0", +] + [[package]] name = "tracing" version = "0.1.40" diff --git a/Cargo.toml b/Cargo.toml index ebe63f3e..767f76d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ license = "MIT/Apache-2.0" readme = "README.md" repository = "https://gitlab.com/getreu/tp-note" rust-version = "1.70.0" -version = "1.22.13" +version = "1.23.0" [profile.release] strip = "symbols" diff --git a/docs/build/man/man1/tpnote.1 b/docs/build/man/man1/tpnote.1 index 17e7db87..de1f40a3 100644 --- a/docs/build/man/man1/tpnote.1 +++ b/docs/build/man/man1/tpnote.1 @@ -15,7 +15,7 @@ . ftr VB CB . ftr VBI CBI .\} -.TH "TP-NOTE" "1" "2023-11-08" "Version 1.22.13" "Tp-Note documentation" +.TH "TP-NOTE" "1" "2023-11-12" "Version 1.23.0" "Tp-Note documentation" .hy .SH NAME .PP @@ -616,8 +616,8 @@ be available or work as expected. .RE .RS .PP -Use `\f[V]-b -d trace\f[R]' for debugging templates and configuration -files. +Use `\f[V]-b -d trace\f[R]' for debugging templates and +`\f[V]-V -b -d trace\f[R]' for debugging configuration files. If the HTTP server (viewer) does not work as expected: `\f[V]-n -d debug\f[R]'. If your text editor does not open as expected: @@ -804,6 +804,8 @@ As most users do not expect the viewed file to change, Print Tp-Note\[cq]s version, its built-in features and the path to the sourced configuration file. The output is YAML formatted for further automatic processing. +In addition, use `\f[V]-V -b -d trace\f[R]' for configuration file +debugging. .RE .PP \f[B]-x\f[R] \f[I]DIRECTORY\f[R], \f[B]--export\f[R]=\f[I]DIRECTORY\f[R] @@ -1533,10 +1535,12 @@ into the default configuration. Then the resulting syntax is checked. If not correct, the last sourced configuration file is renamed (thus disabled) and Tp-Note starts with its internal default configuration. +For debugging, you can print out the merge result with +`\f[V]-V -b -d trace\f[R]'. .PP To write a custom configuration file, first start with a complete default configuration you can generate by invoking Tp-Note with -`\f[V]-V -b -c\f[R]'. +`\f[V]-V -b -c\f[R]' (no `\f[V]-d\f[R]'). .IP .nf \f[C] @@ -1675,6 +1679,7 @@ Consider the following example: .IP .nf \f[C] +[app_args] windows.editor = [ [ \[aq]{{ get_env(name=\[dq]LOCALAPPDATA\[dq]) }}\[rs]Programs\[rs]Microsoft VS Code\[rs]Code.exe\[aq], @@ -1691,6 +1696,7 @@ Windows for a user with the username `\f[V]Joe\f[R]' to .IP .nf \f[C] +[app_args] windows.editor = [ [ \[aq]C:\[rs]User\[rs]Joe\[rs]AppData\[rs]Local\[rs]Programs\[rs]Microsoft VS Code\[rs]Code.exe\[aq], @@ -1952,6 +1958,8 @@ extensions, that are regarded as Markdown files: .IP .nf \f[C] +[[scheme]] +name = \[dq]default\[dq] [scheme.filename] extensions = [ [ \[dq]txt\[dq], \[dq]Markdown\[dq] ], @@ -1968,16 +1976,20 @@ The default file extension for new note files is defined as: .IP .nf \f[C] +[[scheme]] +name = \[dq]default\[dq] [scheme.filename] extension_default = \[aq]md\[aq] \f[R] .fi .PP If you prefer rather the file extension `\f[V].markdown\f[R]' for new -notes, change this to: +notes, write a configuration file with: .IP .nf \f[C] +[[scheme]] +name = \[dq]default\[dq] [scheme.filename] extension_default = \[aq]markdown\[aq] \f[R] @@ -2005,6 +2017,8 @@ candidates, e.g.: .IP .nf \f[C] +[[scheme]] +name = \[dq]default\[dq] [scheme.tmpl] filter.get_lang = [ \[aq]en\[aq], @@ -2028,6 +2042,8 @@ for \[lq]add all languages\[rq]: .IP .nf \f[C] +[[scheme]] +name = \[dq]default\[dq] [scheme.tmpl] filter.get_lang = [ \[aq]+all\[aq], @@ -2052,6 +2068,8 @@ The corresponding configuration looks like this: .IP .nf \f[C] +[[scheme]] +name = \[dq]default\[dq] [scheme.tmpl] filter.map_lang = [ [ @@ -2145,6 +2163,8 @@ Consider the following simplified example: .IP .nf \f[C] +[[scheme]] +name = \[dq]default\[dq] fm_vars.localization = [ [\[dq]fm_title\[dq], \[dq]title\[dq]], [\[dq]fm_subtitle\[dq], \[dq]subtitle\[dq]], @@ -2161,6 +2181,8 @@ Example: .IP .nf \f[C] +[[scheme]] +name = \[dq]default\[dq] fm_vars.localization = [ [\[dq]fm_title\[dq], \[dq]Titel\[dq]], [\[dq]fm_subtitle\[dq], \[dq]Untertitel\[dq]], @@ -2196,20 +2218,24 @@ There is one little exception though. The following configuration variables affect the way new notes are created: .IP "1." 3 -Change the default file extension for new notes from: +The file extension for new notes is defined as: .RS 4 .IP .nf \f[C] +[[scheme]] +name = \[dq]default\[dq] [scheme.filename] extension_default=\[aq]md\[aq] \f[R] .fi .PP -to: +Overwrite this setting with the configuration file: .IP .nf \f[C] +[[scheme]] +name = \[dq]default\[dq] [scheme.filename] extension_default=\[aq]rst\[aq] \f[R] @@ -2545,7 +2571,8 @@ the text source with clickable hyperlinks: .IP .nf \f[C] -[viewer_error] +[tmpl_html] +viewer_error = \[aq]\[aq]\[aq] diff --git a/docs/source/tpnote--manpage.md b/docs/source/tpnote--manpage.md index 6e05277a..af3e395b 100644 --- a/docs/source/tpnote--manpage.md +++ b/docs/source/tpnote--manpage.md @@ -1,10 +1,10 @@ --- -title: TP-NOTE(1) Version 1.22.13 | Tp-Note documentation +title: TP-NOTE(1) Version 1.23.0 | Tp-Note documentation subtitle: manpage author: Jens Getreu -version: 1.22.13 +version: 1.23.0 filename_sync: false -date: 2023-11-08 +date: 2023-11-12 lang: en-GB --- diff --git a/docs/source/tpnote--manual.md b/docs/source/tpnote--manual.md index a71f3139..a9b086c6 100644 --- a/docs/source/tpnote--manual.md +++ b/docs/source/tpnote--manual.md @@ -2,8 +2,8 @@ title: "Tp-Note: save and edit your clipboard content as a note file" subtitle: Organize your notes with your favourite editor and markup language author: Jens Getreu -date: 2023-11-08 -version: 1.22.13 +date: 2023-11-12 +version: 1.23.0 filename_sync: false lang: en-GB --- diff --git a/tpnote-lib/Cargo.toml b/tpnote-lib/Cargo.toml index 1236aa5c..95ab1fe8 100644 --- a/tpnote-lib/Cargo.toml +++ b/tpnote-lib/Cargo.toml @@ -39,7 +39,7 @@ rst_parser = { version = "0.4.0", optional = true } # ReStructuredText renderer. rst_renderer = { version = "0.4.0", optional = true } sanitize-filename-reader-friendly.workspace = true -self_cell = "1.0.1" +self_cell = "1.0.2" serde_json = "1.0.108" serde.workspace = true serde_yaml.workspace = true diff --git a/tpnote/Cargo.toml b/tpnote/Cargo.toml index adadadf8..fcb78b45 100644 --- a/tpnote/Cargo.toml +++ b/tpnote/Cargo.toml @@ -94,8 +94,8 @@ thiserror.workspace = true time = "0.3.30" tera.workspace = true toml.workspace = true -tpnote-lib = { path = "../tpnote-lib", default-features = false } -# tpnote-lib = { version = "0.30.4", default-features = false} +# tpnote-lib = { path = "../tpnote-lib", default-features = false } +tpnote-lib = { version = "0.30.4", default-features = false} webbrowser = { version = "0.8.12", optional = true } [target.'cfg(windows)'.dependencies]