Learn how to highlight code snippets with Phiki.
Phiki::codeToHtml()
method.
string
.style
attributes, so there’s no need to add any CSS to your project to get started.
However, you may want to add some basic styles to the <pre>
element that Phiki generates to improve the overall appearance of code blocks. Here is a sample CSS snippet you can use:
withGutter()
method on the result of codeToHtml()
.
editorLineNumber.foreground
styles provided by your chosen theme, but you can override these styles using CSS.
1
, you can use the startingLine()
method.
5
, the second line 6
, and so on.