HI Juan
You are right. Apologies for forgetting to tell you about that.
I applied a specific template just before exporting to HTML with the headings colors cin accordance to the Guide main color (blue for Writer, green for Calc, Gray for Getting Started…) . After applying the template I do the export with writer2html.oxt .
Process is: apply the template attached below on chapter, and then run the script. You also must remove the section COPYRIGHT before running the script.
The template I used for GS guides is attached (note that the Headings colors are changed)
odf2htmlV2.ott (244,1,KB)
For the numbered lists, I did a hack with a script: change the number list to a non-list style and prepend the list number to the paragraph.
Here is the code
Sub ConvertNumberedListToLabels
REM must remove all sub-sections before
REM MUST apply odf2htmlV2.ott template before running this script to get extra styles
oSection = ThisComponent.getTextSections().getByName("SEC_DISPLAYAREA")
oParEnum = oSection.getAnchor().createEnumeration()
vCursor = Thiscomponent.CurrentController.getViewCursor()
REM Pre-pend list number to paragraph contents
Do While oParEnum.hasMoreElements()
oPar = oParEnum.nextElement()
If oPar.supportsService("com.sun.star.text.Paragraph") Then
If oPar.NumberingIsNumber Then
If ((oPar.NumberingStyleName = "Numbering 1") _
or (oPar.NumberingStyleName = "Numbering 2") _
or (oPar.NumberingStyleName = "Numbering 3")) Then
oCurs = oPar.getText().createTextCursorbyRange(oPar.Anchor)
oCurs.gotoStartOfParagraph(false)
oCurs.CharStyleName = "Strong Emphasis"
labelString = oPar.ListLabelString & " "
oCurs.getText().insertString(oCurs, labelString , False)
End If
End If
End If
Loop
REM Change numbered paragraph to list-less paragraph style HNumbering1,2,3 available in of2htmlV2.ott template
REM and remove list attached
oParEnum2 = oSection.getAnchor().createEnumeration()
Do While oParEnum2.hasMoreElements()
oPar = oParEnum2.nextElement()
If oPar.supportsService("com.sun.star.text.Paragraph") Then
If oPar.NumberingIsNumber Then
vCursor.gotoRange(oPar.Anchor.Start,false)
If (oPar.NumberingStyleName = "Numbering 1") Then
vCursor.ParaStyleName = "HNumbering 1"
oPar.NumberingIsNumber = False
oPar.NumberingStyleName =""
ElseIf (oPar.NumberingStyleName = "Numbering 2") Then
vCursor.ParaStyleName = "HNumbering 2"
oPar.NumberingIsNumber = False
oPar.NumberingStyleName =""
ElseIf (oPar.NumberingStyleName = "Numbering 3") Then
vCursor.ParaStyleName = "HNumbering 3"
oPar.NumberingIsNumber = False
oPar.NumberingStyleName = ""
End If
End If
End If
Loop
Msgbox "List done"
End Sub
Regards
Olivier
PS. I promise once I have time, to write better, less hacky, more professional scripts…