Bug 885564

Summary: RFE: Inline reference to Chapter/Section name
Product: [Community] PressGang CCMS Reporter: Misha H. Ali <mhusnain>
Component: CCMS-CoreAssignee: Lee Newson <lnewson>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.xCC: adellape, lnewson, mcaspers, sgilda, thildred, viyengar
Target Milestone: ---   
Target Release: 1.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-23 23:43:54 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1056850, 1064054    

Description Misha H. Ali 2012-12-10 05:15:15 UTC
Description of problem:

Inject currently does this for individual topics. However, given that we may want to refer to a chapter or section in the introductory matter of books rather than a single example. Refer to does this but not in an inline way.

For example, in an overview, we may want to have a list of components and link inline after the explanation to a chapter that details each one.

Comment 1 Tim Hildred 2012-12-14 06:27:17 UTC
Just thought I'd jump onboard here. I can't speak for Misha, but I can give an example of a use case. 

Here is a topic that is a special type of overview topic.

<section>
<title>Overview of Openstack Administration</title>
<xref>Installation</xref> - procedures for installing Openstack.
<xref>Configuration</xref> - procedures and explanations of the initial Open Stack configuration tasks
<xref>User administration</xref> - procedures and explanations of integration with directory services. 
</section>


To start with, it presumes that all of the linked topics(or chapters, or parts) are in the built document. Ideally, there would be some logic built into the ccms that, upon encountering this topic during a build, checks to see if the linked topics are in the map.

If they are not, the pre-build will ask if they should be included in the build, dropped from the special overview topic, or if the special overview topic should be dropped from the build.

Comment 2 Misha H. Ali 2012-12-14 06:33:27 UTC
Sounds about right. The primary use case I had in mind myself was something similar:

http://documentation-devel.engineering.redhat.com/docs/en-US/JBoss_Data_Grid/6.1/html/Administration_and_Configuration_Guide/JBoss_Data_Grid_Cache_Architecture.html

In the XML, I am manually setting up xref linkends pointing to the chapters I want. This seems like a good workaround for now but dangerous if chapter names change.

Comment 3 Lee Newson 2012-12-14 06:48:18 UTC
For Tim's comment the CSP already does this some what. If the links don't exist in a content spec than the topic is replaced with a template that mentions that the links don't exist. If the link is an Injection than it goes further and adds details that the topic needs to be injected into the book.

In saying that though I can't see us ever removing links as they may have contextual importance that we can't decide. As for asking I can't see that either as the build primarily has to be able to be run without user input, so that it can be run on servers and be run identically by anyone without having to know the command options used (ID and Server excluded). So this should be left up to the writers. If you need to use the topic across different books than conditional statements should be used. ie <xref linkend="" condition="cond" />

So in the end this RFE should be about having a way to inject a link to a chapter or section in the same way you inject a topic. That way the CSP can determine the ID of the section/chapter/part to be included in the xref.

Comment 4 Lee Newson 2013-06-05 03:56:25 UTC
Misty mentioned today that the following syntax could be used (or something similar):

Map:

Chapter: Name [T-MyRef]

Topic:

<section>
    <title></title>
    <para> A link to a chapter <!-- Inject: T-MyRef --> or possibly <xref linkend="T-MyRef" /></para>
</section>

To follow the way injections are currently done I think the first would possibly be better.

Comment 5 Misha H. Ali 2013-07-08 06:31:47 UTC
I think we should be able to do this now that chapters and sections (and parts too) are treated as topics themselves, so suggest closing this off.

Comment 6 Misty Stanley-Jones 2013-07-30 05:58:05 UTC
*** Bug 989860 has been marked as a duplicate of this bug. ***

Comment 7 Lee Newson 2013-07-30 06:06:29 UTC
I'm going to keep this bug open because while that does cover cases where you use some Front Matter content eg.

Chapter: Introduction [3737]

it only works for those instances. As such we should still provide a way to do this without having to use a Front Matter topic just to do the link.

From the little I've looked into this I believe misty's idea would be the best approach (see comment #4).

So for now the only way to do this is to use a Front Matter Topic with the chapter/appendix/whatever, or to manually set them as Misha said in comment #2.

Comment 8 Lee Newson 2014-02-10 05:33:42 UTC
Added in 1.4-SNAPSHOT build 201402101456

You can now use targets in injections to reference levels (chapters, parts, appendixes, etc...) or topics. The syntax is <!-- Inject: TARGET_ID --> where TARGET_ID is the target in a content spec. When a target doesn't exist the topic is replaced with the error template and an error is added to the error chapter in the build output.

Note: At this stage the UI injected link, links to nothing as we have no way to search for content specs based on the target id.

Comment 10 Matthew Casperson 2014-02-11 23:49:35 UTC
Tested valid links to link targets ok. Tested invalid links to targets ok. Tested links in UI ok.

Comment 11 Jared MORGAN 2014-02-25 00:32:27 UTC
Misty documented this feature in Topic 17887. I have removed the admonition to make the feature no longer "aspirational".