@@ -6,6 +6,7 @@ module.exports = config
66
77var viewPaths = {github: 'blob', gitlab: 'blob', bitbucket: 'src'}
88var headingPrefixes = {github: '#', gitlab: '#', bitbucket: '#markdown-header-'}
9+var topAnchors = {github: '#readme', gitlab: '#readme'}
910var lineLinks = {github: true, gitlab: true}
1011
1112function config(ctx) {
@@ -17,7 +18,13 @@ function config(ctx) {
1718 return
1819 }
1920
20− urlConfig = {prefix: '', headingPrefix: '#', lines: false, hostname: null}
21+ urlConfig = {
22+ prefix: '',
23+ headingPrefix: '#',
24+ lines: false,
25+ hostname: null,
26+ topAnchor: null
27+ }
2128
2229 if (repo) {
2330 info = hostedGitInfo.fromUrl(repo)
@@ -36,6 +43,10 @@ function config(ctx) {
3643 urlConfig.lines = lineLinks[info.type]
3744 }
3845
46+ if (info.type in topAnchors) {
47+ urlConfig.topAnchor = topAnchors[info.type]
48+ }
49+
3950 urlConfig.hostname = info.domain
4051 }
4152