Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339420 - Support code tag in documentation
Summary: Support code tag in documentation
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Ling Hao CLA
QA Contact:
URL:
Whiteboard: plan
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-09 15:12 EST by Ling Hao CLA
Modified: 2021-11-19 09:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ling Hao CLA 2011-03-09 15:12:46 EST
In F1 content documentation, need the ability to specify spaces (ie  ). Explore options to add tabs (translates to 4 spaces perhaps?)
Comment 1 Konstantin Komissarchik CLA 2011-03-10 16:23:19 EST
Could you elaborate the scenarios under which this would be useful?
Comment 2 Ling Hao CLA 2011-03-10 18:26:02 EST
One scenarios is the need to specify xml fragment or java code that requires spaces for indentation formatting.

A specific use case in OEPE is IWebLogicAppDescriptor.ClassLoaderStructure which contains some xml fragments.
Comment 3 Konstantin Komissarchik CLA 2011-03-10 18:50:42 EST
In HTML, code formatting is accomplished via the combination of the pre tag and fixed-width font. Would a similar approach make sense here? I can see supporting [code][/code] tag. Is it possible to control font type in FormText?
Comment 4 Ling Hao CLA 2011-03-10 19:05:42 EST
Will investigate [code] tag. From docs, it appears FormText have font support.
Comment 5 Ling Hao CLA 2011-03-11 17:35:16 EST
Correction, FormText will support font..etc, but we are currently using the Eclipse documentation infrastructure which removes all html tag support except bold. How about we support a [code] tag which will preserve the spaces and line breaks.
Comment 6 Konstantin Komissarchik CLA 2011-03-11 17:37:05 EST
> How about we support a [code] tag which will preserve the spaces and line
> breaks.

Sounds good.
Comment 7 Ling Hao CLA 2011-03-14 17:35:19 EDT
Added [code] tag and an example in sapphire-gallery help.
Comment 8 Konstantin Komissarchik CLA 2011-03-16 00:44:08 EDT
The spaces are preserved but not the newlines. At least this isn't evident in the sample. Instead of using [br/] tag, content inside [code] tag should be able to use regular newlines and have them be translated into line breaks.

    @Documentation( content = "Content help containing code tag which preserves the spaces." +
    		"[br/]" +
    		"[code]" +
			"[br/]<actions>" +
			"[br/]    <action-group>" +
			"[br/]        <action>" +
			"[br/]            <class>MyAction1</class>" +
			"[br/]        </action>" +
			"[br/]        <action>" +
			"[br/]            <class>MyAction2</class>" +
			"[br/]        </action>" +
			"[br/]    </action-group>" +
			"[br/]</actions>" +
    		"[/code]" )
Comment 9 Ling Hao CLA 2011-03-16 17:01:16 EDT
Verify both \r\n and \n are preserved inside the [code] tag.
Also updated the example to use \r\n instead of the [br] tag
Comment 10 Konstantin Komissarchik CLA 2011-03-16 17:51:20 EDT
Verified.