Skip to content

Commit

Permalink
docs(demos): enable HTML demos
Browse files Browse the repository at this point in the history
  • Loading branch information
alandefreitas committed Nov 27, 2024
1 parent 2307ca6 commit d38d3e1
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions docs/extensions/mrdocs-demos.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,9 @@ module.exports = function (registry) {
}
}

// Remove HTML and Rendered Asciidoc from the list of formats
// - The HTML generator is unmaintained
// Remove Rendered Asciidoc from the list of formats
// - The raw Asciidoc is already rendered by the mrdocs.com server as HTML
versionFormats = versionFormats.filter(format => format !== 'html' && format !== 'adoc-asciidoc');
versionFormats = versionFormats.filter(format => format !== 'adoc-asciidoc');
let multipageFormats = versionFormats.filter(format => format !== 'xml');

let versionFormatColumns = versionFormats.map(format => `*${humanizeFormat(format)}*`).join(' | ');
Expand Down Expand Up @@ -183,12 +182,23 @@ module.exports = function (registry) {
return '/reference.adoc'
}
}
if (format === 'html')
{
if (pageType === 'multi')
{
return '/index.html'
}
else {
return '/reference.html'
}
}
return '';
})()
if (['adoc', 'xml'].includes(format)) {
if (['adoc', 'xml', 'html'].includes(format)) {
const adoc_icon = 'https://avatars.githubusercontent.com/u/3137042?s=200&v=4'
const html_icon = 'https://raw.githubusercontent.com/FortAwesome/Font-Awesome/refs/heads/6.x/svgs/brands/html5.svg'
const code_file_icon = 'https://raw.githubusercontent.com/FortAwesome/Font-Awesome/6.x/svgs/solid/file-code.svg'
const icon = format === 'adoc' ? adoc_icon : code_file_icon
const icon = format === 'adoc' ? adoc_icon : format === 'html' ? html_icon : code_file_icon
text += `| image:${icon}[${humanizeLibrary(library)} reference in ${humanizeFormat(format)} format,width=16,height=16,link=${demoUrlWithSuffix},window=_blank]`
} else {
text += `| ${demoUrlWithSuffix}[🔗,window=_blank]`
Expand Down

0 comments on commit d38d3e1

Please sign in to comment.