Code formatting in CustomHelp

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Code formatting in CustomHelp

cedreek
Hi,

I’m doing some tutorials with the help system.

In ProfStef, there is code formatting but not thrgouh the HelpBrowser.
In CustomHelp sublclasses, it’s possible to have some formatting (heading:, bold:, …).

Do you know if it’s possible to have a #code: method so as to use shout specifically ? It doesn’t seem obvious to me.

TIA

Cédrick
Reply | Threaded
Open this post in threaded view
|

Re: Code formatting in CustomHelp

Peter Uhnák
Hi,

there are couple examples in WelcomeHelp.

But more importantly, the HelpTopic content can be a Text, which means you can apply your own formatting. To the text.

For example, I have also subsubheading:

subsubheading: aString
"Return Text object with subsubheading formating attributes."

| text font color |
font := LogicalFont familyName: 'Source Sans Pro' pointSize: 14.
color := Color fromHexString: '3196D3'.
text := aString asText.
^ text
addAttribute: (TextFontReference toFont: font) from: 1 to: text size;
addAttribute: TextEmphasis bold from: 1 to: text size;
addAttribute: (TextColor new color: color) from: 1 to: text size;
yourself


And you can add your code (I've changed the familiny name)

code: aString

| text font color |
font := LogicalFont familyName: 'Source Code Pro' pointSize: 14.
text := aString asText.
^ text
addAttribute: (TextFontReference toFont: font) from: 1 to: text size;
yourself


It would be cool to have a Pillar exporter to Pharo help.

Peter

On Thu, Feb 8, 2018 at 3:20 PM, Cédrick Béler <[hidden email]> wrote:
Hi,

I’m doing some tutorials with the help system.

In ProfStef, there is code formatting but not thrgouh the HelpBrowser.
In CustomHelp sublclasses, it’s possible to have some formatting (heading:, bold:, …).

Do you know if it’s possible to have a #code: method so as to use shout specifically ? It doesn’t seem obvious to me.

TIA

Cédrick

Reply | Threaded
Open this post in threaded view
|

Re: Code formatting in CustomHelp

Stephane Ducasse-3
In reply to this post by cedreek
Why don't you extend ProfStef?

On Thu, Feb 8, 2018 at 3:20 PM, Cédrick Béler <[hidden email]> wrote:

> Hi,
>
> I’m doing some tutorials with the help system.
>
> In ProfStef, there is code formatting but not thrgouh the HelpBrowser.
> In CustomHelp sublclasses, it’s possible to have some formatting (heading:, bold:, …).
>
> Do you know if it’s possible to have a #code: method so as to use shout specifically ? It doesn’t seem obvious to me.
>
> TIA
>
> Cédrick