Skip to content

Commit

Permalink
score: factors for headers in markdown (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
keegancsmith authored Oct 19, 2023
1 parent 70f5dd3 commit d8bfea1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions contentprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,16 @@ func scoreKind(language string, kind string) float64 {
case "type":
factor = 10
}
case "Markdown", "markdown":
// Headers are good signal in docs, but do not rank as highly as code.
switch kind {
case "chapter": // #
factor = 4
case "section": // ##
factor = 3
case "subsection": // ###
factor = 2
}
}

return factor * scoreKindMatch
Expand Down

0 comments on commit d8bfea1

Please sign in to comment.