Skip to content

Commit

Permalink
Upgrade minor packages (github#20960)
Browse files Browse the repository at this point in the history
* Upgrade minor packages

* Add dockerfile syntax back

* Update create-processor.js

* Update create-processor.js
  • Loading branch information
heiskr authored Aug 19, 2021
1 parent 5e40655 commit dc952b9
Show file tree
Hide file tree
Showing 7 changed files with 1,697 additions and 3,117 deletions.
2 changes: 1 addition & 1 deletion components/lib/experiment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function sendSuccess(test: string) {
})
}

export default function () {
export default function experiment() {
// *** Example test code ***
// const testName = '$test-name$'
// const xbucket = bucket(testName)
Expand Down
2 changes: 1 addition & 1 deletion components/lib/localization.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function () {
export default function localization() {
const linkToEnglish = document.querySelector('#to-english-doc') as HTMLAnchorElement

if (linkToEnglish) {
Expand Down
2 changes: 1 addition & 1 deletion components/lib/wrap-code-terms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const slashChars = /([/\\])/g
// This module improves table rendering on reference pages by inserting a <wbr>
// tag in code terms that use camelcase, slashes, or underscores, inspired by
// http://heap.ch/blog/2016/01/19/camelwrap/
export default function () {
export default function wrapCodeTerms() {
const codeTerms = document.querySelectorAll('#article-contents table code')
if (!codeTerms) return

Expand Down
10 changes: 9 additions & 1 deletion lib/render-content/create-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import raw from 'rehype-raw'
import slug from 'rehype-slug'
import autolinkHeadings from 'rehype-autolink-headings'
import highlight from 'rehype-highlight'
import dockerfile from 'highlight.js/lib/languages/dockerfile.js'
import http from 'highlight.js/lib/languages/http.js'
import groovy from 'highlight.js/lib/languages/groovy.js'
import erb from 'highlight.js/lib/languages/erb.js'
import powershell from 'highlight.js/lib/languages/powershell.js'
import html from 'rehype-stringify'
import HighlightjsGraphql from 'highlightjs-graphql'
import remarkCodeExtra from 'remark-code-extra'
Expand All @@ -28,7 +33,10 @@ export default function createProcessor(context) {
.use(slug)
.use(useEnglishHeadings, context)
.use(autolinkHeadings, { behavior: 'wrap' })
.use(highlight, { languages: { graphql }, subset: false })
.use(highlight, {
languages: { graphql, dockerfile, http, groovy, erb, powershell },
subset: false,
})
.use(raw)
.use(rewriteLegacyAssetPaths, context)
.use(wrapInElement, { selector: 'ol > li img', wrapper: 'span.procedural-image-wrapper' })
Expand Down
2 changes: 1 addition & 1 deletion lib/render-content/plugins/use-english-headings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import GithubSlugger from 'github-slugger'
import HtmlEntities from 'html-entities'
import toString from 'hast-util-to-string'
import { toString } from 'hast-util-to-string'
import { visit } from 'unist-util-visit'
const slugger = new GithubSlugger()
const entities = new HtmlEntities.XmlEntities()
Expand Down
Loading

0 comments on commit dc952b9

Please sign in to comment.