Skip to content

Commit dbdc08c

Browse files
Merge pull request #651 from srobo/improve-syntax-highlighting
Improve syntax highlighting
2 parents 53f1195 + 9d57369 commit dbdc08c

File tree

4 files changed

+16
-75
lines changed

4 files changed

+16
-75
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ _site
44
.jekyll-metadata
55
.bundle
66
node_modules/
7+
_sass/_syntax-highlighting.scss

Rakefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,16 @@ end
3434

3535
task :submodules => ['_sass/brand/.git']
3636

37-
task :dev => [:dependencies, :submodules] do
37+
task :styles => [:dependencies] do
38+
highlight_css = `bundle exec rougify style github`.strip()
39+
File.write("_sass/_syntax-highlighting.scss", highlight_css)
40+
end
41+
42+
task :dev => [:dependencies, :submodules, :styles] do
3843
sh('bundle exec jekyll serve --host 0.0.0.0 --drafts --config _config.yml,_dev.yml')
3944
end
4045

41-
task :build => [:dependencies, :submodules] do
46+
task :build => [:dependencies, :submodules, :styles] do
4247
sh('bundle exec jekyll build --config _config.yml')
4348
end
4449

_sass/_syntax-highlighting.scss

Lines changed: 0 additions & 71 deletions
This file was deleted.

_sass/common.scss

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,17 @@
3333
}
3434
}
3535

36-
.highlight {
37-
padding: 1rem;
36+
pre.highlight {
37+
padding: 1.5rem;
3838
}
3939

4040
.centered-content {
4141
display: flex;
4242
justify-content: center;
4343
}
44+
45+
code.highlighter-rouge {
46+
@extend .highlight;
47+
48+
padding: 0.1rem;
49+
}

0 commit comments

Comments
 (0)