Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion samples/seed/template/public/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ export default {
}
],
lunrLanguages: ['en', 'ru'],
configureHljs: function (hljs) {
start() {
console.log('started');
},
configureHljs (hljs) {
hljs.registerLanguage('bicep', bicep);
},
}
Expand Down
4 changes: 4 additions & 0 deletions templates/modern/src/docfx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

import 'bootstrap'
import { options } from './helper'
import { highlight } from './highlight'
import { renderMarkdown } from './markdown'
import { enableSearch } from './search'
Expand All @@ -25,6 +26,9 @@ declare global {
async function init() {
window.docfx = window.docfx || {}

const { start } = await options()
start?.()

const pdfmode = navigator.userAgent.indexOf('docfx/pdf') >= 0
if (pdfmode) {
await Promise.all([
Expand Down
3 changes: 3 additions & 0 deletions templates/modern/src/options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export type DocfxOptions = {
/** A list of [lunr languages](https://github.com/MihaiValentin/lunr-languages#readme) such as fr, es for full text search */
lunrLanguages?: string[],

/** Hooks to app start event */
start?: () => void,

/** Configures [hightlight.js](https://highlightjs.org/) */
configureHljs?: (hljs: HLJSApi) => void,
}