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

Rendering Markdown in Enhance #202

Merged
merged 9 commits into from
Mar 20, 2024
Merged

Rendering Markdown in Enhance #202

merged 9 commits into from
Mar 20, 2024

Conversation

macdonst
Copy link
Contributor

We've seen folks searching for Markdown and Enhance so I'm trying to surface our solution on enhance.dev.

Signed-off-by: macdonst <simon.macdonald@gmail.com>
Signed-off-by: macdonst <simon.macdonald@gmail.com>
@tbeseda
Copy link
Contributor

tbeseda commented Mar 20, 2024

related: an old entry I wrote about using custom elements in Markdown. maybe it can be repurposed as an aside here or a sub-document
https://github.com/enhance-dev/enhance.dev/blob/main/app/docs/md/by-example/integrations/custom-elements-in-md.md

@macdonst
Copy link
Contributor Author

@tbeseda Yes, I think an aside letting folks know they can use custom-elements in their markdown is a good idea.

Signed-off-by: macdonst <simon.macdonald@gmail.com>
Copy link
Member

@colepeters colepeters left a comment

Choose a reason for hiding this comment

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

Some suggestions for consistency/tone/etc! Nice work!

macdonst and others added 4 commits March 20, 2024 12:07
Signed-off-by: macdonst <simon.macdonald@gmail.com>
Co-authored-by: Cole Peters <cole@colepeters.com>
Signed-off-by: macdonst <simon.macdonald@gmail.com>
### Render order matters

When rendering HTML from Markdown that includes custom elements the rendering order matters. First, render the markdown to HTML with Arcdown then "enhance" that HTML by running it through Enhance SSR before sending it to the browser.

Copy link
Contributor

Choose a reason for hiding this comment

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

I feel it would be good to add a few words as to why.
Something like:
since Enhance expands custom elements that would not be present in the markup until after markdown converts the source into HTML.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the main worry is when the custom element is expanded it creates valid html which cannot be parsed by the markdown parser.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes that is true as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we should just say that Enhance produces a full HTML page and not a HTML snippet like Arcdown does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this section after chatting about it in Enhance sync

Copy link
Contributor

@kristoferjoseph kristoferjoseph left a comment

Choose a reason for hiding this comment

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

This is thorough. Hopefully this clears up any confusion for folks.

macdonst and others added 2 commits March 20, 2024 13:36
Co-authored-by: Cole Peters <cole@colepeters.com>
@macdonst macdonst merged commit 51fdf1f into main Mar 20, 2024
4 checks passed
@macdonst macdonst deleted the markdown branch March 20, 2024 20:18
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.

4 participants