A collection of CSS and JavaScript snippets for customizing and enhancing the SiYuan note-taking application.
This repository contains a collection of code snippets that can be used to customize the appearance and functionality of SiYuan. It also includes a Python script for automatically generating the conf.json
file that SiYuan uses to load these snippets.
├── css/ # CSS snippets for styling SiYuan
│ ├── blocking/ # CSS for blocking elements
│ ├── main/ # Main CSS customizations
│ ├── markdown/ # Markdown-specific styling
│ ├── miscellaneous/ # Miscellaneous CSS tweaks
│ ├── pop_window/ # Styling for popup windows
│ └── sidebar/ # Sidebar customizations
├── js/ # JavaScript snippets for adding functionality
│ ├── Middle-click_to-expand_file_tree.js
│ ├── block_ctrl_w_close_pin_tab.js
│ ├── change_link_to_mode.js
│ ├── collapse_code.js
│ └── slash_menu_arrow_keys_command.js
├── just_collection/ # Additional snippets collection
├── output/ # Generated output files
└── save_to_siyuan_conf.py # Script to generate conf.json
-
Clone this repository:
git clone https://github.com/yourusername/siyuan_code_snippets.git cd siyuan_code_snippets
-
Modify the
siyuan_doc_path
variable insave_to_siyuan_conf.py
to point to your SiYuan installation directory:siyuan_doc_path = "path/to/your/siyuan/installation"
-
Run the script to generate the configuration file:
python save_to_siyuan_conf.py
-
By default, the script will generate a test configuration in the
./output/
directory. To generate the configuration directly in your SiYuan installation, modify the flags in the script:flag = 0 flag += OutputFlag.SIYUAN # Uncomment to output to SiYuan # flag += OutputFlag.TEST # Comment out to disable test output
Place your CSS files in the appropriate subdirectory under css/
. The script will automatically detect and include them in the configuration.
Place your JavaScript files in the js/
directory. The script will automatically detect and include them in the configuration.
To exclude specific snippets from being included in the configuration, add their names to the ban_snippets
set in save_to_siyuan_conf.py
.
- Automatic ID Generation: Each snippet gets a unique ID based on timestamp and counter
- Organized Structure: Snippets are organized by type and functionality
- Flexible Output: Can generate configuration for testing or direct use in SiYuan
Contributions are welcome! Please feel free to submit a Pull Request.
- SiYuan - The note-taking application these snippets are designed for