Skip to content

Section nesting #7

@GB609

Description

@GB609

It should be possible to nest sections.

For this, the level of the section header and function_nesting should instead be calculated:

  1. section_nesting starting at 0
  2. when @section is encountered do
    • section_nesting += 1
    • function_nesting = section_nesting + 1
  3. on @endsection
    • section_nesting -= 1
    • function_nesting = section_nesting + 1
  4. render_docblock when called from within process_section should pass section_nesting

This is a behaviour change.
Currently, anytime @section is encountered, the nesting levels are hard-set to section: 2, functions: 3.
This means, that @endsection isn't required to remain on the same nesting level, any new section will start fresh.

When this change is implemented, @endsection is basically required to achieve the same because shdoc alone can not determine if further nesting of @section is desired or not.

Not using @endsection would continue to increase nesting levels when encountering @section until a depth is achieved for which shdoc does not have code templates anymore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions