frostime / sy-bind-mdfile

GNU General Public License v3.0
2 stars 1 forks source link

This plugin establishes a bidirectional binding relationship between a SiYuan document and a local markdown file. You can:

⚠️ Note: This plugin only supports use in desktop environments and does not support mobile or web versions.

Configure Binding Relationship

Click on the document icon button, open the block menu of a document and configure the local MD file bound to the document in the dialog box.

image

image

Template Management

image

⚠️ Note: The templates saved on different devices are independent of each other.

Export File

Click the export button to automatically write the content of the SiYuan document into the md file and write all asset files into the resource file directory.

About "Asset Path Prefix"

The "Asset Path Prefix" field generally does not need special configuration. In most cases, simply click the "Absolute Path" or "Relative Path" button.

💡 However, in some special cases, users need to manually fill in the prefix.

For example: When using document frameworks based on markdown like VitePress, the routes to resource files in the md file often do not point to the actual local paths—in the local file system, the "Resource File Directory" and the paths to resource files referenced in the markdown may not be the same.

Here is a simple example:

image

And the links within markdown file will be like this:

image

Import File

⚠️ Note: The import function completely overwrites the original document, which will cause block IDs to change, resulting in the invalidation of external references to blocks within the document!

If the specified markdown file already exists, you can also choose to import the file.

image

For safety reasons, when importing a file, you need to manually configure the import options:

image