Is it possible for markdown export to link to other files?

I exported a notebook to markdown (which is great), but I found that the files don't have links to other files like they were in Siyuan.

So, is there anyway to make markdown exports have links to other files?

    Welcome to here!

    Here we can learn from each other how to use SiYuan, give feedback and suggestions, and build SiYuan together.

    Signup About
    Please input reply content ...
    • zxhd86

      Thanks to the solution provided by the community, the effect of the built-in Siyuan export is perfect! @adham @sagar

    • MiscReply
    • Siysuy

      The anchor hash feature currently creates a span object <span id="20231110120736-ze6m41f"></span>. Some kind of program should be able to understand and find this block inside the note as reference. Can anyone help me understand how this can be useful after export, where do I use this, which program understands this syntax?

      The export mode Anchor hash for notebook Markdown exporting has some limitations.

      In the case i want to publish a particular note (with links to other notes) my approach is:

      1. From main notebook export the notebook you want to publish to .sy.zip file
      2. Create new (temporary) notebook
      3. import .sy.zip file to new temp notebook
      4. Export temp notebook export it to any selectable format (only markdown is currently selectable)

      Other limitation of Anchor has export and the only way I got it to work (performed testing by exporting to Obsidian):

      • currently only works for notebook and does not allow nested notes. In the process of exporting all notes must be unnested inside notebook for .md export to function.
      • Currently does not support block reference. Can only link to main note. Tested by importing to obsidian (not a siyuan issue, but a markdown syntax limitation i presume)

      Depending on the responses here I might add a feature request soon that involves the concept of user selectable export syntax. In which before execution of export using anchor hash a user can type in the conversion syntax to apply. User is presented with input fields much like the settings > Export > Anchor text wrapping symbol fields.

      Conversion syntax for siyuan > obsidian would be: [[test3.md/Note 2#^d8bf62|Note 2]] and conversion input fields could somehow be [[ .. / .. #^ .. | .. ]]

      1 Reply
    • 88250

      The reason why this function is placed at the notebook level is because some users no longer want to use SiYuan and need complete batch export, so support for this function is not considered at the document level.

      I'm not sure if the span tag still exists after pandoc converts the HTML, but I'm sure anchor jumps can be used and you can write HTML tests in the browser.

      1 Reply
    • adham 1
      Author

      You're welcome! I actually was too lazy to write it myself so I asked ChatGPT to do it for me and changed some mistakes in its code.

      And I might as well do it for non-document blocks, I will post the solution here too.

      In any case, it seems like this problem can be solved easily and be integrated into SiYuan.
      I am not familiar with SiYuan code or Golang in general so someone else more familiar may make a Pull Request for this feature way faster than me.
      If not, I don't mind spending some time to learn enough to build this feature into SiYuan. It's the least I can do in return for getting this amazing app for free!
      Thanks @88250 @sagar and long live the open source!

    • Visit all replies