Skip to content

Commit 05b6ac8

Browse files
committed
docs: demo page includes adoc-asciidoc
1 parent 04d128e commit 05b6ac8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

docs/extensions/mrdocs-demos.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ module.exports = function (registry) {
144144
}
145145

146146
// Remove Rendered Asciidoc from the list of formats
147-
// - The raw Asciidoc is already rendered by the mrdocs.com server as HTML
148-
versionFormats = versionFormats.filter(format => format !== 'adoc-asciidoc');
149147
let multipageFormats = versionFormats.filter(format => format !== 'xml');
150148

151149
let versionFormatColumns = versionFormats.map(format => `*${humanizeFormat(format)}*`).join(' | ');
@@ -194,11 +192,14 @@ module.exports = function (registry) {
194192
}
195193
return '';
196194
})()
197-
if (['adoc', 'xml', 'html'].includes(format)) {
198-
const adoc_icon = 'https://avatars.githubusercontent.com/u/3137042?s=200&v=4'
199-
const html_icon = 'https://raw.githubusercontent.com/FortAwesome/Font-Awesome/refs/heads/6.x/svgs/brands/html5.svg'
200-
const code_file_icon = 'https://raw.githubusercontent.com/FortAwesome/Font-Awesome/6.x/svgs/solid/file-code.svg'
201-
const icon = format === 'adoc' ? adoc_icon : format === 'html' ? html_icon : code_file_icon
195+
if (['adoc', 'xml', 'html', 'adoc-asciidoc'].includes(format)) {
196+
const formatIcons = {
197+
adoc: 'https://avatars.githubusercontent.com/u/3137042?s=200&v=4',
198+
html: 'https://raw.githubusercontent.com/FortAwesome/Font-Awesome/refs/heads/6.x/svgs/brands/html5.svg',
199+
'adoc-asciidoc': 'https://raw.githubusercontent.com/FortAwesome/Font-Awesome/refs/heads/6.x/svgs/brands/html5.svg',
200+
default: 'https://raw.githubusercontent.com/FortAwesome/Font-Awesome/6.x/svgs/solid/file-code.svg'
201+
};
202+
const icon = formatIcons[format] || formatIcons.default;
202203
text += `| image:${icon}[${humanizeLibrary(library)} reference in ${humanizeFormat(format)} format,width=16,height=16,link=${demoUrlWithSuffix},window=_blank]`
203204
} else {
204205
text += `| ${demoUrlWithSuffix}[🔗,window=_blank]`

0 commit comments

Comments
 (0)