prism/plugins/file-highlight/index.html

59 lines
2.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="assets/favicon.png" />
<title>File Highlight ▲ Prism plugins</title>
<base href="../.." />
<link rel="stylesheet" href="assets/style.css" />
<link rel="stylesheet" href="themes/prism.css" data-noprefix />
<script src="assets/vendor/prefixfree.min.js"></script>
<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
<script src="https://www.google-analytics.com/ga.js" async></script>
</head>
<body>
<header data-plugin-header="file-highlight"></header>
<section class="language-markup">
<h1>How to use</h1>
<p>Use the <code>data-src</code> attribute on empty <code>&lt;pre></code> elements, like so:</p>
<pre><code>&lt;pre data-src="myfile.js">&lt;/pre></code></pre>
<p>You dont need to specify the language, its automatically determined by the file extension.
If, however, the language cannot be determined from the file extension or the file extension is incorrect, you may specify a language as well (with the usual class name way).</p>
<p>Please note that the files are fetched with XMLHttpRequest. This means that if the file is on a different origin, fetching it will fail, unless CORS is enabled on that website.</p>
</section>
<section>
<h1>Examples</h1>
<p>The plugins JS code:</p>
<pre data-src="plugins/file-highlight/prism-file-highlight.js"></pre>
<p>This page:</p>
<pre data-src="plugins/file-highlight/index.html"></pre>
<p>File that doesnt exist:</p>
<pre data-src="foobar.js"></pre>
<p>For more examples, browse around the Prism website. Most large code samples are actually files fetched with this plugin.</p>
</section>
<footer data-src="assets/templates/footer.html" data-type="text/html"></footer>
<script src="prism.js"></script>
<!-- The File Highlight plugin is already included into Prism.js build -->
<script src="assets/vendor/utopia.js"></script>
<script src="components.js"></script>
<script src="assets/code.js"></script>
</body>
</html>