Bug 1017511

Summary: In articles 'Section:' is ignored unless nested in another section
Product: [Community] PressGang CCMS Reporter: mmurray
Component: Web-UIAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact: mmurray
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.1CC: lnewson
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 1.0.6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-10 06:14:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description mmurray 2013-10-10 04:57:46 UTC
Description of problem:
For articles 'Section:' is ignored unless nested in another section. So overall section numbering isn't as expected.

Example:
Would expect this content spec snippet [cs 12561, type=article]

Goal [12563]
Section: Documentation Plan
  Priority One Documentation Items [12852]
  Priority Two Documentation Items [12851]
Alpha and Beta Documentation [13164]
Section: Content Specification
  Content Specifications [12717]
  Section: JBoss BRMS 6
    BRMS Getting Started Guide [12574]
    BRMS Installation Guide [12571]

To come out something like
1. Goal
2. Documentation Plan
  2.1 Priority One
  2.2 Priority Two
3. Alpha and Beta Documentation
4. Content Specification
  4.1 Content Specifications
  4.2 JBoss BRMS 6
    4.2.1 BRMS Getting Started Guide
    4.2.2 BRMS Installation Guide 

But get
1. Goal
2. Priority One
3. Priority Two
4. Alpha and Beta Documentation
5. Content Specifications
6. JBoss BRMS 6
  6.1 BRMS Getting Started Guide
  6.2 BRMS Installation Guide

Version-Release number of selected component (if applicable):
Build 201309081012

How reproducible:
Also see cs 22485

Comment 1 Lee Newson 2013-10-10 05:09:04 UTC
Looking into this now. At a first glance it looks like it's not creating the root level section elements. ie

The XML is:

<section>
  <title>Goal</title>
  ...
</section>
<section>
  <title>Priority One</title>
  ...
</section>
...

When it should be:

<section>
  <title>Goal</title>
  ...
</section>
<section>
  <title>Documentation Plan</title>
  <section>
    <title>Priority One</title>
    ...
  </section>
</section>
...

Comment 2 Lee Newson 2013-10-10 05:42:28 UTC
Fixed in csprocessor 1.0.6

The problem was caused by the way the content was being added to the DOM Document, where the child elements were being added to the root element and as such it was producing incorrect XML.

Comment 4 mmurray 2013-10-10 06:08:51 UTC
Looks to be fixed in csprocessor 1.0.6:
* sections (eg, 1.) exist within document
* section topics (eg, 1.2) are correctly numbered
* sub-section topics (eg, 1.2.3) are correctly numbered

But noticed that sub-subsections are not included in table of contents. Perhaps not listing sub-subsections in table of contents is just how articles work? 

Example output:

So content spec
Alpha and Beta Documentation [13164]
Section: Content Specification
  Content Specifications [12717]
  Section: JBoss BRMS 6
    BRMS Getting Started Guide [12574]
    BRMS Installation Guide [12571]
    BRMS Administration and Configuration Guide [12575]
  Section: JBoss BPMS 6
    BPMS Getting Started Guide [12572]

results in
1. Alpha and Beta Documentation
2. Content Specification
  2.1 Content Specifications
  2.2 JBoss BRMS 6
  2.3 JBoss BPMS 6

Setting back to assigned for table of content behavior verification

Comment 5 Lee Newson 2013-10-10 06:14:55 UTC
Moving to CLOSED CURRENTRELEASE since that is a publican feature.

If you want more than a toc depth of 2 you need to add "toc_section_depth: <NUM>" to the publican.cfg, where <NUM> is the depth you want (2 is the default which is why subsections aren't displayed).