How do I create a numbered list in Confluence using a custom macro?
Asked by Anastasia:

??? ??????? ???????????? ?????? ? ??????? ? ??????? ????????????????? ????????

Example:

1.Example

1.1 Example

1.1.1 Example


Answers:
author: Rafael Pinto Sperafico
body: Hi [@Anastasia](/t5/user/viewprofilepage/user-id/2783352) ,

You could accomplish that with CSS2:

```
## Macro title: My Nested List
## Macro Body Processing: No macro body
##
## Developed by: Rafael Pinto Sperafico
## Date created: 19/03/2019
## Installed by: Rafael Pinto Sperafico

## Macro displays numeric nested list
## @noparams
<style>
#my-nested-list ol { counter-reset: item }
#my-nested-list li { display: block }
#my-nested-list li:before { content: counters(item, '.') ' '; counter-increment: item }
</style>
<div id="my-nested-list">
  <ol>
  <li>Item</li>
  <li>Item
    <ol>
      <li>Sub-item</li>
      <li>Sub-item
        <ol>
          <li>Sub-item</li>
        </ol>
      </li>
    </ol>
  </li> 
  </ol>
</div>
```

Kind regards,  
Rafael

comments: author: Anastasia
body: ???????!!!! ????? ?? ?????? ??? ??????? ????????? ??????????, ????????????? ? ?????? ????????. ? ??? ?????? ?? ????????????? ????????? ????????????? ??? ??????.????????:![??????.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/49146i3D46FAF4E761F71B/image-size/large?v=v2&px=999 "??????.PNG")


author: Rafael Pinto Sperafico
body: Hi [@Anastasia](/t5/user/viewprofilepage/user-id/2783352) ,

If you visit the Space where those pages are being created, having a admin permission to that Space you could change the Look and Feel (*Space Tools \>\> Look and Feel*)

In there, please select *Stylesheet* tab and add/append the following CSS2:

```
#content.page.view {
???? /* Set "section" to 0 */
??? counter-reset: section;
}

#content.page.view h1 {
???? /* Set "subsection" to 0 */
??? counter-reset: subsection;
}

#content.page.view h1:before {
??? /* Increment "section" by 1 */
??? counter-increment: section;
??? content: counter(section) " ";
}

/* Continue this scheme as deep as you need */

#content.page.view h2 {
??? counter-reset: subsubsection;
}

#content.page.view h2:before {
??? /* Increment "subsection" by 1 */
??? counter-increment: subsection;
??? content: counter(section) "." counter(subsection) " ";
} 

#content.page.view h3:before {
??? counter-increment: subsubsection;
??? content: counter(section) "." counter(subsection) "." counter(subsubsection) " ";
}
```

Save it and visit your page once again. Headers should now be automatically numerical.

**Notes**

* during editing mode, numbers are not displayed
* when selecting Export as PDF or Word, numbers are not displayed

In case you want to have those numerical headings available when editing and/or exporting, perhaps you should give it a try using plugins available on <https://marketplace.atlassian.com/>

Kind regards,  
Rafael


author: Anastasia
body: ???????!!! ? ????? ?????? ???????? ?????? ????? ? ???????? ??? ?????? ?? ???????????? ? ?? ????????? ??? ??????? ? ???? ??????, ?? ?????? ?????? ?? marketplace.


author: Rafael Pinto Sperafico
body: Hi [@Anastasia](/t5/user/viewprofilepage/user-id/2783352) ,

Here are some

* [https://marketplace.atlassian.com/apps/16063/numbered-headings?hosting=server\&tab=overview](https://marketplace.atlassian.com/apps/16063/numbered-headings?hosting=server&tab=overview)
* [https://marketplace.atlassian.com/apps/1212505/engineering-essentials?hosting=server\&tab=overview](https://marketplace.atlassian.com/apps/1212505/engineering-essentials?hosting=server&tab=overview)

Please, make sure of trying them out first before buying ;)

Kind regards,  
Rafael


author: Anastasia
body: ???????, ?? ????? ???????!!!