-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(syntax): add support for highlighting lines in code snippets
fix #520
- Loading branch information
Showing
3 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
documentation/content/Components/code-style-highlight-lines.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
Title: Code Snippets -- Highlight Lines | ||
Tags: markdown, code-snippets, gist | ||
Date: 2020-02-02 20:12 | ||
comments: false | ||
Slug: code-snippets-highlight-lines | ||
authors: Talha Mansoor | ||
Category: Components | ||
--- | ||
|
||
[Python-Markdown](https://github.com/Python-Markdown/markdown/) uses | ||
[CodeHilite](https://python-markdown.github.io/extensions/code_hilite/) <!-- yaspeller ignore --> | ||
extension for syntax highlighting. | ||
|
||
This extension lets you highlight specific lines in your code snippets. You can read the instructions [here](https://python-markdown.github.io/extensions/code_hilite/#colons). | ||
|
||
Elegant supports this feature. | ||
|
||
:::python hl_lines="1 3" | ||
# This line is emphasized | ||
# This line isn't | ||
# This line is emphasized | ||
|
||
Another example, | ||
|
||
:::html hl_lines="2" | ||
<div | ||
class="photoswipe-gallery" | ||
itemscope | ||
itemtype="http://schema.org/ImageGallery" | ||
> | ||
</div> | ||
|
||
Another example, | ||
|
||
#!python hl_lines="2" | ||
# Code goes here .. | ||
# This line is emphasized | ||
# This line isn't |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters