Skip to content

Commit

Permalink
Merge pull request #449 from nauzilus/language-powershell
Browse files Browse the repository at this point in the history
Add PowerShell language
  • Loading branch information
LeaVerou committed Dec 31, 2014
2 parents e262ba8 + 905d952 commit d6b2aa0
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 2 deletions.
4 changes: 4 additions & 0 deletions components.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ var components = {
"title": "Dart",
"require": "clike",
"owner": "Golmote"
},
"powershell": {
"title": "PowerShell",
"owner": "nauzilus"
}
},
"plugins": {
Expand Down
34 changes: 34 additions & 0 deletions components/prism-powershell.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions components/prism-powershell.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions examples/prism-powershell.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<h1>PowerShell</h1>
<p>To use this language, use the class "language-powershell".</p>

<h2>Comments</h2>
<pre><code># This is a comment
<# This is a
multi-line comment #></code></pre>

<h2>Variable Interpolation</h2>
<pre><code>$Name = "Alice"
Write-Host "Hello, my name is $Name."</code></pre>

<h2>Full Example</h2>
<pre><code>Function SayHello([string]$name) {
Write-Host "Hello, $name."
}
$Names = @("Bob", "Alice")

$Names | ForEach {
SayHello $_
}
</code></pre>
4 changes: 3 additions & 1 deletion plugins/file-highlight/prism-file-highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ var Extensions = {
'svg': 'markup',
'xml': 'markup',
'py': 'python',
'rb': 'ruby'
'rb': 'ruby',
'ps1': 'powershell',
'psm1': 'powershell'
};

Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function(pre) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/file-highlight/prism-file-highlight.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d6b2aa0

Please sign in to comment.