Customizing the Author and/or Print Views

Post here questions and problems related to editing and publishing DITA content.
pjporter88
Posts: 6
Joined: Sat Oct 16, 2021 8:36 pm

Customizing the Author and/or Print Views

Post by pjporter88 »

Hello,
I am trying to modify the .css for the author and print views in the UI, but I need some guidance on a few topics.
First is where do you do that so that your custom css drives the author and print view?
Second, I would like to customize how notes, warnings, and cautions are presented. Need a custom icon, centered on the page, like this, with left and right indented text:
NCW_Image copy.jpg
NCW_Image copy.jpg (151.11 KiB) Viewed 389 times
Third, we use the following type of DITA markup to create challenge and response pairs that are separated by leader dots like this:
1. Prompt..........Action
The DITA for this is:

Code: Select all

<li>
<p outputclass="challenge">Prompt</p>
< outputclass="response">Action</p>
</li>
Would like the leader dots to be responsive so the response is right justified and if it overflows the line, is right justified.
Finally, we have a few rules for how we number our procedural steps due to the constraints of the <ol> structure in DITA.
The basic structure is what you see above and the "challenge" gets the number when published. In DITA, the <li> typically gets the number, but when we run our custom FrameMaker publish process to generate our production output, we have scripts that modify which <p> gets the number so we get the desired layout.
The three other structures are:
(a) One or more <p>, <note>, or <itemgroup> elements prior to the <p outputclass="challenge"> element...we want the <p outputclass="challenge"> element to get the number.
(b) If there is no <p outputclass="challenge"> element in the <li> then the first <p> element that is a direct descendant of the <li> element gets the number.
(c) We use <p props="multipleBranch"> to create a question with choices like shown below. In this case we want the <p> with the props attribute to get the number ant not the <p> element with the outputclass="challenge". The structure is:

Code: Select all

<li>
<p props="multipleBranch">Is the switch on?</p>
<p outputclass="challenge">YES</p>
<p outputclass="response">Go to Step X</p>
<p outputclass="challenge">NO</p>
<p outputclass="response">Go to Step Y</p>
</li>
This would look like:

Code: Select all

1. Is the switch on?
    YES.....................Go to Step X
    NO......................Go to Step Y
    
We also use the <itemgroup> element to create "headers" since these are allowed inside <li> elements. The look like this:
--- Header ---
We might use them anywhere such as in the previous example:

Code: Select all

<li>
<itemgroup>Header</>
<p props="multipleBranch">Is the switch on?</p>
<p outputclass="challenge">YES</p>
<p outputclass="response">Go to Step X</p>
<p outputclass="challenge">NO</p>
<p outputclass="response">Go to Step Y</p>
</li>
This would look like:

Code: Select all

--- Header ---
1. Is the switch on?
    YES.....................Go to Step X
    NO......................Go to Step Y
Thank you for any help you can provide!
Pat
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Customizing the Author and/or Print Views

Post by Radu »

Hi,

I do not have enough time today to go through this entire request, but just to add some observations:

- So you are interested in making the edited content look more like the published output. What do you mean by "Print view"?

- Indeed this can be done with a CSS customization, please see the recommended procedure here:
https://blog.oxygenxml.com/topics/customizeDITACSS.html
Oxygen's visual editing mode is CSS driven but we do not have all the features that for example a web browser would. All our supported CSS selectors and properties can be found here:
https://www.oxygenxml.com/doc/ug-editor ... pport.html
So you may not get to make the edited content look precisely to the printed output but you may get to make it look closer to what the printed output looks like.

We have a CSS inspector view which should help you see what CSS selectors currently match certain elements:
https://www.oxygenxml.com/doc/ug-editor ... heets.html

To add for example a centered "WARNING" before a DITA note I would do maybe something like:

Code: Select all

note[type='warning']:before {
    content:"WARNING";
    display:block;
    text-align:center;
    border:1px solid black;
    font-weight:bold;
}
About this:
Would like the leader dots to be responsive so the response is right justified and if it overflows the line, is right justified.
This is not something which can be accomplished using CSS in the editing mode.

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