diff --git a/components.js b/components.js
index 3c729bb53c..aa185fe284 100644
--- a/components.js
+++ b/components.js
@@ -160,6 +160,10 @@ var components = {
'file-highlight': {
title: 'File Highlight',
noCSS: true
+ },
+ 'show-language': {
+ title: 'Show Language',
+ owner: 'nauzilus'
}
}
};
diff --git a/plugins/show-language/index.html b/plugins/show-language/index.html
new file mode 100644
index 0000000000..aa790af970
--- /dev/null
+++ b/plugins/show-language/index.html
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+Show Language ▲ Prism plugins
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Examples
+
+ JavaScript
+
+
+ CSS
+
+
+ HTML (Markup)
+
+
+
+
+ Known Issues
+
+
+ - Changes the appearence of the Funky theme, to be less 'funky' and more 'black'
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugins/show-language/prism-show-language.css b/plugins/show-language/prism-show-language.css
new file mode 100644
index 0000000000..5561baeb7b
--- /dev/null
+++ b/plugins/show-language/prism-show-language.css
@@ -0,0 +1,21 @@
+pre[class*='language-'] {
+ position: relative;
+}
+pre[class*='language-'] > code[data-language] {
+ overflow: scroll;
+ max-height: 28em;
+ display: block;
+}
+pre[class*='language-'] > code[data-language]::before {
+ content: attr(data-language);
+ color: black;
+ background-color: #CFCFCF;
+ display: inline-block;
+ position: absolute;
+ top: 0;
+ right: 0;
+ font-size: 0.9em;
+ border-radius: 0 0 0 5px;
+ padding: 0 0.5em;
+ text-shadow: none;
+}
\ No newline at end of file
diff --git a/plugins/show-language/prism-show-language.js b/plugins/show-language/prism-show-language.js
new file mode 100644
index 0000000000..7ca2f231a9
--- /dev/null
+++ b/plugins/show-language/prism-show-language.js
@@ -0,0 +1,16 @@
+(function(){
+
+if (!self.Prism) {
+ return;
+}
+
+var Languages = {
+ 'csharp': 'C#',
+ 'cpp': 'C++'
+};
+Prism.hooks.add('before-highlight', function(env) {
+ var language = Languages[env.language] || env.language;
+ env.element.setAttribute('data-language', language);
+});
+
+})();
diff --git a/plugins/show-language/prism-show-language.min.css b/plugins/show-language/prism-show-language.min.css
new file mode 100644
index 0000000000..76d4568213
--- /dev/null
+++ b/plugins/show-language/prism-show-language.min.css
@@ -0,0 +1 @@
+pre[class*=language-]{position:relative}pre[class*=language-]>code[data-language]{overflow:scroll;max-height:28em;display:block}pre[class*=language-]>code[data-language]::before{content:attr(data-language);color:#000;background-color:#CFCFCF;display:inline-block;position:absolute;top:0;right:0;font-size:.9em;border-radius:0 0 0 5px;padding:0 .5em;text-shadow:none}
\ No newline at end of file
diff --git a/plugins/show-language/prism-show-language.min.js b/plugins/show-language/prism-show-language.min.js
new file mode 100644
index 0000000000..548883134e
--- /dev/null
+++ b/plugins/show-language/prism-show-language.min.js
@@ -0,0 +1 @@
+(function(){if(!self.Prism){return}var e={csharp:"C#",cpp:"C++"};Prism.hooks.add("before-highlight",function(t){var n=e[t.language]||t.language;t.element.setAttribute("data-language",n)})})()
\ No newline at end of file