FSharp.Formatting icon indicating copy to clipboard operation
FSharp.Formatting copied to clipboard

Distinguish Code Snippets in multiple languages more clearly

Open Angr1st opened this issue 6 years ago • 3 comments

I am currently trying to find a way to insert a label or something above the code snippet that contains the language name to make it clearer in what language the sample was written. Currently I don't really see a way to do it without modifying the css that FSharp.Formatting delivers or building this feature directly into FSharp.Formatting itself. If this would be something that is wanted I would appreciate it if someone could point me towards the right place to start with this. I have seen that you have started implementing potential prism.js support. #482 Maybe you would be interested in adding this language differentiation while you are at it.

Angr1st avatar Feb 19 '19 00:02 Angr1st

I think you can mark language using either:

some normal text

```javascript
var a = {} + {};
```

Or using:

some normal text

    [lang=javascript]
    var a = {} + {}

The way this gets handled for different languages is not perfect, but the marking should work fine.

tpetricek avatar Feb 19 '19 00:02 tpetricek

This only works within markdown files or also when using 'Literate programming'?

Angr1st avatar Feb 19 '19 00:02 Angr1st

I am thinking of something like this example or this The F# and CSS label that are placed in the left upper corner.

Angr1st avatar Feb 19 '19 00:02 Angr1st