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

Markdown Parsing #186

Merged
merged 28 commits into from
Nov 12, 2024
Merged

Markdown Parsing #186

merged 28 commits into from
Nov 12, 2024

Conversation

SleeplessOne1917
Copy link
Member

I use the body of this post showing off the markdown features to test.

Headings (and monospace)

image

Block Quotes

image

Lists

image

Image/emoji

image

Subscript/superscript/ruby

image

Tables

image

Spoiler

image
image

Currently inline footnotes and code blocks are still not there. The former is due to a conflict between the footnote plugin and my superscript plugin. I opened an issue a while back to work with the maintainer, but got no response. The latter I think is worth deferring until we have a solid idea of how we're handling themes, since syntect (which markdown-it uses for highlighted code blocks) has its own way of theming.

Comment on lines +5 to +19
.markdown-content {
@apply bg-base-200 mt-4 p-5 rounded space-y-4;
}

.markdown-content h1 {
@apply text-2xl font-black;
}

.markdown-content h2 {
@apply text-2xl font-bold;
}

.markdown-content h3 {
@apply text-xl font-black;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Trying to do the styling with tailwind classes got pretty ugly since I can't add the classes directly to the elements rendered from the markdown, so I did the styling here while using tailwind classes for everything that wasn't a one-off style.

Copy link
Member

Choose a reason for hiding this comment

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

No probs, ya since you're using tailwind classes anyway then we'll probably be fine.

public/icons.svg Outdated
Copy link
Member Author

Choose a reason for hiding this comment

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

Made some changes to this so I could use SVG sprites. This StackOverflow thread explains it well.

Comment on lines +53 to +58
.markdown-content blockquote:not(blockquote blockquote)::after {
content: " ";
mask-image: url("/icons.svg#css-quote");
-webkit-mask-image: url("/icons.svg#css-quote");
@apply bg-info block size-6 absolute end-1 bottom-1;
}
Copy link
Member Author

@SleeplessOne1917 SleeplessOne1917 Nov 11, 2024

Choose a reason for hiding this comment

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

The mask-image approach lets me control the color of the icon being used from a URL in CSS.

Copy link
Member

@dessalines dessalines left a comment

Choose a reason for hiding this comment

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

Looks really good 👍 . Merge whenever you see fit.

Comment on lines +5 to +19
.markdown-content {
@apply bg-base-200 mt-4 p-5 rounded space-y-4;
}

.markdown-content h1 {
@apply text-2xl font-black;
}

.markdown-content h2 {
@apply text-2xl font-bold;
}

.markdown-content h3 {
@apply text-xl font-black;
}
Copy link
Member

Choose a reason for hiding this comment

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

No probs, ya since you're using tailwind classes anyway then we'll probably be fine.

}

.markdown-content h1 {
@apply text-2xl font-black;
Copy link
Member

Choose a reason for hiding this comment

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

font-black should probably be removed, as it might not work well with a dark theme of daisy-ui.

Copy link
Member Author

Choose a reason for hiding this comment

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

Despite the name, font-black is setting the font weight, not the text color. https://tailwindcss.com/docs/font-weight

Copy link
Member

Choose a reason for hiding this comment

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

Ah cool.

@SleeplessOne1917 SleeplessOne1917 merged commit 22e87ea into main Nov 12, 2024
2 checks passed
@SleeplessOne1917 SleeplessOne1917 deleted the markdown-parsing branch November 12, 2024 14:03
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.

2 participants