Skip to content
This repository was archived by the owner on Apr 21, 2022. It is now read-only.

Commit f5c4f20

Browse files
committed
feat: enable rouge highlighter
1 parent 7b775d5 commit f5c4f20

File tree

4 files changed

+135
-2
lines changed

4 files changed

+135
-2
lines changed

_includes/header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% assign icon_color = "#24292e" %}
55
{% endif %}
66

7-
{% assign content = page.content | strip_newlines %}
7+
{% assign content = page.content %}
88

99
{% assign posts_total = site.posts | size %}
1010

_posts/2019-01-29-hello-world.md

+68-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,75 @@
11
---
22
title: "Welcome to Jekyll!"
3-
published: false
3+
published: true
44
---
55

66
**Hello world**, this is my first Jekyll blog post.
77

88
I hope you like it!
9+
10+
# Highlighter
11+
## Ruby
12+
```ruby
13+
def show
14+
puts "Outputting a very lo-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-ong lo-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-ong line"
15+
@widget = Widget(params[:id])
16+
respond_to do |format|
17+
format.html # show.html.erb
18+
format.json { render json: @widget }
19+
end
20+
end
21+
```
22+
23+
## Php
24+
```php
25+
<?php
26+
print("Hello {$world}");
27+
?>
28+
```
29+
30+
## Java
31+
```java
32+
public class java {
33+
public static void main(String[] args) {
34+
System.out.println("Hello World");
35+
}
36+
}
37+
```
38+
39+
## HTML
40+
```html
41+
<html>
42+
<head><title>Title!</title></head>
43+
<body>
44+
<p id="foo">Hello, World!</p>
45+
<script type="text/javascript">var a = 1;</script>
46+
<style type="text/css">#foo { font-weight: bold; }</style>
47+
</body>
48+
</html>
49+
```
50+
51+
## Console
52+
```console
53+
# prints "hello, world" to the screen
54+
~# echo Hello, World
55+
Hello, World
56+
57+
# don't run this
58+
~# rm -rf --no-preserve-root /
59+
```
60+
61+
## Css
62+
```css
63+
body {
64+
font-size: 12pt;
65+
background: #fff url(temp.png) top left no-repeat;
66+
}
67+
```
68+
69+
## Yaml
70+
```yaml
71+
---
72+
one: Mark McGwire
73+
two: Sammy Sosa
74+
three: Ken Griffey
75+
```

_sass/_syntax.scss

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
.highlight { background: #ffffff; }
2+
.highlight .c { color: #999988; font-style: italic } /* Comment */
3+
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
4+
.highlight .k { font-weight: bold } /* Keyword */
5+
.highlight .o { font-weight: bold } /* Operator */
6+
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
7+
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
8+
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
9+
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
10+
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
11+
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
12+
.highlight .ge { font-style: italic } /* Generic.Emph */
13+
.highlight .gr { color: #aa0000 } /* Generic.Error */
14+
.highlight .gh { color: #999999 } /* Generic.Heading */
15+
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
16+
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
17+
.highlight .go { color: #888888 } /* Generic.Output */
18+
.highlight .gp { color: #555555 } /* Generic.Prompt */
19+
.highlight .gs { font-weight: bold } /* Generic.Strong */
20+
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
21+
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
22+
.highlight .kc { font-weight: bold } /* Keyword.Constant */
23+
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
24+
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
25+
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
26+
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
27+
.highlight .m { color: #009999 } /* Literal.Number */
28+
.highlight .s { color: #d14 } /* Literal.String */
29+
.highlight .na { color: #008080 } /* Name.Attribute */
30+
.highlight .nb { color: #0086B3 } /* Name.Builtin */
31+
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
32+
.highlight .no { color: #008080 } /* Name.Constant */
33+
.highlight .ni { color: #800080 } /* Name.Entity */
34+
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
35+
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
36+
.highlight .nn { color: #555555 } /* Name.Namespace */
37+
.highlight .nt { color: #000080 } /* Name.Tag */
38+
.highlight .nv { color: #008080 } /* Name.Variable */
39+
.highlight .ow { font-weight: bold } /* Operator.Word */
40+
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
41+
.highlight .mf { color: #009999 } /* Literal.Number.Float */
42+
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
43+
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
44+
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
45+
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
46+
.highlight .sc { color: #d14 } /* Literal.String.Char */
47+
.highlight .sd { color: #d14 } /* Literal.String.Doc */
48+
.highlight .s2 { color: #d14 } /* Literal.String.Double */
49+
.highlight .se { color: #d14 } /* Literal.String.Escape */
50+
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
51+
.highlight .si { color: #d14 } /* Literal.String.Interpol */
52+
.highlight .sx { color: #d14 } /* Literal.String.Other */
53+
.highlight .sr { color: #009926 } /* Literal.String.Regex */
54+
.highlight .s1 { color: #d14 } /* Literal.String.Single */
55+
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
56+
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
57+
.highlight .vc { color: #008080 } /* Name.Variable.Class */
58+
.highlight .vg { color: #008080 } /* Name.Variable.Global */
59+
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
60+
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
61+
62+
/* Make line numbers unselectable: excludes line numbers from copy-paste user ops */
63+
.highlight .lineno {-webkit-user-select: none;-moz-user-select: none; -o-user-select: none;}
64+
.lineno::-moz-selection {background-color: transparent;} /* Mozilla specific */
65+
.lineno::selection {background-color: transparent;} /* Other major browsers */

assets/styles.scss

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
---
33
@import url('https://unpkg.com/primer/build/build.css');
44
@import url('https://fonts.googleapis.com/css?family=Rubik:400,500,700,900');
5+
@import 'syntax';
56

67
body {
78
font-family: 'Rubik', sans-serif;

0 commit comments

Comments
 (0)