From ad0d0ffe7c9313027405cd6dc8d9e498122d0175 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Fri, 15 Mar 2024 11:08:23 -0400 Subject: [PATCH 1/7] description: remove footnotes This change remove any footnotes from the og:description header. --- emanote/src/Emanote/Model/Note.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/emanote/src/Emanote/Model/Note.hs b/emanote/src/Emanote/Model/Note.hs index 3c81c6648..b07bf4d65 100644 --- a/emanote/src/Emanote/Model/Note.hs +++ b/emanote/src/Emanote/Model/Note.hs @@ -387,7 +387,7 @@ applyNoteMetaFilters doc = ) addDescriptionFromBody = overrideAesonText ("page" :| ["description"]) $ \case - B.Para is -> [WL.plainify is] + B.Para is -> [WL.plainify (mapMaybe removeInlineNotes is)] _ -> mempty -- FIXME this doesn't take splice rendering into account. Specifically, -- `![[foo.jpeg]]` is not handled at all. @@ -406,4 +406,10 @@ applyNoteMetaFilters doc = pure $ SData.oneAesonText (toList key) val ) +-- TODO: apply this recursively +removeInlineNotes :: B.Inline -> Maybe B.Inline +removeInlineNotes = \case + B.Note{} -> Nothing + a -> Just a + makeLenses ''Note From 36a68af39512e9b4270212162e943cfa36288d89 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar <3998+srid@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:52:17 -0400 Subject: [PATCH 2/7] Update emanote.cabal --- emanote/emanote.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emanote/emanote.cabal b/emanote/emanote.cabal index 95ed80370..e2efb1793 100644 --- a/emanote/emanote.cabal +++ b/emanote/emanote.cabal @@ -1,6 +1,6 @@ cabal-version: 2.4 name: emanote -version: 1.3.16.0 +version: 1.3.17.0 license: AGPL-3.0-only copyright: 2022 Sridhar Ratnakumar maintainer: srid@srid.ca From b23551a4c1afc8b1b87e343d81b81dd634fa338f Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar <3998+srid@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:53:08 -0400 Subject: [PATCH 3/7] Update CHANGELOG.md --- emanote/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/emanote/CHANGELOG.md b/emanote/CHANGELOG.md index afeb51c3f..c6a7a4609 100644 --- a/emanote/CHANGELOG.md +++ b/emanote/CHANGELOG.md @@ -26,6 +26,7 @@ - Enable auto identifier for org files ([\#502](https://github.com/srid/emanote/pull/502)) - Bug fixes: - Emanote no longer crashes when run on an empty directory ([\#487](https://github.com/srid/emanote/issues/487)) + - Remove footnotes from `og:description` ([\#529](https://github.com/srid/emanote/pull/529)) - Stork search fixes - Fix empty stork index generation when using more than 1 layer ([\#493](https://github.com/srid/emanote/issues/493)) - Stork search index is now uses note path from their associated layer ([\#495](https://github.com/srid/emanote/pull/495)) From 47fc8b91a68159166ed1ced6c0d1adbbdccd0e04 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Fri, 15 Mar 2024 18:08:58 -0400 Subject: [PATCH 4/7] Update heist-extra to handle footnote removal from description --- emanote/src/Emanote/Model/Note.hs | 8 +------- flake.lock | 7 ++++--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/emanote/src/Emanote/Model/Note.hs b/emanote/src/Emanote/Model/Note.hs index b07bf4d65..3c81c6648 100644 --- a/emanote/src/Emanote/Model/Note.hs +++ b/emanote/src/Emanote/Model/Note.hs @@ -387,7 +387,7 @@ applyNoteMetaFilters doc = ) addDescriptionFromBody = overrideAesonText ("page" :| ["description"]) $ \case - B.Para is -> [WL.plainify (mapMaybe removeInlineNotes is)] + B.Para is -> [WL.plainify is] _ -> mempty -- FIXME this doesn't take splice rendering into account. Specifically, -- `![[foo.jpeg]]` is not handled at all. @@ -406,10 +406,4 @@ applyNoteMetaFilters doc = pure $ SData.oneAesonText (toList key) val ) --- TODO: apply this recursively -removeInlineNotes :: B.Inline -> Maybe B.Inline -removeInlineNotes = \case - B.Note{} -> Nothing - a -> Just a - makeLenses ''Note diff --git a/flake.lock b/flake.lock index 0305dac51..ece247a9b 100644 --- a/flake.lock +++ b/flake.lock @@ -315,16 +315,17 @@ "heist-extra_2": { "flake": false, "locked": { - "lastModified": 1706086475, - "narHash": "sha256-scXMVFKSaS4Wi4y6I84oPKHaTmLECsvq8eLxGL0XH5o=", + "lastModified": 1710540309, + "narHash": "sha256-wjw8WlisTMxXefPu/yzXCr4CAlwZ0Nf20P/MHzqx784=", "owner": "srid", "repo": "heist-extra", - "rev": "c6d8ef79b415fab276fb461d5860bbf2628e6e43", + "rev": "58dafa81fa2194db70fae83623c610a80a4c6899", "type": "github" }, "original": { "owner": "srid", "repo": "heist-extra", + "rev": "58dafa81fa2194db70fae83623c610a80a4c6899", "type": "github" } }, From 2edffed61c948d55f8c951f4e00b98e1f4d4aea7 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 18 Mar 2024 18:50:41 -0400 Subject: [PATCH 5/7] Use correct flake input --- flake.lock | 12 ++++++------ flake.nix | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index ece247a9b..0f0a4d379 100644 --- a/flake.lock +++ b/flake.lock @@ -315,17 +315,17 @@ "heist-extra_2": { "flake": false, "locked": { - "lastModified": 1710540309, - "narHash": "sha256-wjw8WlisTMxXefPu/yzXCr4CAlwZ0Nf20P/MHzqx784=", - "owner": "srid", + "lastModified": 1710545904, + "narHash": "sha256-5DMmK7LaMVgcvBP+m467CXWnNS6bn8XDMaOx6AgeAiI=", + "owner": "TristanCacqueray", "repo": "heist-extra", - "rev": "58dafa81fa2194db70fae83623c610a80a4c6899", + "rev": "fdd4616ff8ec8a8bd2d934347d25b2ffbd6ad982", "type": "github" }, "original": { - "owner": "srid", + "owner": "TristanCacqueray", + "ref": "ignore-note", "repo": "heist-extra", - "rev": "58dafa81fa2194db70fae83623c610a80a4c6899", "type": "github" } }, diff --git a/flake.nix b/flake.nix index d81450ef4..f11f858fc 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,7 @@ ema.inputs.treefmt-nix.follows = "treefmt-nix"; ema.inputs.flake-root.follows = "flake-root"; - heist-extra.url = "github:srid/heist-extra"; + heist-extra.url = "github:TristanCacqueray/heist-extra/ignore-note"; heist-extra.flake = false; unionmount.url = "github:srid/unionmount"; From 360ce0646ea638499f4a4302c323f162ec14754b Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 18 Mar 2024 18:59:40 -0400 Subject: [PATCH 6/7] docs: re-arrange to test footnote behaviour --- docs/tips/adding-images.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/tips/adding-images.md b/docs/tips/adding-images.md index 563c88cff..86175593d 100644 --- a/docs/tips/adding-images.md +++ b/docs/tips/adding-images.md @@ -1,7 +1,5 @@ # Adding Images ->[!tip] -> The extension uses the traditional `![]()` syntax to link to the image, but you may switch to using the [[embed|wiki-link embedding syntax]] (`![[]]`) as it has the advantage of not needing to specify the full path to the image (thus allowing you to the move the image around under the notebook without breaking referring links). [[emanote-template]] is already configured to do this by default. If your image is already copied in the OS clipboard---many screenshoting tools[^scr] already provide this capability---and if you use [[vscode]], you can use the [Paste Image](https://marketplace.visualstudio.com/items?itemName=mushan.vscode-paste-image) extension to *directly paste* it in your Markdown note. This does the following, @@ -12,5 +10,8 @@ If your image is already copied in the OS clipboard---many screenshoting tools[^ It basically automates the workflow of having to manually move the image file to your notebook, and then writing the Markdown image syntax to link to it. +>[!tip] +> The extension uses the traditional `![]()` syntax to link to the image, but you may switch to using the [[embed|wiki-link embedding syntax]] (`![[]]`) as it has the advantage of not needing to specify the full path to the image (thus allowing you to the move the image around under the notebook without breaking referring links). [[emanote-template]] is already configured to do this by default. + [^scr]: On Linux, you may use [GNOME screenshot](https://help.gnome.org/users/gnome-help/stable/screen-shot-record.html.en) or (if using a tiling window manager) [maim](https://github.com/naelstrof/maim). \ No newline at end of file From 4a6c2a3d7f7ed50380066c0dd4151f536d96ca83 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 25 Mar 2024 15:14:47 -0400 Subject: [PATCH 7/7] nix: Update commonmark-wikilink --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 0a2671da7..4fb0d7d4c 100644 --- a/flake.lock +++ b/flake.lock @@ -35,11 +35,11 @@ "commonmark-wikilink": { "flake": false, "locked": { - "lastModified": 1707333690, - "narHash": "sha256-XjQbAbYEz+NMh8bOxbLCrlZX/ZbiOYd2zY4I13vZGbU=", + "lastModified": 1711394028, + "narHash": "sha256-eu5gMmgRz6Y51TBCaB26uJKNN3z1LRfUcTV4+PMy5Gw=", "owner": "srid", "repo": "commonmark-wikilink", - "rev": "471740e7be526676a5b46d6772587cbacd73f546", + "rev": "57dcf665082ffc1b6f35a427e203ed115821b15c", "type": "github" }, "original": {