Back to home

Getting Started with SyMark

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:

  1. Rust - The programming language SyMark is built with

  2. SiYuan - The note-taking application that creates the notes SyMark converts

  3. 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

  1. Visit https://www.rust-lang.org/tools/install

  2. Download and run the rustup-init.exe file

  3. Follow the on-screen instructions (the default options are fine for most users)

  4. Restart your computer to ensure the environment variables are set correctly

macOS / Linux

  1. Open your terminal

  2. Run the following command:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
  3. Follow the on-screen instructions (the default options are fine for most users)

  4. 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.

  1. Visit https://github.com/siyuan-note/siyuan/releases

  2. Download the appropriate version for your operating system

  3. Install and run SiYuan

  4. 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

  1. Visit the SyMark repository page

  2. Click the "Code" button and select "Download ZIP"

  3. Extract the ZIP file to a location of your choice

  4. 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:

  1. Open SiYuan

  2. Navigate to the notebook you want to convert

  3. Use the export functionality to create a ZIP file of your notebook

    • Menu → Export → Export Data → Select Your Notebook → Export

  4. Extract the ZIP file containing your .sy files

  5. Copy all extracted files into the input directory of SyMark

    • Make 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:

  1. Open a terminal or command prompt

  2. Navigate to the SyMark directory

  3. 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:

  1. Navigate to the output directory

  2. Open index.html in your web browser

  3. Explore 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 pages

  • styles.css: CSS styles for the website

  • graph.html: Template for the graph visualization page

To create a custom theme:

  1. Create a new directory in the themes folder (e.g., themes/my-custom-theme)

  2. Copy the files from an existing theme as a starting point

  3. Modify the HTML and CSS files to suit your preferences

  4. 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:

  1. In SiYuan, create a note that will serve as your index page

  2. Add the tag index to this note

  3. Export your notebook and run SyMark

  4. SyMark will use your tagged note as the content for the main index.html page

Troubleshooting

If you encounter issues:

  1. Missing notes or assets: Ensure all your .sy files and assets are in the correct directories

  2. Build errors: Check that you have the latest stable version of Rust installed

  3. Broken links: Verify that all referenced note IDs exist in your input directory

  4. 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 files

  • Missing images: Ensure image assets are in the input/assets/ directory

  • Error parsing file: The .sy file might be corrupted or in an unsupported format

  • Missing dependencies: Run cargo build to ensure all dependencies are installed

Additional Resources