Skip to content

add: the inline source support - #157

Merged
XiangYyang merged 6 commits into
theacodes:mainfrom
XiangYyang:inline_source
Dec 15, 2025
Merged

XiangYyang merged 6 commits into
theacodes:mainfrom
XiangYyang:inline_source

Conversation

@XiangYyang

Copy link
Copy Markdown
Collaborator

This PR is a refactor version of #56, it also considers the approach of PR #126. And it keeps the original behaviour and reuses existing code wherever possible.

New properties

On the kicanvas-source element,

  • name -- provide the original file name
  • type -- help determining the file type

Behaviors

  • Always use src property if it specify
  • name is the original file name, e.g., inline_source.kicad_sch. It's optional and the default value is inline_<NUM>.kicad_XXX, for example, inline_0.kicad_sch, inline_1.kicad_sch, and so on.
  • type property can specify file types. It's optional and the default value will be determined by file content and file name.

It works with the existing src attribute. When both are present, all files will be loaded.

<kicanvas-embed controls="full">
    <kicanvas-source name="sch1.kicad_sch">
        (kicad_sch (version 20230121) ...
    </kicanvas-source>
    <kicanvas-source name="sch2.kicad_sch">
        (kicad_sch (version 20230121) ...
    </kicanvas-source>
    <kicanvas-source src="examples/mcu.kicad_sch"></kicanvas-source>
</kicanvas-embed>
image

@XiangYyang
XiangYyang requested a review from theacodes December 12, 2025 16:34
Comment thread docs/docs/embedding.md Outdated
Comment thread docs/docs/embedding.md Outdated
Comment thread docs/docs/embedding.md Outdated
Comment thread docs/docs/embedding.md Outdated
Comment thread src/kicanvas/services/vfs.ts
@XiangYyang
XiangYyang requested a review from theacodes December 13, 2025 05:27

@theacodes theacodes left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you!

@XiangYyang
XiangYyang merged commit b9b68cb into theacodes:main Dec 15, 2025
2 checks passed
@XiangYyang
XiangYyang deleted the inline_source branch December 15, 2025 16:52
@eeyrjmr

eeyrjmr commented Dec 17, 2025

Copy link
Copy Markdown

just locally built and integrated with my gitea, works great! thankyou!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants