Skip to content

Add ability to add other classes to the :syntax plugin #90

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

Merged
merged 4 commits into from
Apr 7, 2025

Conversation

donnfelker
Copy link
Contributor

Add the ability to provide additional classes to the <pre> tag.

Usage:

activate :syntax, :classes => ['not-prose']

Use Case:
When you're rendering code inside of tailwind typography prose classes, which we do in RubyStaticPro prose will try to take over the rendering of the code block. To stop this from happening you can apply the not-prose class and tailwindcss typography will not format it. See docs here

This update allows you to provide additional classes that will be rendered to the <pre> tag.

In the config.rb

activate :syntax, :classes => ['not-prose']

Result:

<div class="highlight">
-  <pre class="highlight ruby">...</pre>
+  <pre class="highlight ruby not-prose">...</pre>
</div>

@markets
Copy link
Member

markets commented Apr 6, 2025

Thanks @donnfelker! Just added a couple of minor comments, but +1 for the feature 👍

Copy link
Member

@markets markets left a comment

Choose a reason for hiding this comment

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

Thanks @donnfelker! Test failures are unrelated, fixed them on master (5ca4c2a).

@markets markets merged commit 159c7ba into middleman:master Apr 7, 2025
0 of 5 checks passed
@donnfelker
Copy link
Contributor Author

Fantastic! Thanks for accepting the PR 🎉

@markets
Copy link
Member

markets commented Apr 7, 2025

@donnfelker New version pushed to RubyGems: https://rubygems.org/gems/middleman-syntax/versions/3.5.0 🎉

@donnfelker
Copy link
Contributor Author

Thank you so much!

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