diff --git a/extensions/antora/roles-labels/package.json b/extensions/antora/roles-labels/package.json index d6cdf21..fa4986e 100644 --- a/extensions/antora/roles-labels/package.json +++ b/extensions/antora/roles-labels/package.json @@ -1,6 +1,6 @@ { "name": "@neo4j-antora/roles-labels", - "version": "0.1.4", + "version": "0.1.5", "description": "Convert roles on a block to a labels div, add dataset info to a block based on roles and inline labels", "main": "roles-labels.js", "scripts": { diff --git a/extensions/antora/roles-labels/roles-labels.js b/extensions/antora/roles-labels/roles-labels.js index 8eaa655..5f51300 100644 --- a/extensions/antora/roles-labels/roles-labels.js +++ b/extensions/antora/roles-labels/roles-labels.js @@ -344,8 +344,6 @@ module.exports.register = function ({ config }) { labelsLocation = roleDiv.querySelector('td.content') } - - if (roleDiv.tagName === 'H1' || headings.includes(roleDiv.firstElementChild.tagName)) { labelsLocation.append(labelsDiv) labelsLocation.classList.add('header-label-container') @@ -353,6 +351,10 @@ module.exports.register = function ({ config }) { labelsLocation.prepend(labelsDiv) roleDiv.classList.add('has-label') } + + if (roleDiv.classList.contains('exampleblock') && (titleDiv = roleDiv.querySelector('div.title'))) { + roleDiv.prepend(titleDiv) + } }) file.contents = Buffer.from(parsed.toString()) diff --git a/modules/ROOT/pages/index.adoc b/modules/ROOT/pages/index.adoc index 5480e5a..f3d7b18 100644 --- a/modules/ROOT/pages/index.adoc +++ b/modules/ROOT/pages/index.adoc @@ -78,4 +78,37 @@ This paragraph is marked as draft. [role=label--draft] == Heading with label -This heading is marked as draft. \ No newline at end of file +This heading is marked as draft. + + +== Example with no title + +Lorem ipsum. + +[role=label--enterprise-edition] +==== +Lorem ipsum dolor sit amet, consectetur adipiscing elit. +==== + + +== Example with title and label + +Lorem ipsum. + +[role=label--enterprise-edition] +.Example title (with label) +==== +Lorem ipsum dolor sit amet, consectetur adipiscing elit. +==== + + +== Admonition block with title and label + +Lorem ipsum. + +[role=label--enterprise-edition] +.Example title (with label) +[NOTE] +==== +Lorem ipsum dolor sit amet, consectetur adipiscing elit. +====