Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

TOC macro use to show Headings in embedded word docs

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}

1 comment

Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 15, 2021

@Matthew Beda very interesting.  I think this would work very well as an article where you go through the theory of how it works to help the user community out there.  Some examples of ones I wrote:

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events