Has anybody successfully managed to exclude headings from the TOC that have different names? For example if I want to exclude the two following headers from my TOC
what RegEx would I use?
I agree. Atlassian's documentation that refers people to Sun's RegEx docuemntation is woefully inadequate. I think all they would need to do to appease 95% of users who just want to exclude a handful of names from the TOC list is add a few examples:
A few simple examples would explain how to use the exclusion feature for the vast majority of users.
I came across your post just now and thought I'd let you know that I added an example to the doc.
Let me know what you think,
Some general thoughts:
Although regular expressions can be quite complex, a few simple rules are probably enough to know how to use them in the table of contents macro.
What is most important to know, is this:
The combinatin of both is .* and that stands for basically every combination of numbers and letters, e.g. "a", "1", "abc", "123", "abc 123 xyz", but also "" (nothing at all = a letter or number that occurs zero times).
@Atlassian: see the complaints below and fix the documentation which is years out of date. This should be a simple task to do. users shouldn't have to "See Sun's Regex documentation for examples of constructing regular expression strings." Even if they were developers they shouldn't have to, let alone the rest of us!
Worked perfect for me - thanks to @Steffen Heller
-> Maybe you can also help me with a problem belonging to this trouble here
I can't use a specific word, there are several questions on the page which start with different words -> is there an opportunity to exclude h2 after the used (Recent).* excluding?
Complex question, To make it short, I don't think that what you want is possible as those regular expressions only refer to the headline text but not any kind of underlying source code.
Would it be possible to add a consistent prefix to the questions e.g. having all questions start with "Q:"?
PS: I am not an expert on that, just a normal user that was searching for a solution and posted it here (years ago ;-))
Made a workworkaround:
Not very elegant, but worked. So all questions (which have heading 3) will not be shown.
I tried exclude with a certain ending (in my case '?' -> because all questions should end with ?) by using .*? -> did not work
just saw this post. Can I also exclude the title of the document?
Because the title is H1, and other headings are also H1, the document looks like this when exported as pdf:
1. Title of document
Because of the h1 in the title the whole document numbering is wrong. And I tried h2 and h3 then excluded h1 but then h3 numbering is not shown at all.
I am afraid I cannot fully follow your explanation. Specifically, I don't understand in what way the h1 in the title makes the numbering wrong.
Can you explain the following:
What do you mean by "title"?
The first heading in the page (= your "1. Title of document") or the page name?
And how do you export to PDF?
With Tools > Export to PDF or with Browse > Space Admin > PDF Export
And just to be sure:
Are you talking about the TOC macro or do make space exports and use the "normal" TOC that is a part of that?
i tried to reproduce your problem. As you can see on the pic, page title is never a part of TOC.
How did you produce numbering in the page title?
How did you create the numbering in TOC:
Maybe this creates the problem - even if it doesn't explain the numbering and appearing for page title.
Another option could be a Confluence Theme running in background that influences list style and/or pdf export
In my case I had to exclude headings "Date" and "Table of Content". This is what I entered in the "Exclude Headings" field and that worked:
Date|Table of Contents
Hi my Community friends! For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs