File tree Expand file tree Collapse file tree 3 files changed +49
-3
lines changed
documentation/content/Components Expand file tree Collapse file tree 3 files changed +49
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ Title : Code Snippets -- Highlight Lines
3+ Tags : markdown, code-snippets, gist
4+ Date : 2020-02-02 20:12
5+ comments : false
6+ Slug : code-snippets-highlight-lines
7+ authors : Talha Mansoor
8+ Category : Components
9+ ---
10+
11+ [ Python-Markdown] ( https://github.com/Python-Markdown/markdown/ ) uses
12+ [ CodeHilite] ( https://python-markdown.github.io/extensions/code_hilite/ ) <!-- yaspeller ignore -->
13+ extension for syntax highlighting.
14+
15+ 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 ) .
16+
17+ Elegant supports this feature.
18+
19+ :::python hl_lines="1 3"
20+ # This line is emphasized
21+ # This line isn't
22+ # This line is emphasized
23+
24+ Another example,
25+
26+ :::html hl_lines="2"
27+ <div
28+ class="photoswipe-gallery"
29+ itemscope
30+ itemtype="http://schema.org/ImageGallery"
31+ >
32+ </div>
33+
34+ Another example,
35+
36+ #!python hl_lines="2"
37+ # Code goes here ..
38+ # This line is emphasized
39+ # This line isn't
Original file line number Diff line number Diff line change 1+ /* For highlighting lines in code snippets */
2+ .highlight span .hll span {
3+ background-color : black;
4+ display : inline-block;
5+ width : 100% ;
6+ }
17div .highlight {
28 margin-bottom : 20px ;
39 border-radius : var (--borderRadius );
Original file line number Diff line number Diff line change 11.highlight .hll {
2- background-color : # ffffcc ;
2+ /* This line results in highlighting whitespaces -- Talha */
3+ /* background-color: #ffffcc; */
34}
45.highlight {
56 background : # 282828 ;
301302 color : # d3869b ;
302303 background-color : # 282828 ;
303304} /* Literal.Number.Integer.Long */
304- /* My fixes */
305+ /* My fixes -- Talha */
305306.highlight .cpf {
306307 color : # b8bb26 ;
307308 background-color : # 282828 ;
308- }
309+ }
You can’t perform that action at this time.
0 commit comments