Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate section level for special sections in the API #1261

Closed
mojavelinux opened this issue Jan 10, 2015 · 1 comment
Closed

Calculate section level for special sections in the API #1261

mojavelinux opened this issue Jan 10, 2015 · 1 comment
Assignees
Milestone

Comments

@mojavelinux
Copy link
Member

Calculate the section level for special sections in the API so that it doesn't leak into client code. Currently, the following code is showing up in the converters to handle what the parser should have dealt with:

def section_level(sec = self)
  @_section_level ||= (sec.level == 0 && sec.special) ? 1 : sec.level
end

You can see it as well in the built-in converters.

@mojavelinux mojavelinux self-assigned this Jan 10, 2015
@mojavelinux mojavelinux added this to the v1.5.3 milestone Jan 10, 2015
@mojavelinux mojavelinux modified the milestones: v1.5.4, v1.5.3 Jul 19, 2015
@mojavelinux mojavelinux modified the milestones: v1.5.4, v1.6.0 Dec 21, 2015
@mojavelinux mojavelinux modified the milestones: v1.5.7, v1.6.0, v1.5.6 Jun 2, 2017
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Jun 3, 2017
…arser

- coerce level to 1 for special sections defined at level 0
- skip unnecessary level logic in parser and converter as a result
@mojavelinux
Copy link
Member Author

To be more specific, special sections can be defined at level-0 in multi-part books. However, they are treated as level-1 sections. This shift should occur in the parser.

(Special sections are defined this way so that they can be siblings of parts instead of nested inside of them).

mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Jun 4, 2017
…arser

- coerce level to 1 for special sections defined at level 0
- skip unnecessary level logic in parser and converter as a result
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Jun 4, 2017
…arser

- coerce level to 1 for special sections defined at level 0
- skip unnecessary level logic in parser and converter as a result
mojavelinux added a commit to mojavelinux/asciidoctor that referenced this issue Jun 4, 2017
…arser

- coerce level to 1 for special sections defined at level 0
- skip unnecessary level logic in parser and converter as a result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant