59 lines
2.0 KiB
HTML
59 lines
2.0 KiB
HTML
<!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><pre></code> elements, like so:</p>
|
||
|
||
<pre><code><pre data-src="myfile.js"></pre></code></pre>
|
||
|
||
<p>You don’t need to specify the language, it’s 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 plugin’s 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 doesn’t 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>
|