Support for indentation in headings

Issue #16 wontfix
David Corlette created an issue

With the default plug-in, numbered headings all come out flush with the left margin:

  1. Head1

1.1. Head2

1.1.1. Head3


1.2.1. Head3 Head4 Content

It would be cleaner if the headings could be automatically indented in the same way a numbered list is (I can't get this to render in this editor).

If this could be added as a parameter to the plug-in, that would be great - something like "indent each level by this amount (em)".

Comments (6)

  1. Gert-Jan van de Streek

    Kind of like the example below? Where the heading always starts in the same 'column' and the numbering gets right indented as much as needed. Lower headings being indented more then higher headings:

    1. Lorem
    2. ipsum dolor
    3. sit amet
    4. consectetur
    5. adipisicing elit
    6. sed do eiusmod
    7. tempor incididunt
    8. ut labore et
    9. dolore
    10. magna aliqua
    11. Ut enim ad
    12. mi
  2. Gert-Jan van de Streek

    As a work around currently, you can achieve this by adding css to your space stylesheet. If you have admin rights, go to Browse > Space Admin > Stylesheet > Edit

    Add this css snippet:

    span.nh-number {
    width: 60px;
    display: block;
    float: left;

    This particular snippet works (for me) when going up to heading 4. Increase the width to cater for your specific situation / theme / heading use.

    That's all I can do for now.

  3. David Corlette reporter

    That's actually not what I was referring to.

    I came up with this stylesheet:

    .wiki-content h3 span.nh-number {
    margin-left: 2em;

    .wiki-content h4 span.nh-number {
    margin-left: 4em;

    .wiki-content h5 span.nh-number {
    margin-left: 6em;

    .wiki-content h6 span.nh-number {
    margin-left: 8em;

    A little clunky, and if the body of the heading goes over one line the margin doesn't apply (IMHO the "paragraph" should be indented) but it mostly works.

  4. Tomas Theunissen

    The CSS rules you stated would be the exact same as we would add, when implementing this feature. Though I don't feel that this should be in Numbered Headings (we try to minimize the options to keep NH simple). And as you have shown there is a good alternative.

    We appreciate that you created an issue for this and would welcome any other if you have. But for now I am closing this as "won't fix". If you think about any other reasons why your CSS rules won't work or have any other comment on my decision, feel free to re-open this issue!

  5. David Corlette reporter

    Well, my only thought would be that if you could provide a parameter for this in the plugin configuration, and then use that to generate CSS for the individual macro, then it could be customized for a particular document section. Otherwise one has to do this for the entire space, which is non-ideal. But I will concede that this is lowish priority.

  6. Log in to comment