Understanding the CSS used buy the map with resolved topics

Post here questions and problems related to editing and publishing DITA content.
pierat
Posts: 9
Joined: Tue Mar 26, 2013 12:00 am
Location: Paris, France
Contact:

Understanding the CSS used buy the map with resolved topics

Post by pierat »

Hi,

In fact the way this "map resolved topics" author view works is a little bit cryptic for me.

In my application, I have a standard map with standard topicrefs going to specialized topics.

Everything for my specialized topics is in a dedicated oXygen framework but the map is a standard DITA one, using the DITA oXygen framework.

Now I want to parameterize the standard "resolved view", for my dedicated topics and print. If I use this feature, it is for being able to get oXygen customizations for author revisions and comments.

So, I have different questions, all related to the same use case :
- for now the only solution I found for css customization was to modify the Oxygen XML Editor 18\frameworks\dita\css\edit\alternate-full-width-layout.css. How can I only have my own customizations and where do I put them ? In my own framework with a dedicated specialized map ? Elsewhere ?
- what is the structure of this css ? I assume it needs to import my topic css plus the dita oxygen stuff for managing references and conref ? Have anyone got a sample ?
- how to modify the css for comments (too large, too big font that goes over the text) and revision stuff ?
- how to remove topic nested indentation ? I put every borrders to 0 (topicref, topic, body) but it continue to indent?
- last, working with alternate-full-width-layout.css, as soon as I print, the font size is not respected. Seems that the font grows up to fullfill margin. So Iis it the same css that is used when viewing the resolved map in the editor and when printing this view ? How to work on css-print margins and font size ?

Ok, this is a long set of question but I really spent yet a lot of time tryoing to understand so I will be happy to get directions and ideas.

Regards, Pierre
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Understanding the CSS used buy the map with resolved topics

Post by Radu »

Hello Pierre,

Please find some answers below:
In fact the way this "map resolved topics" author view works is a little bit cryptic for me.
Usually when rendering a topic in the Author visual editing mode Oxygen presents conrefs expanded in place. But by default when a DITA Map is rendered in the Author editing mode topicrefs are not expanded. When using this special "map resolved topics" mode Oxygen expands topicrefs as if they would be conrefs.
In my application, I have a standard map with standard topicrefs going to specialized topics.
Everything for my specialized topics is in a dedicated oXygen framework but the map is a standard DITA one, using the DITA oXygen framework.
Ok.
Now I want to parameterize the standard "resolved view", for my dedicated topics and print. If I use this feature, it is for being able to get oXygen customizations for author revisions and comments.
I do not understand your use case.
Could you give me more details? So basically you want to see all comments made by users in the entire DITA Map context, right? And you also want to print this to PDF so that reviewers look at the existing reviews and comments? Usually we recommend that the entire flow or editing and reviewing XML should be XML based. We have a WebAuthor tool which can be used for online reviewing of topics directly in DITA.
So, I have different questions, all related to the same use case :
- for now the only solution I found for css customization was to modify the Oxygen XML Editor 18\frameworks\dita\css\edit\alternate-full-width-layout.css. How can I only have my own customizations and where do I put them ? In my own framework with a dedicated specialized map ? Elsewhere ?
If in the Preferences->Document Type Association page you edit (or extend) the DITA Map document type association, in the Author tab there is a CSS tab. Some of the CSSs there are added with "Alternate:yes" meaning that they apply as layers over one of the base CSSs.
The "alternate-full-width-layout.css" is an alternate CSS, it does not import another CSS but it is combined with one of the base non-alternate CSSs.
All non-alternate CSSs (for example "frameworks\dita\css\edit\style-basic.css" which is applied by default) refer to the "dita.css". This CSS in turn will import other CSSs which will include styling both for DITA topics and DITA Maps.
- what is the structure of this css ? I assume it needs to import my topic css plus the dita oxygen stuff for managing references and conref ? Have anyone got a sample ?
When you want to see how a certain XML element is styled, you can right click in the Author visual editing mode and choose Inspect styles.
You can add your own CSS styles in a couple of ways:

1) Extend the "DITA Map" document type association and in the Author->CSS tab add a reference to an extra CSS without specifying a title for it and without setting its "Alternate" flag. This should instruct Oxygen to combine your custom CSS with the currently applied one.

2) Via an XML catalog you can resolve a special URI http://www.oxygenxml.com/extensions/aut ... Custom.css to your custom CSS's location. Your custom CSS will be contributed to all other CSSs used to render any XML in the Author editing mode:

https://www.oxygenxml.com/doc/versions/ ... ports.html
- how to modify the css for comments (too large, too big font that goes over the text) and revision stuff ?
Could you maybe attach or refer to an image? Do you mean those side callouts? Those cannot be customized via CSS.
- how to remove topic nested indentation ? I put every borrders to 0 (topicref, topic, body) but it continue to indent?
If you use the "Open map with resolved topics" action and then in the "Styles" drop down you choose the "Print ready" alternate CSS, it should left align all topicrefs. The print-ready CSS frameworks\dita\css\edit\alternate-map-print-preview-layout.css basically sets 0 padding left on topicrefs. As I said before, using the CSS Inspector view is a good way to know what exact selector to overwrite. You can also use the !important CSS flag to increase the priority of your selector.

The problem is that if your custom CSS is provided as a non-alternate CSS, it will also be used when a DITA Map is opened in the Author visual editing mode without topicrefs expanded.
- last, working with alternate-full-width-layout.css, as soon as I print, the font size is not respected. Seems that the font grows up to fullfill margin. So is it the same css that is used when viewing the resolved map in the editor and when printing this view ? How to work on css-print margins and font size ?
The same set of CSSs that is applied when editing the XML should also be applied when printing it. With the addition that in the CSS you can add special media print selectors like:

Code: Select all

@media print {
p {padding-left:0px;}
}
which will only be used by Oxygen when printing (File->Print).

One more thing about printing to PDF using CSS, you can either use the File->Print action or there is a special DITA Open Toolkit transformation scenario called DITA Map PDF - WYSIWYG - Experimental which can be used to print to PDF using a commercial engine (Prince XML or Antenna House):

https://www.oxygenxml.com/doc/versions/ ... f-css.html

so this might be an alternative to explore.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply