• This section mainly displays and explains the special content of this repository.

Chinese Search Support

  • The static resources generated by mdbook do not directly support Chinese search and can only search in English.
  • I solved this problem by referring to and adding a JavaScript file below.

[!NOTE] Reference 小霖家的混江龙 (Xiaolin's Mixed Dragon) Support CJK (mutiple language) search · Issue #2052 · rust-lang/mdBook · GitHub

Issue with Chinese URLs not redirecting

  • The default obsidian-export had an issue where Chinese URLs could not redirect.
  • I modified its source code and compiled a solution myself.
  • Modified GitHub link

Adding a right-side outline

  • Similar to the outline system on the right side of Obsidian.

[!NOTE] Reference GitHub - JorelAli/mdBook-pagetoc: A page table of contents for mdBook

Other improved features

  • The issue of not recognizing the [[]] syntax was solved using obsidian-export for old.
  • Obsidian's built-in ==highlight settings==
  • Obsidian's tag recognition and search #tag
  • The problem of multi-line applications not breaking

example next line

[!important] Quotation syntax recognition Similar to this type

  • Math formula support, similar to $$a^2=b^2+c^2$$

Note Encryption

  • Supports password protection for specified notes, with frontend AES-256-CBC decryption (prevents casual viewing)
  • Password is cached locally in the browser's localStorage, so you don't need to re-enter it for the same page

Usage

Add front-matter at the beginning of your Obsidian note:

---
password: "your_password"
---

Content here...
  • Notes with a password field will be encrypted. During build, the content is AES-encrypted into ciphertext. After entering the password on the frontend, the content is decrypted and displayed.
  • Front-matter without password is automatically stripped during build and won't be rendered as <hr>.

How It Works

  • encrypt.py pre src: Runs before build, strips all front-matter, records files with password
  • mdbook build: Normal build, generates HTML
  • encrypt.py post book: Runs after build, extracts rendered HTML content from recorded files, encrypts it with AES-256-CBC, and replaces it with an encrypted div
  • Frontend encrypt.js uses the browser's native Web Crypto API for decryption, zero third-party dependencies

Password Caching

  • After successful decryption, the password is automatically cached in localStorage with the page path as the key
  • Revisiting the same page will auto-decrypt without re-entering the password
  • If the password changes, the cache automatically becomes invalid and the password prompt will reappear