Site Notice

hello, world

Difference between revisions of "Highlight"

From Project-EPB Commons
m ([InPageEdit])
([InPageEdit] 没有编辑摘要)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
<code class="hljs javascript">
+
<pre class="highlight lang-js">
$('.abc').html('<span>some thing.</span>');
+
console.log('hello, world')
</code>
+
</pre>
  
<syntaxhighlight lang="JavaScript">
+
<pre class="highlight lang-js linenums">
$('.abc').html('<span>some thing.</span>');
+
// 显示行号
</syntaxhighlight >
+
console.log('hello, world')
 +
</pre>
 +
 
 +
<pre class="highlight lang-js" data-line-from="3">
 +
// 行号会从 3 开始
 +
console.log('Line 4!')
 +
console.log('Oh, that is five')
 +
</pre>
 +
 
 +
<pre class="highlight lang-js" data-line-ping="[2,4]">
 +
// 第 2 以及第 4 行会高亮显示
 +
console.log('hello, world')
 +
console.log('Oh, yeah')
 +
console.log('I\'m pinged!')
 +
</pre>
 +
 
 +
<source lang="php" line>
 +
<?php
 +
  echo 'hey!';
 +
?>
 +
</source>

Latest revision as of 23:29, 19 November 2020

console.log('hello, world')
// 显示行号
console.log('hello, world')
// 行号会从 3 开始
console.log('Line 4!')
console.log('Oh, that is five')
// 第 2 以及第 4 行会高亮显示
console.log('hello, world')
console.log('Oh, yeah')
console.log('I\'m pinged!')
1 <?php
2   echo 'hey!';
3 ?>