0

I want to indent my text in the article I am writing in docbook 5. I also need to add colors to my text. Is that possible? If so how? I tried indenting as follows but it was not visible when I took the html output of it.(Here I tried to align the text "Kerfun" to the center) I have no idea regarding the colour change. Can someone please tell me how? Where have I gone wrong?

<dbk:para text-indent="center">Kerfun</dbk:para>
   <dbk:para text-indent="center">
      <dbk:emphasis role="bold">Fadiah</dbk:emphasis>
   </dbk:para>
harsh
  • 2,399
  • 9
  • 29
  • 47
  • possible duplicate of [Best tool(s) for working with DocBook XML documents?](http://stackoverflow.com/questions/55622/best-tools-for-working-with-docbook-xml-documents) – Mark O'Connor Jul 01 '12 at 11:42
  • 2
    As we discussed in SO chat, there is a separation between DocBook markup structure and Rendering style. Indeed DocBook markup should only specify the structure, with style left to the renderer. – msw Jul 01 '12 at 12:34
  • @msw thanks a lot for the support! :) – harsh Jul 01 '12 at 13:06

1 Answers1

1

You haven't specified your OS or toolchain.

To format your xml: I'd suggest using the "xmllint -format" command

To validate your xml: Same command could be used to ensure your document is valid against the docbook schema

To colorize your xml: That very much depends on what editor you use. Personally I'm a fan of gvim which has XML high-lighting enabled by default.

Update

As stated I'm not a windows guy but 2 minutes of googling lead me to the following:

  • Notepad++ appears to have an XML plugin. Source was the following link
Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • Thanks Mark. I am using Windows if that matters. I am new to Docbook. I've got to write a given document in DocBook 5. It has indents and text colours. I have no idea regarding the toolchain. :-/ – harsh Jul 01 '12 at 11:16
  • @harsh In that case xmllint isn't much good to you. What tool are you using to open up and edit the docbook file? I'm not a windows guy, but perhaps someone else might know how to configure your development environment (Once we know what it is) – Mark O'Connor Jul 01 '12 at 11:27
  • And the document I have is in xml. – harsh Jul 01 '12 at 11:28
  • Yes.... Docbook is formatted as an XML document.... So what is the editor you are using to edit said XML document?.... What command do you run to create presumably a HTML output?.... – Mark O'Connor Jul 01 '12 at 11:30
  • thanks Mark I use Notepad++ as the editor. Does it matter? :-/ – harsh Jul 01 '12 at 11:30
  • xsltproc. I do not understand how these are related. :-/ – harsh Jul 01 '12 at 11:32
  • 1
    @harsh yes it very much matters. You wanted to know how to syntax highlight your XML. That is done by your editor not the operating system. Coloring information is not stored with the document itself, unless it is transformed into another document format like XHTML which is designed to display information in a browser. – Mark O'Connor Jul 01 '12 at 11:41
  • I want to add colours to the document which will be stored so that when I transform the document into html those colours will be visible. thanks. – harsh Jul 01 '12 at 11:51
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/13267/discussion-between-harsh-and-mark-oconnor) – harsh Jul 01 '12 at 11:52