How can I change the CSS used to display the content in the XML editor?
I have read that the XML editor uses the CSS associated with the primary target, but I was wondering if there was a way of changing this without setting up a dummy primary target.
(As background: I'm working on a project that has PDF as its primary output. The CSS looks great for the PDF but awful in the XML editor.)
Changing the CSS used in the XML Editor
-
- Propeller Head
- Posts: 24
- Joined: Thu Nov 10, 2016 4:19 am
-
- Sr. Propeller Head
- Posts: 330
- Joined: Tue May 13, 2008 3:27 pm
- Location: Christchurch, New Zealand
Re: Changing the CSS used in the XML Editor
Are you looking at Layout(Print Layout) in the XML editor? This should show how it will look in the PDF and may make it look better. If there is a big discrepancy between how that looks and the final PDF, then I think you have a CSS problem (perhaps using complex selectors or other fancy CSS trickery that the XML editor doesn't recognize?) In that case I'd recommend simplifying your CSS e.g. use p.class, span.class (instead of generic .class), separate them out into single style defns etc. From what I've experienced if the Flare CSS editor recognises your CSS and you can modify styles from within Flare, then the XML editor will pick up the look and display them reasonably accurately. That may be different in your project of course, and it may pay to contact MadCap support if things are not appearing as they should.
-
- Propeller Head
- Posts: 24
- Joined: Thu Nov 10, 2016 4:19 am
Re: Changing the CSS used in the XML Editor
That's not what I want to do. I want to use one CSS for the editor and a completely different one for the output.
One way of doing this is to create a new target, associate my 'editor' CSS with that target, and then set that target as the default target. I was wondering of there was a more elegant way of doing it.
One way of doing this is to create a new target, associate my 'editor' CSS with that target, and then set that target as the default target. I was wondering of there was a more elegant way of doing it.
-
- Sr. Propeller Head
- Posts: 189
- Joined: Mon Feb 22, 2016 9:18 am
- Location: Cincinnati, OH
Re: Changing the CSS used in the XML Editor
I agree with Greg - I'm not sure why your PDF stylesheet would look "awful" in the XML editor, unless the layout isn't set to print, or there's something quirky in the stylesheet.AndrewCampbell wrote:That's not what I want to do. I want to use one CSS for the editor and a completely different one for the output.
One way of doing this is to create a new target, associate my 'editor' CSS with that target, and then set that target as the default target. I was wondering of there was a more elegant way of doing it.
However, if you really want to create a separate stylesheet for the editor, you can set it as the master stylesheet at the project level (in the Project tab > Project Properties). That should modify the look of the editor. Then, make sure Allow local stylesheets is selected, and verify that the target is still referencing your original stylesheet.
You do not have the required permissions to view the files attached to this post.
Casey
-
- Propeller Head
- Posts: 24
- Joined: Thu Nov 10, 2016 4:19 am
Re: Changing the CSS used in the XML Editor
In this case, it is because the font for the PDF output looks nice as a PDF, but looks awful on screen.cdschroeder wrote: I agree with Greg - I'm not sure why your PDF stylesheet would look "awful" in the XML editor, unless the layout isn't set to print, or there's something quirky in the stylesheet.
In general, I prefer not to tie the look and feel of the content in the editor to the look and feel of the content in an output format, because any given topic can appear in several different output formats, none of which will necessarily look like each other.
Thanks, this worked, although I did have to restart a couple of times due to what I assume is a caching issue.However, if you really want to create a separate stylesheet for the editor, you can set it as the master stylesheet at the project level (in the Project tab > Project Properties). That should modify the look of the editor. Then, make sure Allow local stylesheets is selected, and verify that the target is still referencing your original stylesheet.