The first document you showed in this other question contains headings, subheadings, clauses and nothing else, the full document was duplicated in the TOC.
So your first task is to ask yourself what are headings (whatever name you give it to them as clause title may just be another level of heading) and what is “text”. “Text” won’t go into the TOC.
You can assign outline level even to “text”. When you create the TOC, you configure it to collect heading only up to some level.
Headings are just a particular list. Everything you can do with lists can be done with headings. However to avoid conflicts or confusion, the corresponding list style is hidden and not displayed in the style side pane. You customise the heading list style with Tools
>Heading Numbering
.
It works also with headings, with a bonus: the paragraph style is automatically changed to match the level (this is a benefit of the special properties of Tools
>Heading Numbering
). So, promoting or demoting a heading is as easy as doing the same in list.
Why? If you really want to assign outline levels to your clauses, then just use Heading n. Everything is already configured from the factory. You only need to limit TOC generation to the appropriate level.
Don’t fall into macro strategy until you have fully understood all Writer features. I’d say that ~50% of request for macros on AskLO come from the lack of knowledge about existing features and the styling mechanism.
If all you want is different paragraph styles at different levels, go for headings. I sort of remember there is an experimental feature to grant list styles the same extra features as heading numbering. It should be available to general public as standard feature in a coming release.
Learn how the existing features work. The most important approach is to structure your mind and translate this structure into a document: the outline is the backbone upon which you “flesh” the document. Styles tell the importance or significance of the objects (paragraphs, words, pages, …). Enter only significant objects. Empty paragraphs contain no information. Consequently a well-behaved document should have absolutely no empty paragraph.
Empty paragraphs are frequently used for vertical space. This is wrong. You become tightly tied to many implicit assumptions which easily break and ruin your manual layout (e.g. when you flush some paragraph to next page with empty paragraphs; make an edit before them and you’re out of sync). Remember that empty objects have nevertheless a style. Customise the style to fit the need for a visible object and empty ones are also impacted and your manual layout is again ruined.
Spacing is yet another property of objects and thus can be recorded in styles, removing the supposed need for empty paragraphs.
To answer your initial question “Should I include list items in a TOC, or only headings?”, a TOC only contains heading to provide a condensed summary of the document. List items are usually part of the discourse or main topic. Consequently, they don’t go into the TOC.
One exception, though: since Tools
>Heading Numbering
as a standard list allows for only one numbering type per level (say level 1 is numeric; that nice to number chapters but you can’t have simultaneously alphabetical annexes), you must create a second list for a different numbering. Then this list is a second set of heading and, yes, you collect it into the TOC by assigning outline level to its paragraph styles.