FsCheck icon indicating copy to clipboard operation
FsCheck copied to clipboard

Distinguish C# and F# code in documentation

Open hickford opened this issue 7 years ago • 7 comments

An idea: it could be helpful to distinguish C# code from F# code in the documentation somehow, eg. by giving it a different background colour. This would make the documentation easier to read. I know both F# and C# but still find it confusing reading one when expecting another.

Example https://fscheck.github.io/FsCheck/Properties.html

hickford avatar May 25 '18 14:05 hickford

Yes, this is a good idea. Do you know how to do it? We use Fsharp.formatting. Perhaps there is some css magic we can do?

kurtschelfthout avatar May 26 '18 14:05 kurtschelfthout

Just add a tab on top that says f# or c#

On Sat, May 26, 2018, 10:58 AM Kurt Schelfthout [email protected] wrote:

Yes, this is a good idea. Do you know how to do it? We use Fsharp.formatting. Perhaps there is some css magic we can do?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fscheck/FsCheck/issues/439#issuecomment-392266730, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbT_dYVzUoPrpYNFA_n3wQ1NoFqF-HTks5t2W14gaJpZM4UOE8e .

jzabroski avatar Jun 26 '18 10:06 jzabroski

I would like to tackle this.

Angr1st avatar Feb 18 '19 17:02 Angr1st

Nice! Do you need some pointers - I can only be of minimal help - I would start with digging through the generated html etc and figure out if there is some css we can leverage.

FSharp.formatting does allow us to specify a template so maybe it’s possible to put something there.

kurtschelfthout avatar Feb 18 '19 22:02 kurtschelfthout

I have already skimmed through the code and tried to find out how to alter the css to adapt the background color. It currently seems like we just use the default css that is delivered by Fsharp.Formatting. I have opened an issue with them for this as a feature as I think that there would be more people that would enjoy some clearer language snippet differentiation.

Angr1st avatar Feb 19 '19 00:02 Angr1st

That's awesome.

I noticed that the snippets are surrounded by <code lang="fsharp"></code> tags - any chance we can do something with that?

Sorry if that's stupid or obvious, I know next to nothing about css etc :)

kurtschelfthout avatar Feb 19 '19 16:02 kurtschelfthout

No worries my css knowledge is not that big but in theory we could but it would need to be done in fsharp.formatting itself.

Angr1st avatar Feb 21 '19 17:02 Angr1st