joethei / obsidian-plantuml

Generate PlantUML Diagrams inside Obsidian.md
MIT License
389 stars 21 forks source link

It is recommended that svg be used for rendering by default. #67

Open itachaaa opened 3 weeks ago

itachaaa commented 3 weeks ago

Is your feature request related to a problem? Please describe.

Currently, the PNG rendering is used by default. As a result, the rendering result may be blurred when the sizes are different.

Describe the solution you'd like

It is recommended that svg be used for rendering by default.

    this.default = (source, el, ctx) => __async(this, null, function* () {
      yield this.svg(source, el, ctx);
    });

Describe alternatives you've considered

Provide configuration options for users to change the default renderer.

Additional context

Scaling problems may occur when the svg is used. If the image is too large, it cannot be displayed completely. It can be handled by certain css configuration, depending on your preference. Force scale to current width:

.markdown-preview-view svg {
    max-width: 150%;
    height: auto !important;
}
joethei commented 3 weeks ago

Not all diagram types are supported with SVG, some are only available when using PNG as the output format. That's why PNG is the default.

itachaaa commented 2 weeks ago

Or is it possible to provide a switch or entry so that the user can choose what rendering to use?