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

Plugin to show highlighted language, per Issue #1 #216

Merged
merged 2 commits into from
Apr 28, 2014

Conversation

nauzilus
Copy link
Contributor

New plugin to place a label in the top-right corner of highlighted code blocks (not inline code), displaying the current markup. Label remains in the top-right even when scrolling.

Either the Coy or Funky theme will look a bit off with this plugin applied. See example.
The Funky theme has a fully black background (rather than just the text), since the pre > code is now display:block rather than inline, to allow the label in the pseudo element to anchor to the wrapping pre. Putting the pseudo element on the wrapping pre works also, but the Coy theme then loses it's shadow. Since I like the Coy theme better, I'll choose not to affect that one :)

@LeaVerou
Copy link
Member

Hey, thanks & sorry for the delay! Is there any online demo or screenshots?

@nauzilus
Copy link
Contributor Author

Hi Lea,

Yes, you can view at http://nauzilus.net/prism/plugins/show-language/ or a "real life" example at http://danielflint.im/2014/03/migrating-to-prism/.

@LeaVerou
Copy link
Member

Nice, I like this! Been meaning to make something similar for ages. Could you please add an owner property to components.js with yourself as the owner? It's a new thing.

@nauzilus
Copy link
Contributor Author

Done!

LeaVerou added a commit that referenced this pull request Apr 28, 2014
Plugin to show highlighted language, per Issue #1
@LeaVerou LeaVerou merged commit c1aa335 into PrismJS:gh-pages Apr 28, 2014
@LeaVerou
Copy link
Member

Brilliant, thanks, merged!

As a further improvement, it would be nice if it used a different font (Helvetica Neue, sans-serif would be a safe choice) and the background was a darker/lighter version of the code's background instead of a shade of gray (which doesn't quite match). Some more padding could improve it too.

@nauzilus nauzilus deleted the plugin-show-langauge branch May 24, 2014 23:43
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