Html Code Snippet

Html code snippet image

<!DOCTYPE html>
<html lang="en">
<head>

<meta charset="utf-8" />
<link rel="icon" href="assets/favicon.png" />
<title>Line Numbers ? Prism plugins</title>
<base href="../.." />
<link rel="stylesheet" href="assets/style.css" />
<link rel="stylesheet" href="themes/prism.css" data-noprefix />
<link rel="stylesheet" href="plugins/line-numbers/prism-line-numbers.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 class="language-none">

<header data-plugin-header="line-numbers"></header>

<section class="language-markup">
  <h1>How to use</h1>

  <p>Obviously, this is supposed to work only for code blocks (<code>&lt;pre>&lt;code></code>) and not for inline code.</p>
  <p>Add the <code>line-numbers</code> class to your desired <code>&lt;pre></code> or any of its ancestors, and the Line Numbers plugin will take care of the rest. To give all code blocks line numbers, add the <code>line-numbers</code> class to the <code>&lt;body></code> of the page. This is part of a general activation mechanism where adding the <code>line-numbers</code> (or <code>no-line-numbers</code>) class to any element will enable (or disable) the Line Numbers plugin for all code blocks in that element. <br> Example:</p>

  <pre><code>&lt;body class="line-numbers"> &lt;!-- enabled for the whole page -->

	&lt;!-- with line numbers -->
	&lt;pre>&lt;code>...&lt;/code>&lt;/pre>
	&lt;!-- disabled for a specific element - without line numbers -->
	&lt;pre class="no-line-numbers">&lt;code>...&lt;/code>&lt;/pre>

	&lt;div class="no-line-numbers"> &lt;!-- disabled for this subtree -->

		&lt;!-- without line numbers -->
		&lt;pre>&lt;code>...&lt;/code>&lt;/pre>
		&lt;!-- enabled for a specific element - with line numbers -->
		&lt;pre class="line-numbers">&lt;code>...&lt;/code>&lt;/pre>

	&lt;/div>
&lt;/body></code></pre>

  <p>Optional: You can specify the <code>data-start</code> (Number) attribute on the <code>&lt;pre></code> element. It will shift the line counter.</p>
  <p>Optional: To support multiline line numbers using soft wrap, apply the CSS <code>white-space: pre-line;</code> or <code>white-space: pre-wrap;</code> to your desired <code>&lt;pre></code>.</p>
</section>

<section class="line-numbers">
  <h1>Examples</h1>

  <h2>JavaScript</h2>
  <pre class="line-numbers" data-src="plugins/line-numbers/prism-line-numbers.js"></pre>

  <h2>CSS</h2>
  <p>Please note that this <code class="language-markup">&lt;pre></code> does not have the <code>line-numbers</code> class but its parent does.</p>
  <pre data-src="plugins/line-numbers/prism-line-numbers.css"></pre>

  <h2>HTML</h2>
  <p>Please note the <code>data-start="-5"</code> in the code below.</p>
  <pre class="line-numbers" data-src="plugins/line-numbers/index.html" data-start="-5"></pre>

  <h2>Unknown languages</h2>
  <pre class="language-none line-numbers"><code>This raw text
is not highlighted
but it still has
line numbers</code></pre>

  <h2>Soft wrap support</h2>
  <p>Please note the <code>style="white-space:pre-wrap;"</code> in the code below.</p>
  <pre class="line-numbers" data-src="plugins/line-numbers/index.html" data-start="-5" style="white-space:pre-wrap;"></pre>

</section>

<footer data-src="assets/templates/footer.html" data-type="text/html"></footer>

<script src="prism.js"></script>
<script src="plugins/line-numbers/prism-line-numbers.js"></script>
<script src="assets/vendor/utopia.js"></script>
<script src="components.js"></script>
<script src="assets/code.js"></script>


</body>
</html>

 

Leave a non public comment how to improve it.



Characters Remaining

We are sorry for your bad experiance. Leave a non public comment how to improve it.



Characters Remaining

Related Posts (4)

HTML structure image

HTML structure

Author image
By GETACHEW Sat Oct 09, 2021 at 05:57 PM (3 years ago)
Updated On Fri Nov 04, 2022 at 06:35 PM (2 years ago)

What is an HTML Element?

An HTML element is defined by a start tag, some content, and an end tag:

<tagname>Content goes here...</tagname>

The HTML element is everything from the start tag to the end tag

Read More »
Responsive Menu Bar image

Responsive Menu Bar

Author image
By MICHAEL Fri Aug 14, 2020 at 05:53 PM (4 years ago)
Updated On Fri Nov 04, 2022 at 03:08 PM (2 years ago)

how to make responsive menu bar across all media query or resolution 

Read More »
html  image

Html

Author image
By MEBRATU Mon Jul 13, 2020 at 04:19 AM (4 years ago)
Updated On Fri Nov 04, 2022 at 03:08 PM (2 years ago)

this is the verification of related post

Read More »
Admin Dashboard Layout image

Admin Dashboard Layout

Author image
By MEBRATU Tue Jul 07, 2020 at 03:47 AM (4 years ago)
Updated On Thu Dec 01, 2022 at 10:58 AM (one year ago)

one more

Read More »

Share this on

Search


Archives

No archives data found yet in 2025.

No archives data found in 2016.

Find Us on Facebook

Subscribe for new updates




Back to Top