Skip to content

Add an include_html similar to include_view with additional HTML semantics #3887

Open
@meghprkh

Description

@meghprkh

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

  • For icon libraries like lucide, the best option is to directly inline the SVG
  • I want to do this by npm i -D lucide-static and include_html!("node_modules/lucide-static/icons/menu.svg")
  • This wont work as there is a HTML comment in the view, i.e. <!-- @license lucide-static v0.503.0 - ISC -->

Describe the solution you'd like
include_html which strips HTML comments.

Describe alternatives you've considered

  • The view macro itself supports HTML comments
  • include_view strips out html comments if a second argument is provided

Additional context

  • Icon libraries that try to make each icon into components have heavy compile times, embed macros are better IMO
  • A generic embed macro would be pretty good, though alternatively this being a separate library might work for lucide / icons specifically
  • Also wrt include_view it is likely the file types of these files would be HTML or SVG for formatting, so it probably makes sense to strip out the HTML comments there by default?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions