Skip to content

Commit a9f07c7

Browse files
pedrolucasphonza
authored andcommitted
Add support for selecting source code line
I've also removed the fixed top bar, as it was overlapping with the highlighted line code. It didn't serve a greater purpose as well.
1 parent 0f33f02 commit a9f07c7

File tree

5 files changed

+5
-3
lines changed

5 files changed

+5
-3
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/honza/smithy
33
go 1.15
44

55
require (
6-
github.com/alecthomas/chroma v0.8.1
6+
github.com/alecthomas/chroma v0.8.2
77
github.com/gin-gonic/gin v1.6.3
88
github.com/go-git/go-git/v5 v5.1.0
99
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyV
1111
github.com/alecthomas/chroma v0.7.2-0.20200305040604-4f3623dce67a/go.mod h1:fv5SzZPFJbwp2NXJWpFIX7DZS4HgV1K4ew4Pc2OZD9s=
1212
github.com/alecthomas/chroma v0.8.1 h1:ym20sbvyC6RXz45u4qDglcgr8E313oPROshcuCHqiEE=
1313
github.com/alecthomas/chroma v0.8.1/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM=
14+
github.com/alecthomas/chroma v0.8.2 h1:x3zkuE2lUk/RIekyAJ3XRqSCP4zwWDfcw/YJCuCAACg=
15+
github.com/alecthomas/chroma v0.8.2/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM=
1416
github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo=
1517
github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0=
1618
github.com/alecthomas/kong v0.1.17-0.20190424132513-439c674f7ae0/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI=

include/header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<link rel="stylesheet" href="{{ css }}" />
1111
</head>
1212
<body>
13-
<nav class="navbar navbar-expand navbar-light bg-light fixed-top">
13+
<nav class="navbar navbar-expand navbar-light bg-light">
1414
<a class="navbar-brand" href="/">{{ .Site.Title }}</a>
1515
<div class="collapse navbar-collapse" id="navbarSupportedContent">
1616
<ul class="navbar-nav mr-auto">

include/style.css

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/smithy/smithy.go

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ func RenderSyntaxHighlighting(file *object.File) (string, error) {
203203
formatter := html.New(
204204
html.WithClasses(true),
205205
html.WithLineNumbers(true),
206+
html.LineNumbersInTable(true),
206207
html.LinkableLineNumbers(true, "L"),
207208
)
208209

0 commit comments

Comments
 (0)