LightGuard / asciidoc-splitter

A splitter utility for helping create modular docs from chapter files.
BSD 2-Clause "Simplified" License
8 stars 8 forks source link

Splitter fails without at least 2 line breaks before the first module section in an assembly #89

Closed sterobin closed 2 years ago

sterobin commented 3 years ago

@LightGuard I had a docs PR wherein the splitter was failing for strange reasons pointing to the first module in the assembly. I tested locally by strategically commenting in and out various parts of the chapter and running the splitter locally, and discovered that only by adding this additional line break shown here https://github.com/redhat-developer/app-services-guides/pull/144/files#diff-658974d4b95a96305473a76ce955d1e9398650c2d487014a9d0746c00dd964dcR48 that the splitter then ran successfully. It's an added line break between the single intro paragraph to the chapter and the first module of the chapter. This hasn't ever come up before because all other chapters in our repo coincidentally have at least two intro paragraphs or chapter-level prereqs or some sort of content that naturally adds more than one line break before the first module. So this is the first time we have a single intro paragraph and then the first module that follows, which apparently causes an issue unless more content is added.

Any thoughts? Thanks so much.

@pmuir Just FYI ^^

LightGuard commented 3 years ago

@sterobin which file and where? There are a number of files in that diff.

sterobin commented 3 years ago

@LightGuard Sorry, the link above I provided is directly to the line I added, but GitHub keeps collapsing the file it's in so you have to load the last diff. Anyway, it's the file topic-configuration/README.adoc, line 48, at the bottom of the PR.

LightGuard commented 3 years ago

No idea, honestly. I could spend time, but if you have a solution, it may not be worth it to find the actual issue.

LightGuard commented 2 years ago

This appears to be related to #94. Anyone care to verify?

emmurphy1 commented 2 years ago

I found that the splitter failed unless I added an extra line after conditional statements. I could live with this, but Geoffrey DeSmet has requested that I ask you to look into it. This problem seems to be related to this issue. Let me know if I should create a separate issue.

ge0ffrey commented 2 years ago

Specifically doing something like this supposedly fails:

ifdef::OPTAPLANNER-ENT[]
* A text
endif::OPTAPLANNER-ENT[]
ifdef::OPTAPLANNER-COMM[]
* Other text
endif::OPTAPLANNER-COMM[]

and with these empty lines in there it supposedly works:

ifdef::OPTAPLANNER-ENT[]
* A text
endif::OPTAPLANNER-ENT[]

ifdef::OPTAPLANNER-COMM[]
* Other text
endif::OPTAPLANNER-COMM[]
emmurphy1 commented 2 years ago

And also: ifdef::OPTAPLANNER-COMM[]

Some text....

LightGuard commented 2 years ago

I'll have to think about how to change things. Preconditionals have been the bane of this whole project.

LightGuard commented 2 years ago

If you have a document you'd like to put forward as a test case, please do.

LightGuard commented 2 years ago

I found that the splitter failed unless I added an extra line after conditional statements. I could live with this, but Geoffrey DeSmet has requested that I ask you to look into it. This problem seems to be related to this issue. Let me know if I should create a separate issue.

Emily, could you expound on "failed," please? What are you experiencing?