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
2 changes: 1 addition & 1 deletion extensions/antora/roles-labels/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
6 changes: 4 additions & 2 deletions extensions/antora/roles-labels/roles-labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,15 +344,17 @@ 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')
} else {
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())
Expand Down
35 changes: 34 additions & 1 deletion modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,37 @@ This paragraph is marked as draft.
[role=label--draft]
== Heading with label

This heading is marked as draft.
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.
====