Re: Reuse - best practices #reuse


Ron Wheeler
 

You are on the right track.
keyrefs, topicrefs and their cousins make it easy to reposition the physical location of things without disturbing your main map.
If you define these in a separate file which you reference in your main map at the start, such as I have done

    <topicref href="description_variables.ditamap"
        format="ditamap" processing-role="resource-only" />

you will be able to restructure your physical locations and have all DITA projects that use the keys be automatically "fixed".
"resource-only" is the key that keeps your map of keys from being included as content.
The name "description_variables.ditamap" is arbitrary and only gets its name from the fact that the project is all about condo descriptions for our condo association.
(I needed to produce  master descriptions of all condos as well as a description of each condo as a separate document,  in 2 languages.)

Any other project that needs to reuse any of the content, simply has to include this reference and their project will find all of the files in their current locations regardless of any physical restructuring that has occurred.

Very helpful even where sharing is not contemplated. I restructured my files several times as I developed the DITA application and it was easy to reorganize things without having to go through all of the maps to re-specify links.

Ron


On 2020-03-03 1:16 p.m., Matt Lorenzi via Groups.Io wrote:
I think one of the biggest concerns I have is losing track of the original "home" of a topic. It isn't always known ahead of time which topics maybe become common to other models; it might not even be known at the time that other models are coming along. So I am sure in practice you simply do a topicref to the topic needed - wherever it may be. I sense this is where the power of keyrefs come in. I need more coffee to wrap my head around this.

Join main@dita-users.groups.io to automatically receive all group messages.