# ๐Ÿš€ SimpleMerge for Obsidian Are you writing a book, a thesis, or a long research paper in Obsidian? Do you love keeping your notes "atomic" and separate, but hate the nightmare of trying to export or compile them all together into one readable document? **SimpleMerge is here to save the day! ๐ŸŽ‰** SimpleMerge is a powerful, smart, and lightweight plugin that takes an "Index" note (a note containing links to your chapters or sub-notes) and magically stitches them together into a single, beautifully formatted markdown file. ## โœจ Why you will love SimpleMerge (Key Features) - ๐Ÿ”— **Smart Internal Routing:** When SimpleMerge combines your files, it automatically transforms your `[[Note]]` links into internal anchor links `[[#Note]]`. Your Index note instantly becomes a fully functional Table of Contents! - ๐Ÿงน **YAML/Properties Cleanup:** It automatically strips the frontmatter/YAML from your child notes before merging them, ensuring your final document's formatting doesn't break. It only keeps the YAML of your main Index note at the very top! - ๐ŸŽฏ **Partial Merging:** Don't want to merge the whole file? Just highlight a block of text containing links, run the "Merge Selection" command, and it will compile _only_ those specific notes. - ๐Ÿท๏ธ **Auto-Heading Injection:** If one of your child notes doesn't start with an `H1` (`# Title`), the plugin intelligently injects the file's name as a heading so your document's structure remains perfect. - โœ‚๏ธ **Custom Separators:** You have total control over what goes between your merged notes! Choose from empty spaces, horizontal rules (`---`), PDF page breaks, or type your own custom Markdown/HTML divider! ## โšก THE GAME CHANGER: Live Sync Mode! Say goodbye to static, "dead" exported files! **How to activate it:** Go to **Obsidian Settings > SimpleMerge** and toggle on **Enable Sync Mode**. Once enabled, SimpleMerge embeds hidden metadata in your merged file, remembering exactly which Index note it came from. You can keep working on your individual, fragmented chapter notes for days. When you are ready to see the final result, you have two amazing options: 1. **Auto-Update on Open (Recommended):** If you enable this toggle in the settings, simply clicking on your merged file in the file explorer will silently refresh its content in the background. **BAM! It automatically updates itself** with all your latest changes in the blink of an eye! 2. **Manual Update:** Open your merged file, bring up the Command Palette, and run `SimpleMerge: Update this merged file (Sync Mode)`. No need to re-run the merge process from scratch. No duplicate files. Just pure, seamless synchronization. ## ๐Ÿ› ๏ธ How to Use It (Step-by-Step) ### 1. The Standard Merge (Full Index) This is the standard way to compile a full document. 1. **Create an Index Note:** Create a new note and write some text and links to the notes you want to merge (e.g., `[[Chapter 1]]`, `[[Chapter 2]]`). 2. **Run the Command:** Keep your Index note open, press `Ctrl+P` (or `Cmd+P`) to open the Command Palette, and search for: ๐Ÿ‘‰ `SimpleMerge: Merge linked notes from this file (Index)` 3. **Choose Name & Destination:** A popup will ask you for the final file name and where to save it. Click "Start Merge". 4. **Done!** Your fully compiled document is ready. ### 2. The Partial Merge (Text Selection) Perfect if you only want to extract a few specific chapters from a massive index. 1. Open any note containing links. 2. **Highlight the text** containing the links you want to merge using your mouse. 3. Open the Command Palette and select: ๐Ÿ‘‰ `SimpleMerge: Merge only linked notes in selection` 4. The plugin will automatically suggest the name of the first linked note as the file name. Click "Start Merge". The new file will use your selected text as its custom Index! ### 3. Customizing the Separators Want a horizontal line or a PDF page break between chapters? 1. Go to **Obsidian Settings > SimpleMerge**. 2. Scroll down to **Formatting and Separators**. 3. Choose your preferred "Separator Type" from the dropdown (Space, Horizontal Rule, Page Break, or Custom). 4. Choose the "Amount" (e.g., set it to `3` to get three empty lines, or three horizontal rules). 5. Next time you merge, your notes will be perfectly glued together! ## ๐Ÿ“ฆ Installation **Official Community Plugins (Coming Soon!)** Once approved, you will be able to find SimpleMerge directly in the Obsidian Community Plugins list! **Manual Installation** 1. Download the latest release from the GitHub Releases page. 2. Extract the `simple-merge` folder. 3. Place it in your vault's `.obsidian/plugins/` folder. 4. Reload Obsidian and enable **SimpleMerge** in your Community Plugins settings! _Built with โค๏ธ for the Obsidian Community._