Welcome to SyMark, an open-source static site generator that transforms your SiYuan notebooks into beautiful, responsive websites. This guide will help you get up and running quickly, even if you're new to both SiYuan and Rust.
What is SyMark?
SyMark takes your SiYuan notes (stored as .sy
files) and converts them into an interconnected website. All your carefully crafted notes are preserved and rendered beautifully for the web.
Download binaries!
You can get binaries on the GitHub releases page. To run, type ./symark
if you're on Linux or Mac. Make sure you also grab the input
, output
, and themes
folders and leave them in the same directory with the binary.
Compile it yourself:
Prerequisites
Before you begin, you'll need to install:
Rust - The programming language SyMark is built with
SiYuan - The note-taking application that creates the notes SyMark converts
Git (optional) - For downloading the SyMark repository if you don't use the ZIP download
Step 1: Install Rust
Rust is a programming language that SyMark is built with. Installing it is straightforward:
Windows
Download and run the
rustup-init.exe
fileFollow the on-screen instructions (the default options are fine for most users)
Restart your computer to ensure the environment variables are set correctly
macOS / Linux
Open your terminal
Run the following command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Follow the on-screen instructions (the default options are fine for most users)
To apply the changes without restarting your terminal, run:
source $HOME/.cargo/env
Verify Installation
To verify that Rust is installed correctly, open a terminal or command prompt and run:
rustc --version
cargo --version
Both commands should display version information if Rust is installed correctly.
Step 2: Install SiYuan
SiYuan is the note-taking application that creates the notes SyMark converts.
Download the appropriate version for your operating system
Install and run SiYuan
Create some notes to test with (or use a sample notebook)
Step 3: Get SyMark
You can obtain SyMark by either cloning the repository using Git or downloading a ZIP file.
Option A: Using Git
If you have Git installed:
git clone https://github.com/du82/symark.git
cd symark
(Replace username
with the actual GitHub username of the SyMark repository owner)
Option B: Download ZIP
Visit the SyMark repository page
Click the "Code" button and select "Download ZIP"
Extract the ZIP file to a location of your choice
Open a terminal or command prompt and navigate to the extracted folder
Step 4: Prepare Your SiYuan Notes
SyMark processes .sy
files exported from SiYuan. To export your notes:
Open SiYuan
Navigate to the notebook you want to convert
Use the export functionality to create a ZIP file of your notebook
Menu → Export → Export Data → Select Your Notebook → Export
Extract the ZIP file containing your
.sy
filesCopy all extracted files into the
input
directory of SyMarkMake sure to include all assets (like images) in the
input/assets
folder
Step 5: Run SyMark
Now you're ready to convert your notes into a website:
Open a terminal or command prompt
Navigate to the SyMark directory
Run SyMark using Cargo:
# Use the default theme
cargo run
# Or use a specific theme
cargo run theme-name
Available themes include:
default
dark
flat
garden
paper
The program will display information about the generation process, including the number of notes processed, tags found, and build time statistics.
Step 6: View Your Generated Website
After SyMark finishes processing, your website will be available in the output
directory:
Navigate to the
output
directoryOpen
index.html
in your web browserExplore your newly generated website!
The generated website includes:
A home page (
index.html
)A complete list of all notes (
all.html
)Individual pages for each note
Pages for each tag collection
An interactive visualization of note connections (
graph.html
)
Customization
SyMark supports customization through themes. Each theme consists of:
page.html
: Template for all generated pagesstyles.css
: CSS styles for the websitegraph.html
: Template for the graph visualization page
To create a custom theme:
Create a new directory in the
themes
folder (e.g.,themes/my-custom-theme
)Copy the files from an existing theme as a starting point
Modify the HTML and CSS files to suit your preferences
Run SyMark with your custom theme:
cargo run my-custom-theme
Custom Index Page
By default, SyMark generates an index page listing all notes. To create a custom index page:
In SiYuan, create a note that will serve as your index page
Add the tag
index
to this noteExport your notebook and run SyMark
SyMark will use your tagged note as the content for the main
index.html
page
Troubleshooting
If you encounter issues:
Missing notes or assets: Ensure all your
.sy
files and assets are in the correct directoriesBuild errors: Check that you have the latest stable version of Rust installed
Broken links: Verify that all referenced note IDs exist in your input directory
Formatting issues: Some advanced SiYuan formatting features might not be fully supported
Common Issues
Empty output directory: Check that your input directory contains valid
.sy
filesMissing images: Ensure image assets are in the
input/assets/
directoryError parsing file: The
.sy
file might be corrupted or in an unsupported formatMissing dependencies: Run
cargo build
to ensure all dependencies are installed
Additional Resources
SiYuan Documentation: https://github.com/siyuan-note/siyuan
Rust Documentation: https://www.rust-lang.org/learn
Markdown Guide: https://www.markdownguide.org/