Forum Suggestion: Proper Code Highlighting
-
Since the vast majority of code that gets posted on here is gcode, it sure would be nice if the code highlighting was consistent with that. I'm not sure if there's markup to select what kind of code we're posting, but if there is, perhaps gcode could be set as the default? And if not, perhaps the highlighting could be changed to gcode in the backend?
-
@GoremanX said in Forum Suggestion: Proper Code Highlighting:
Since the vast majority of code that gets posted on here is gcode, it sure would be nice if the code highlighting was consistent with that. I'm not sure if there's markup to select what kind of code we're posting, but if there is, perhaps gcode could be set as the default? And if not, perhaps the highlighting could be changed to gcode in the backend?
The code tag </> doesn't seem to highlight as one might expect but it's a step in the right direction.
Frederick
-
@fcwilt said in Forum Suggestion: Proper Code Highlighting:
The code tag </> doesn't seem to highlight as one might expect but it's a step in the right direction.
Yes that's what I'm referring to. Some forums allow to select the highlight syntax within that markup. This forum does not
-
@GoremanX said in Forum Suggestion: Proper Code Highlighting:
Yes that's what I'm referring to. Some forums allow to select the highlight syntax within that markup. This forum does not
nothing a handjob can't fix
```bash #code goes here ```
```text unformattted ```
and so on
-
@bearer said in Forum Suggestion: Proper Code Highlighting:
```bash #code goes here ```
And what is that supposed to do?
Frederick
-
@fcwilt said in Forum Suggestion: Proper Code Highlighting:
And what is that supposed to do?
it sets the language for highlighting as OP requested, haven't checked if there is a gcode language, wasn't one last time.
json
does seem to be second best thing after some experimenting -
I can't help but notice that DWC 3.2 has a nice syntax highlighter when editing gcode files in Chrome-based browsers (though it appears to be disabled in Firefox). I wonder if that could be somehow ported to this forum's code markup processing.
-
@GoremanX said in Forum Suggestion: Proper Code Highlighting:
markup
the
markupmarkdown stuff does have a gcode highligter, but but this version didn't last time it was a topic iirc.btw to show the
```
- nest it in four of those..````language ```language stuff ``` ````
-
; Add default wifi network ; M291 R"Add default WIFI network? Y/N" P"This will add duetwifi access point." S3 T10 M552 S0 ; Disable network module G4 S5 ; wait 5 seconds M587 S"NETWORKNAME" P"PASSWORD" ; Add duet wifi SSID to remembered networks list G4 S5 ; wait 5 seconds M552 S1 ; reenable wifi module M291 R"duetwifi SSID added." P"Check console to verify IP address."
The json tag seems to highlight fairly well for gcode.
-
@Phaedrux Cool! Would be nice if it defaulted to that when we click the </> button. I couldn't easily find any way to set it to different languages (not that I tried very hard), but now that I know, I'll do so