Re: [Pharo-users] Code formatting in CustomHelp

2018-02-10 Thread Stephane Ducasse
Why don't you extend ProfStef?

On Thu, Feb 8, 2018 at 3:20 PM, Cédrick Béler  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



Re: [Pharo-users] Code formatting in CustomHelp

2018-02-08 Thread 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  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
>


[Pharo-users] Code formatting in CustomHelp

2018-02-08 Thread Cédrick Béler
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