-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I deal with inline Svg with type-of-html? #5
Comments
Well, it seams you don't have the Prelude imported. Please report if this works for you. Perhaps I'll add natively svg stuff in the coming weeks (pr welcome). |
That's true. Simply importing the Prelude fixed it. Thanks!!! About Svg, I'm happy to make a PR for that. Thanks! |
Just on the topic of making a pr for Svg support, How would you recommend implementing this? Also, I imagine just doing this via Custom elements (CustomElement and CustomA) is not really clean, or what do you think? -- | 4 The elements of HTML
data Element (name :: Symbol) (categories :: [ContentCategory]) (contentModel :: ContentCategory) (contentAttributes :: [Symbol]) where
DOCTYPE
:: Element
"!DOCTYPE html"
'[]
None
'[]
-- | \ 4.1 The document element
-- 4.1.1
Html
:: Element
"html"
'[]
-- A head element followed by a body element.
(Elements ["head", "body"])
(ManifestA & '[])
Sorry I'm really new to haskell, so I don't have a good grasp of type level things. But if you point me in the right direction, this should be doable. The bulk of the work is mostly the manual work of listing out the elements and the attributes. https://developer.mozilla.org/en-US/docs/Web/SVG/Element |
Hi, gentle reminder about this. I know this issue is closed, but it would be nice to get a heads-up, which will help me work on the svg support or. :) |
Hi, sorry for the late answer. Just put it all into data Element and export everything, or put everything into data Element and make a handcrafted exportlist of constructors. The second option is a headache for maintenance, but allows for an Html.SVG module... I'll think a bit more, but it seems to me, that svg is widely used and therefore well put into data Element. |
Thinking more about it, perhaps a data family would be a good extensible fit... |
Could you give a little code example?
…On Mon, 7 Jun 2021 at 19:32, quxbar ***@***.***> wrote:
Thinking more about it, perhaps a data family would be a good extensible
fit...
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSCVAXM2RVWU46BCCDOPCTTRT7BDANCNFSM4436SGGA>
.
|
Just pushed a new version to github, look at the Html.Aria module for examples for attributes and at the Html.Obsolete module for examples for elements. If your stuck, just write a message |
It seems there are no svg elements or attributes defined. Is there any recommended workaround?
I also tried creating custom attributes, but couldn't get it to work. It just says the bool constructors are not in scope:
The text was updated successfully, but these errors were encountered: