You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Create a User Macro : No Macro Body
This is to be used in conjunction with the TOC Macro and will append to the TOC Macro
{code}
## @noparams
<ac:structured-macro ac:name="html">
<ac:plain-text-body><![CDATA[
<style>
ul#WORDTOC .h1 {
font-weight: bold;
margin-top:6px
}
ul#WORDTOC .h2:before,
ul#WORDTOC .h3:before,
ul#WORDTOC .h4:before ,
ul#WORDTOC .h5:before ,
ul#WORDTOC .h6:before{
content:'\2022';
padding-right:6px;
}
ul#WORDTOC .h2{
margin-left:12px
}
ul#WORDTOC .h3{
margin-left:24px
}
ul#WORDTOC .h4{
margin-left:36px
}
ul#WORDTOC .h5{
margin-left:48px
}
ul#WORDTOC .h6{
margin-left:60px
}
</style>
<script>
AJS.toInit(function () {
var saidHello = false;
AJS.$('.converter-macro-ajax-container').ajaxStop(function(){
runOnce();
});
function runOnce(){
if (!saidHello) htmlTableOfContents();
}
function htmlTableOfContents (documentRef) {
AJS.$('.toc-macro').append("<ul id='WORDTOC'></ul>");
var documentRef = documentRef || document;
var toc = documentRef.getElementById('WORDTOC');
var headings = [].slice.call(documentRef.body.querySelectorAll('.office-container h1, .office-container h2, .office-container h3, .office-container h4, .office-container h5, .office-container h6'));
headings.forEach(function (heading, index) {
var anchor = documentRef.createElement('a');
anchor.setAttribute('name', 'toc' + index);
anchor.setAttribute('id', 'toc' + index);
var link = documentRef.createElement('a');
link.setAttribute('href', '#toc' + index);
link.textContent = heading.textContent;
var div = documentRef.createElement('div');
div.setAttribute('class', heading.tagName.toLowerCase());
div.appendChild(link);
toc.appendChild(div);
heading.parentNode.insertBefore(anchor, heading);
});
saidHello = true;
}
});
</script>
]]></ac:plain-text-body>
</ac:structured-macro>
{code}