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?
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?
@adham Wow 😍 You are a master programmer indeed! I was still trying to figure out how to use Python to open all .md files in a directory, by copy/pasting code from Stackoverflow 😄 This solution is exactly what I meant.
I do believe it can be extended to include references to any arbitrary block, not just a document block. You did say that you don't want to mutate the linked documents, but I am just laying out the approach in case any other master programmers want to try it 😄. You wrote,
I don't know how to find out if the link is of a block or a document,
I see a few different possible checks for this
So one or both of the above checks can be used to determine if the block is of type 'document' or something else.
If the block is of type something else, then the way to link to it would be
<a name="block-id"></a>
siyuan://blocks/block-id
part of the link to hpath_value.md#block-id
This approach enables having links in the markdown files to any other markdown files or parts inside markdown files.
@adham Thank you once again for your example code 🙏
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!
@88250 I think this is an important missing feature when it comes to publishing the notes. Let me explain:
Many users, including me, like to make a lot of links between notes. We also like to publish some set of notes on our websites/blogs/digital gardens. With most other note-taking software, you can export the notes to markdown, which includes links to other markdown documents (or even specific paragraphs in the markdown documents). Then, static site generators like Hugo can ingest the markdown files and produce HTML pages for the web. These HTML pages have all the correct links to other notes' HTML pages. With SiYuan, since the exported markdown does not contain links to other notes, publishing notes with links to other notes is not possible at all. I think this is a problem for many potential users. Do you have any other suggestions for how to publish notes in SiYuan with all links-between-notes working properly?
I think this is important for another reason: With other tools like Obsidian, the notes are stored as normal markdown files. This means that the notes are not "trapped" inside the note-taking software. SiYuan does not store content as markdown files. Even if the format is still open, it still feels like the notes are "trapped" or "locked inside" SiYuan. If SiYuan has an excellent ability to export the notes to markdown (e.g. with all the links preserved) it would feel less like the notes are locked away inside SiYuan. I think this will increase trust in SiYuan, since users will not worry that if SiYuan unfortunately disappears, then their notes will disappear with it.
I understand that because SiYuan offers a lot more complex formatting options, exporting to Markdown with everything properly preserved is not possible. This comes from the limitations of Markdown. However, there should ideally be a way to publish the notes (perhaps to HTML) so that all the formatting and links are preserved. I think maybe this is currently possible for each entry in the Doc Tree, but ideally, it should be possible for an entire hierarchy in the Doc Tree i.e. a given note and all notes below it should be exported. Please let me know if this is already possible.
I appreciate your resonse, but it is not only for complete batch export for users to turn away from siyuan, but rather for collaborative reasons and to publish notes. Users of Siyuan can collaborate and share specific notes.
I just want a guide on how to use anchor hash
. How would I proceed after I used the feature after export, so post anchor hash
. I do not quite understand what to do with the new file after export.
Welcome to here!
Here we can learn from each other how to use SiYuan, give feedback and suggestions, and build SiYuan together.
Signup About