Skip to content
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

Icon previews #7

Open
NduatiK opened this issue Apr 20, 2021 · 3 comments
Open

Icon previews #7

NduatiK opened this issue Apr 20, 2021 · 3 comments

Comments

@NduatiK
Copy link

NduatiK commented Apr 20, 2021

Would it be possible for the library to embed icons in the docs so developers can preview what they are importing.

Another library (FeatherIcons) I have been looking into implements this and its been a delight to use.

For example:
image

They are doing this by providing an image in the docs like this:

{-| align-right
![image](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxsaW5lIHgxPSIyMSIgeTE9IjEwIiB4Mj0iNyIgeTI9IjEwIj48L2xpbmU+PGxpbmUgeDE9IjIxIiB5MT0iNiIgeDI9IjMiIHkyPSI2Ij48L2xpbmU+PGxpbmUgeDE9IjIxIiB5MT0iMTQiIHgyPSIzIiB5Mj0iMTQiPjwvbGluZT48bGluZSB4MT0iMjEiIHkxPSIxOCIgeDI9IjciIHkyPSIxOCI+PC9saW5lPjwvc3ZnPg==)
-}
alignRight : Icon
alignRight =
    ...

Why do this?

  • Developer Experience

Why not do this?

  • Even larger source code (I noticed the base material libraries is 1.3MB); this is a one time download so maybe its okay
  • A potentially more complex generation process; this might not be true since you start with the svg and could just base64 encode it into the docs
  • The google icons website might already be adequate for previewing

What do you think @icidasset?

Oh, and thanks for the wonderful library!

@NduatiK
Copy link
Author

NduatiK commented Apr 20, 2021

Yikes, just spotted this comment.

This might not work as it will undoubtedly increase the docs size.

@icidasset
Copy link
Owner

Hey! Thanks for the feature request, I'd love this too! But yeah, you guessed it, the size limitation on the Elm docs doesn't allow for this. I'll leave this open in case it ever changes though.

@NduatiK
Copy link
Author

NduatiK commented Apr 20, 2021

Thanks for the quick reply.
That sounds good, we'll wait for any changes.

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

No branches or pull requests

2 participants