Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    supported code high lighters on forum - add gcode?

    Scheduled Pinned Locked Moved
    General Discussion
    7
    16
    605
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Former User?
      A Former User
      last edited by A Former User

      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 and accesslog maybe?

      1 Reply Last reply Reply Quote 1
      • Danalundefined
        Danal
        last edited by Danal

        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
        
        

        Delta / Kossel printer fanatic

        1 Reply Last reply Reply Quote 0
        • A Former User?
          A Former User
          last edited by

          Suppose making gcode the default would be a added bonus if its doable to add this.

          droftartsundefined 1 Reply Last reply Reply Quote 0
          • droftartsundefined
            droftarts administrators @A Former User
            last edited by

            @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

            Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

            arhiundefined 1 Reply Last reply Reply Quote 0
            • A Former User?
              A Former User
              last edited by

              #WishfullThinking then:)

              1 Reply Last reply Reply Quote 0
              • Phaedruxundefined
                Phaedrux Moderator
                last edited by

                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.

                Z-Bot CoreXY Build | Thingiverse Profile

                1 Reply Last reply Reply Quote 0
                • arhiundefined
                  arhi @droftarts
                  last edited by

                  @droftarts said in supported code high lighters on forum - add gcode?:

                  what the forum software (I forget what it is, momentarily)

                  DISCOURSE I think

                  droftartsundefined 1 Reply Last reply Reply Quote 0
                  • droftartsundefined
                    droftarts administrators @arhi
                    last edited by

                    @arhi said in supported code high lighters on forum - add gcode?:

                    DISCOURSE I think

                    Nope, I finally remembered... NodeBB.

                    Ian

                    Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                    1 Reply Last reply Reply Quote 0
                    • Phaedruxundefined
                      Phaedrux Moderator
                      last edited by Phaedrux

                      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.

                      Z-Bot CoreXY Build | Thingiverse Profile

                      1 Reply Last reply Reply Quote 0
                      • A Former User?
                        A Former User
                        last edited by

                        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?

                        1 Reply Last reply Reply Quote 0
                        • Phaedruxundefined
                          Phaedrux Moderator
                          last edited by

                          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
                          

                          Z-Bot CoreXY Build | Thingiverse Profile

                          droftartsundefined 1 Reply Last reply Reply Quote 0
                          • droftartsundefined
                            droftarts administrators @Phaedrux
                            last edited by droftarts

                            @Phaedrux

                            This is
                            with
                            โ€˜textโ€™
                            set
                            

                            Ian

                            Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                            1 Reply Last reply Reply Quote 0
                            • A Former User?
                              A Former User
                              last edited by A Former User

                              Someone is being sneaky ... I like it! ๐Ÿ‘‡

                              1 Reply Last reply Reply Quote 0
                              • T3P3Tonyundefined
                                T3P3Tony administrators
                                last edited by T3P3Tony

                                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)
                                

                                www.duet3d.com

                                1 Reply Last reply Reply Quote 0
                                • botundefined
                                  bot
                                  last edited by

                                  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!!
                                  

                                  *not actually a robot

                                  A Former User? 1 Reply Last reply Reply Quote 0
                                  • A Former User?
                                    A Former User @bot
                                    last edited by

                                    @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.

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post
                                    Unless otherwise noted, all forum content is licensed under CC-BY-SA