Allow CSS content: to be set in oxy|processing-instruction
Are you missing a feature? Request its implementation here.
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Allow CSS content: to be set in oxy|processing-instruction
Post by chrispitude »
We have an external tool that populates the target text of cross-book (scoped) <xref> elements. To tell the difference between user-written tool-generated link text, the tool inserts a <?snps gentext?> XML processing instruction to indicate generated text content:
However, CSS styling for PIs in the Oxygen editor are limited. I can set the background color and change the font width:
but this still results in somewhat writer-hostile display, and the displayed PI text can also accidentally be typed in and corrupted:
The primary enhancement request is
Code: Select all
<p>Also see <xref keyref="cc_seuser.using_templates" scope="peer">Using
Templates<?snps gentext?></xref>.</p>
Code: Select all
oxy|processing-instruction[snps] {
background-color: lightgreen;
font-family: "Arial Narrow";
}
oxygen_editor_pi.gif
The primary enhancement request is
- Support the CSS content: property so I can replace the PI text with a small icon to indicate generated text.
- Allow the PI content to be locked via a CSS property so it cannot be modified.
- Provide CSS selection for the text ("gentext") following the PI name ("?snps").
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Allow CSS content: to be set in oxy|processing-instruction
Hi Chris,
How about something like this?
I made the PI content not editable but I also used "visibility:-oxy-collapse-text;" to hide its entire text. The tags are hidden for the element. I added a :before with an image, the image path is relative to the CSS:
https://www.oxygenxml.com/doc/versions/ ... ction.html
About this request:
Regards,
Radu
How about something like this?
Code: Select all
@namespace oxy "http://www.oxygenxml.com/extensions/author";
oxy|processing-instruction[snps] {
background-color: lightgreen;
font-family: "Arial Narrow";
-oxy-display-tags:none;
-oxy-editable:false;
visibility:-oxy-collapse-text;
}
oxy|processing-instruction[snps]:before {
content: oxy_url('logo.png');
}
https://www.oxygenxml.com/doc/versions/ ... ction.html
About this request:
I do not quite understand what you mean by that. What is CSS selection?Provide CSS selection for the text ("gentext") following the PI name ("?snps").
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Allow CSS content: to be set in oxy|processing-instruction
Post by chrispitude »
Wow Radu, this is like magic - thank you!
I created a base 18x13px SVG icon with Inkscape:
then rendered it to a PNG:
and it looks great in the editor!
We use the following CSS rule to draw a dotted line around scoped keyrefs, and the icon fits nicely inside:
The "selection" statement was a poorly worded reference to CSS selectors. For example, I was thinking it would be useful to differentiate between <?snps gentext?> and <?snps sch?>. But now that you've shown me how to hide the text, I think just using separate PI names themseves (<?snps-gentext?>, <?snps-waive RULE001?>) will be a better approach.
Thanks as always for all your help! Please disregard the content: enhancement request, as this works perfectly.
I created a base 18x13px SVG icon with Inkscape:
gentext.svg.zip
then rendered it to a PNG:
gentext.png
and it looks great in the editor!
image.png
We use the following CSS rule to draw a dotted line around scoped keyrefs, and the icon fits nicely inside:
Code: Select all
*[keyref][keyref][keyref][keyref*="."] { /* highlight scoped keys */
border-style: dotted;
border-color: green;
border-width: thin;
}
Thanks as always for all your help! Please disregard the content: enhancement request, as this works perfectly.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Allow CSS content: to be set in oxy|processing-instruction
Post by chrispitude »
I attached the wrong SVG file, it's this one:
gentext.svg.zip
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Allow CSS content: to be set in oxy|processing-instruction
Hi Chris,
It's good that you converted the SVG to PNG and used the PNG in the CSS, PNG rendering is faster.
I also consider that processing instructions should better be differentiated by their target and not by their data. And yes right now the CSS can match PIs only by the target, not by their data part which is usually variable.
Regards,
Radu
It's good that you converted the SVG to PNG and used the PNG in the CSS, PNG rendering is faster.
I also consider that processing instructions should better be differentiated by their target and not by their data. And yes right now the CSS can match PIs only by the target, not by their data part which is usually variable.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service