Use Doctocat link header style (#21615)
* update autolinkHeadings to use Doctocat link header style * fix header link test * update graphql/rest rendering to use doctocat header link * fix: miniToc issue with stray anchor Co-authored-by: Rachael Sewell <rachmari@github.com>
This commit is contained in:
@@ -21,6 +21,7 @@ import rewriteLocalLinks from './plugins/rewrite-local-links.js'
|
||||
import useEnglishHeadings from './plugins/use-english-headings.js'
|
||||
import rewriteLegacyAssetPaths from './plugins/rewrite-legacy-asset-paths.js'
|
||||
import wrapInElement from './plugins/wrap-in-element.js'
|
||||
import doctocatLinkIcon from './doctocat-link-icon.js'
|
||||
const graphql = HighlightjsGraphql.definer
|
||||
|
||||
export default function createProcessor(context) {
|
||||
@@ -32,7 +33,11 @@ export default function createProcessor(context) {
|
||||
.use(remark2rehype, { allowDangerousHtml: true })
|
||||
.use(slug)
|
||||
.use(useEnglishHeadings, context)
|
||||
.use(autolinkHeadings, { behavior: 'wrap' })
|
||||
.use(autolinkHeadings, {
|
||||
behavior: 'prepend',
|
||||
properties: { ariaHidden: true, tabIndex: -1, class: 'doctocat-link' },
|
||||
content: doctocatLinkIcon,
|
||||
})
|
||||
.use(highlight, {
|
||||
languages: { graphql, dockerfile, http, groovy, erb, powershell },
|
||||
subset: false,
|
||||
|
||||
Reference in New Issue
Block a user