|
linjinwei
Member
Posts: 65
|
 |
« on: December 16, 2008, 08:05:52 PM » |
|
After much exploratng, I understand that you need to customize some of your own attributes in the DTD section. Currently I'm trying to indent text. I created a new attribute named "indent". Everything in the HighlightDomain.end and HighlightDomain.mod is done. I can see the new attribute in the Element List. Now I am trying to define the "indent" in the ditabase-derived.css file. But I have no idea what is the exact code to indent text. I tried "start-indent", "left-margin" but didnt work. Here is the part of the code. I only need to find out the exact coding to do indenting. /* indent {*/ [class~="hi-d/indent"] { start-indent: 10pt; }
Thanks in advance
|
|
|
|
« Last Edit: December 22, 2008, 08:35:08 PM by syeo »
|
Logged
|
|
|
|
|
ghkrause
Member
Posts: 62
|
 |
« Reply #1 on: December 16, 2008, 08:30:42 PM » |
|
I try hard not to start arguing whether this is a good idea what you do.
You want to try something out to get DITA fitting your needs. You did either an attribute or element specialization. a) In case of attribute you need to assign a value to the attribute. Example: <p indent="yes">indented paragraph</p> A CSS would read [indent="yes"] { margin-left: 10pt; } b) in case of a element (you should start your own domain for this, do not extend OASIS domains): example: <indent class="+ topic/p my-domain/indent "idented paragraph </indent> A CSS would read [class~=" my-domain/indent "] { margin-left: 10pt; }
Please do not mix element and attribute in XML. Preferred implementation would be an element that is semantically named like <lq> (long quote) which is by default indented in XMetaL. Abusing <lq> for your purpose of indenting is equally acceptable as adding format driven tags like <indent>. The highlight domain with i/b/u is a bad example as it introduces format driven tags instead of semantic ones. It is accaptable to get people starting and to demo inline tags (tags within a paragraph).
Hope this helps.
|
|
|
|
|
Logged
|
Gunnar H. Krause, TechDoc Manager, Nuremberg Area, Germany
|
|
|
|
linjinwei
Member
Posts: 65
|
 |
« Reply #2 on: December 19, 2008, 08:53:48 PM » |
|
Hi ghkrause . I am actually doing the b) method. I typed in what you said in ditabase-derived.css but the text still wont indent. /* indent {*/ [class~="hi-d/indent"] { margin-left: 10pt; }
But The text still refuse to indent in XMetal interface or pfd output. It is so hard to just indent some texts? I dont want to use <lq> because it gives me a rectangular box in the pdf output. Please help. Thks in advance
|
|
|
|
|
Logged
|
|
|
|
|
linjinwei
Member
Posts: 65
|
 |
« Reply #3 on: December 19, 2008, 10:13:22 PM » |
|
OK...after much more trial and errors, I finally got the indenting in XMetal interface. /* indent {*/ [class~="hi-d/indent"] { margin-left: 10pt; display: block; } But the effect is not taken in the pdf output. It does not indent in pdf. Can someone tell me why? This image shows the interface in XMetal  This image shows the output in pdf.  Edit: ok I managed to solved my problem. It can display in XMetal interface and pdf output, but not in HTML output. Why is that so?
|
|
|
|
« Last Edit: December 20, 2008, 02:58:38 AM by linjinwei »
|
Logged
|
|
|
|
mag3737
XMetaL Evangelist
Administrator
Member
Posts: 95
I even use XMetaL to write my business letters.
|
 |
« Reply #4 on: December 20, 2008, 12:07:29 PM » |
|
Every time XML is rendered in some format, there are stylesheets involved.
When XMetaL displays your content on the screen, it uses CSS stylesheets. (This is the stuff you added to ditabase-derived.css.)
When the PDF is created, that is the DITA Open Toolkit using XSLT stylesheets. If you got your indentation in PDF output, it was probably by editing an .xsl file somewhere.
When the HTML is created, the DITA Open Toolkit is using more .xsl stylesheets, because to an XML processor, HTML is another "output format" like PDF. But to get the indented appearance in your HTML when it is viewed, there are even more stylesheets involved -- CSS that is used by the web browser. So to get this indentation you might need to modify two sets of stylesheets: 1) CSS stylesheets that are included with the DITA Open Toolkit and saved to the output directories along with the HTML output; and 2) .xsl files in the DITA OT -- but only if you need to create some HTML attributes -- something that matches up with the CSS -- that are not already being created by the toolkit.
|
|
|
|
|
Logged
|
Tom Magliery JustSystems Canada, Inc.
|
|
|
|
linjinwei
Member
Posts: 65
|
 |
« Reply #5 on: December 20, 2008, 07:23:41 PM » |
|
So can I say that the elements that define the appearance of XMetal, pdf and HTML are from independent files? So like for example if I made changes to ditabase-derived.css, it will ONLY affect the XMetal interface?
============================================================= XMetal - ditabase-derived.css =============================================================
pdf - 1) C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\xsl\fo\hi-domain.xsl - 2) C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\ Customization\fo\attrs\xm-cfg\hi-domain-attr.xsl - 3) C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\cfg\fo\attrs\hi-domain-attr.xsl =============================================================
html - ??? =============================================================
I have not figured out where to change the interface for HTML, any clue?
|
|
|
|
|
Logged
|
|
|
|
|
Su-Laine Yeo
Solutions Consultant
Member
Posts: 262
|
 |
« Reply #6 on: December 22, 2008, 05:29:59 PM » |
|
See "Appendix B: Configuring XHTML and CHM output" in the XMetaL online help.
Note that we recommend NOT changing ditabase-derived.css, because JustSystems may improve this file in new releases. There are "override" files that you should use instead. See the online help topic called "DITA stylesheets" for details.
I don't know the specifics of why you want to indent text, as the only example you've posted is from a table of contents. However I'll say one more time that creating a new element called <indent> is generally a very bad way to go about indenting things. There are lots of experienced consultants out there who can look at your requirements and help you deal with these issues more strategically. If you spend time now modelling your content and figuring out how to separate content from formatting, you will save yourself a lot of time later on when your company decides to change its layout guidelines or when you want to deliver content in different output formats, e.g. for small-screen devices.
Su-Laine
|
|
|
|
|
Logged
|
Su-Laine Yeo Solutions Consultant JustSystems Canada, Inc.
|
|
|
|
linjinwei
Member
Posts: 65
|
 |
« Reply #7 on: December 29, 2008, 11:42:53 PM » |
|
Hi. I read the help on HTML output and got confused. Its leaves me with some questions. 1)The Help told me to create a custom file to place all the elements that i created inside. Where do I find the file? Am I suppose to create it myself? Must the file be named "xhtml_custom.css"? 2)SO the elements are found in: C:\Program Files\Common Files\XMetaL Shared\DITA_OT\resource\commonltr.css . This file includes selectors and styles for left-to-right output. C:\Program Files\Common Files\XMetaL Shared\DITA_OT\resource\commonrtl.css . This file includes selectors and styles for right-to-left output.
Why is it that when I edit the "bold" element, nothing happened in the output? Am I suppose to change the code in both commonltr.css and commonrtl.css ? .bold { font-weight: bold; font-size: 50em;}
|
|
|
|
|
Logged
|
|
|
|
|
Su-Laine Yeo
Solutions Consultant
Member
Posts: 262
|
 |
« Reply #8 on: December 30, 2008, 06:01:16 PM » |
|
What is the title of the help topic you saw that says to "to create a custom file to place all the elements that [you] created inside"? Where did you get the impression that you should name the file "xhtml_custom.css"?
|
|
|
|
|
Logged
|
Su-Laine Yeo Solutions Consultant JustSystems Canada, Inc.
|
|
|
|
linjinwei
Member
Posts: 65
|
 |
« Reply #9 on: December 30, 2008, 06:25:02 PM » |
|
|
|
|
|
|
Logged
|
|
|
|
|
Su-Laine Yeo
Solutions Consultant
Member
Posts: 262
|
 |
« Reply #10 on: December 30, 2008, 07:01:41 PM » |
|
What this topic says is "You can copy and edit this file to create custom styling for your output." (It is referring to both the commonltr.css file and the commonrtl.css file, but for most of the world's languages all you need to worry about is the commonltr.css file.)
In other words, make a copy of the commonltr.css file and give the copy a different file name, such as "my_commonltr.css". Then edit "my_commonltr.css". After that, you will point XMetaL to the my_commonltr.css file so that it automatically uses that file when generating HTML output. Does this make sense so far?
|
|
|
|
|
Logged
|
Su-Laine Yeo Solutions Consultant JustSystems Canada, Inc.
|
|
|
|
linjinwei
Member
Posts: 65
|
 |
« Reply #11 on: December 31, 2008, 01:19:13 AM » |
|
So after I have created my custom file, should i remove all the contents inside and only leave the elements that I want?
For example, if I only want to edit the "bold" element, I should remove every thing else except for the "bold" element?
|
|
|
|
|
Logged
|
|
|
|
Derek Read
Program Manager (XMetaL)
Administrator
Member
Posts: 1402
|
 |
« Reply #12 on: January 05, 2009, 06:58:59 PM » |
|
The custom CSS file you are editing should be delivered with the HTML files that are output by the DITA OT and will be referenced in the HTML using a <link> element so that browsers can find and open it. It is up to you to decide what CSS settings you wish to include in this CSS file. When you open the HTML with a browser the browser will use whatever default settings it has built-in for HTML elements and attributes and then add your CSS to those (basically as overrides). The DITA OT inserts the following into the HTML by default: <link href="commonltr.css" type="text/css" rel="stylesheet" /> You may wish to look for information on how the various browsers support <link> for referencing CSS files. All the modern browsers support this but you may have special cases.
|
|
|
|
|
Logged
|
|
|
|
|