supported code high lighters on forum - add gcode?
-
Having looked at https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code I see we can specify which langue highlighting to use, but its not complete according to https://highlightjs.org/static/demo/
Could it be update to include
gcode
andaccesslog
maybe? -
Until this is added, "```json" works fairly well:
O003 (DIAMOND SQUARE) N2 G54 G90 G49 G80 N3 M6 T1 (1.ENDMILL) N4 M3 S1800 N5 G0 X-.6 Y2.050 N6 G43 H1 Z.1 N7 G1 Z-.3 F50. N8 G41 D1 Y1.45 N9 G1 X0 F20. N10 G2 J-1.45 (CUTTER COMP CANCEL) N11 G1 Z-.2 F50. N12 Y-.990 N13 G40 N14 G0 X-.6 Y1.590
Certainly better than the default:
O003 (DIAMOND SQUARE) N2 G54 G90 G49 G80 N3 M6 T1 (1.ENDMILL) N4 M3 S1800 N5 G0 X-.6 Y2.050 N6 G43 H1 Z.1 N7 G1 Z-.3 F50. N8 G41 D1 Y1.45 N9 G1 X0 F20. N10 G2 J-1.45 (CUTTER COMP CANCEL) N11 G1 Z-.2 F50. N12 Y-.990 N13 G40 N14 G0 X-.6 Y1.590
-
Suppose making gcode the default would be a added bonus if its doable to add this.
-
@bearer I think weโre at the mercy of what the forum software (I forget what it is, momentarily) chooses to support/
Include. I tend to use the json code highlighter.Ian
-
#WishfullThinking then:)
-
Oh that's great. I had no idea ````json was a thing. Looks much better. Even if that was the default that would be great.
-
@droftarts said in supported code high lighters on forum - add gcode?:
what the forum software (I forget what it is, momentarily)
DISCOURSE I think
-
@arhi said in supported code high lighters on forum - add gcode?:
DISCOURSE I think
Nope, I finally remembered... NodeBB.
Ian
-
Just doing some googling for nodeBB and code blocks and it looks like it's fairly customizable. So maybe not impossible. Would be up to @T3P3Tony to dig into it though.
-
I think someone might have done something? Line numbering seems to be a new thing, or maybe just a side effect of people using various specific language tags as opposed to the default?
-
I just noticed that line numbers are showing up now as well
json:
M667 S1 ; Select CoreXY mode M208 X0 Y0 Z-0.5 S1 ; Set axis minima M208 X325 Y273 Z305 S0 ; Set axis maxima (x has 295 printable reach) M569 P0 S0 ; Drive 0 (x) goes backwards M569 P1 S0 ; Drive 1 (y) goes backwards M569 P2 S0 ; Drive 2 (z) goes backwards M569 P3 S0 ; Drive 3 (e) goes backwards
default:
M667 S1 ; Select CoreXY mode M208 X0 Y0 Z-0.5 S1 ; Set axis minima M208 X325 Y273 Z305 S0 ; Set axis maxima (x has 295 printable reach) M569 P0 S0 ; Drive 0 (x) goes backwards M569 P1 S0 ; Drive 1 (y) goes backwards M569 P2 S0 ; Drive 2 (z) goes backwards M569 P3 S0 ; Drive 3 (e) goes backwards
Html:
M667 S1 ; Select CoreXY mode M208 X0 Y0 Z-0.5 S1 ; Set axis minima M208 X325 Y273 Z305 S0 ; Set axis maxima (x has 295 printable reach) M569 P0 S0 ; Drive 0 (x) goes backwards M569 P1 S0 ; Drive 1 (y) goes backwards M569 P2 S0 ; Drive 2 (z) goes backwards M569 P3 S0 ; Drive 3 (e) goes backwards
Js:
M667 S1 ; Select CoreXY mode M208 X0 Y0 Z-0.5 S1 ; Set axis minima M208 X325 Y273 Z305 S0 ; Set axis maxima (x has 295 printable reach) M569 P0 S0 ; Drive 0 (x) goes backwards M569 P1 S0 ; Drive 1 (y) goes backwards M569 P2 S0 ; Drive 2 (z) goes backwards M569 P3 S0 ; Drive 3 (e) goes backwards
-
-
Someone is being sneaky ... I like it!
-
Good idea, I have added line numbering but pulling in the custom highlighting for gcode etc is not currently working. Any NodeBB experts out there feel free to DM
Test cases:
var s = "JavaScript syntax highlighting"; alert(s);
s = "Python syntax highlighting" print s
G10 X100 ;gcode syntax highlighting (not working)
-
Line numbering may get confusing when only snippets of a larger file are copied and pasted. This isn't line 3, it's actually line 4250!!
-
@bot said in supported code high lighters on forum - add gcode?:
Line numbering may get confusing when only snippets of a larger file are copied and pasted. This isn't line 3, it's actually line 4250!!
I've used
```text
since the numbers were introduced as shown by Ian for this very reason. Line numbers will be usefull when referring to posted configs (snippet or not) etc, just not always if referring to source code maybe.