dendron icon indicating copy to clipboard operation
dendron copied to clipboard

Option to export Markdown notes with backlinks

Open sagarbehere opened this issue 3 years ago • 3 comments
trafficstars

Please select if your request is either something new or an enhancement

  • [x] Enhancement of an existing Feature.
  • [ ] Request of a new feature.

Please select the area your request applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)

  • [ ] Workspace - VSCode workspace, vaults, Intellisense/autocomplete, Dendron settings
  • [ ] Lookup - Dendron's Lookup Command
  • [ ] Views - Dendron Preview, Tree View, Side Panels in the UI
  • [ ] Schema - Dendron Schemas
  • [x] Pod - Data import from / export to Dendron
  • [ ] Publish - External Site Publish
  • [ ] Markdown - Markdown features, such as syntax support and features

Is your feature request related to a problem? Please describe

Dendron already supports exporting notes as a set of Markdown files. These exported Markdown files can then be published with a variety of other software solutions, should that be desired (e.g. MkDocks, Hugo, other static site generators, ...). However, the exported Markdown files do not contain any explicit backlink information. Therefore, the publishing solution would need to do a non-trivial amount of work to compute backlinks from scratch and include them while publishing e.g. at the end of the published note or as a sidebar widget next to the published page. But why recompute those backlinks when Dendron already has all the backlinks information and could easily export it? Therefore, this is a feature request to have an option to include backlinks in the exported Markdown files.

Describe the solution you'd like

Solution 1: Each exported Markdown note has a 'Backlinks' section appended at its end, containing a list of backlinks to that note in standard markdown links format [Link Text](link-to-markdown-note).

Alternative solution 2: Each exported note is accompanied by a separate file e.g. notename-backlinks.md that contains the backlinks for that note.

Describe alternatives you've considered

  1. Hack the publishing software of choice to compute backlinks. This is not trivial. There isn't any popular publishing software that I know of that includes support for computing backlinks out-of-the-box. Cooked up solutions like this one have many edge cases where they do not work.
  2. Use other external Python scripts to compute backlinks and append them to the end of each exported markdown note, before sending the notes to the publishing software. An example of such a script is Andy Matuschak's note-link-janitor

sagarbehere avatar Jan 08 '22 05:01 sagarbehere

Thanks for the request. We're adding it to our backlog

kevinslin avatar Jan 11 '22 17:01 kevinslin

Related, and potentially duplicate, as this other issue is wanting to achieve the same goals: https://github.com/dendronhq/dendron/issues/695

ScriptAutomate avatar Jan 12 '22 03:01 ScriptAutomate

Would also like a proper mkdocs export, any progress with this?

danielbraun89 avatar Sep 04 '22 15:09 danielbraun89