Home

Awesome

<h2><p align='center'>Pintora Support for Obsidian</p></h2> <p align='center'> <a href="./README.md">English</a> <span>|</span> <a href="./README_ZH.md">中文</a> </p>

Introduction

Obsidian-Pintora is an Obsidian plugin based on Pintora, which allows users to create diagrams using Pintora syntax directly in the Obsidian editor. It's local, secure, fast, and easy to use.

Pintora is a diagramming tool similar to Mermaid and PlantUML, which generates diagrams by parsing its own language, much like how Markdown works. It presents content in an intuitive and easily understandable way. For a detailed explanation of Pintora's syntax and capabilities, refer to the Pintora Language Reference Guide.

Obsidian is a writing tool that supports editing, previewing, and managing Markdown files. It has a vibrant community with many high-quality community plugins available. The editor supports CommonMark, GitHub Flavored Markdown, and LaTeX syntax, along with some Obsidian-flavored Markdown extensions. For more details on the editor's features and usage, check out the Obsidian User Guide.


Features

  1. Diagram Creation: Parse Pintora language to generate diagrams.
  2. Copy Diagrams: Copy diagrams to the clipboard in PNG Base64, SVG XML, and PNG Blob formats.
  3. Export Diagrams: Export diagrams to .md, .png, .svg, .webp formats.
  4. Convert to Links: Convert Pintora code to attachment links by exporting diagrams in .md, .png, .svg, .webp, or base64 formats to a folder, then generating file links to replace the original Pintora code.
  5. Diagram Lightbox: Center and enlarge diagrams to display them fully and clearly.
  6. Responsive Size: Dynamically adjust the diagram size based on the original ratio and available space.
  7. Custom Themes: Choose themes and edge types, and customize theme styles by inputting theme variables.
  8. Other Features: Return error messages, fold/unfold diagrams, custom diagram titles, and custom attachment names.

Demo

Diagram Creation

diagram-creation

Diagram Lightbox

diagram-lightbox

Custom Title

custom-title

Copying, Exporting, and Linking Diagrams

context-menu

Theme and Style

theme-and-style


Installation

  1. Search for Pintora in the Obsidian Community Plugins to install it. (Recommended)
  2. Manually download the plugin package, and place it in the ..\Obsidian Vault\.obsidian\plugins folder.

Usage

Activate Pintora Diagram Functionality

```pintora
Some Pintora statements written using the Pintora DSL.
```

Custom Titles

```pintora { title: Example Title }
Some Pintora statements written using the Pintora DSL.
```

Custom Attachment Names

```pintora-canvas
activityDiagram
if (Title is set?) then (Yes)
    :Use the set title;
  else (No)
    :Use an auto-generated attachment name;
  endif
```

Diagram Lightbox Functionality

Right-Click Menu Functionality

```pintora-svg
mindmap
* Right-Click Menu
** Copy Source Code
*** Copy the Pintora source code
** Copy Diagram
*** Copy PNG (Base64)
*** Copy SVG (XML)
*** Copy PNG (Blob)
** Export and Link
*** Export .md file
*** Export .png file
*** Export .svg file
*** Export .webp file
*** Export PNG (Base64) file
** Convert to Links
*** Generate .md link
*** Generate .png link
*** Generate .svg link
*** Generate .webp link
*** Generate PNG (Base64) link
```

Custom Theme Styles


Roadmap

  1. Fix bugs
  2. Track Pintora updates and synchronize versions
  3. No new features will be added