Navigation

    Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    Forum Suggestion: Proper Code Highlighting

    General Discussion
    4
    10
    86
    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.
    • GoremanX
      GoremanX last edited by

      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?

      fcwilt 1 Reply Last reply Reply Quote 0
      • fcwilt
        fcwilt @GoremanX last edited by

        @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

        Printers: A FT-5 with the 713 upgrade bits. A custom MarkForged style. A small Utilmaker style and a CoreXY from kits. Various hotends. Using Duets (2 and 3) running 3.4.1

        GoremanX 1 Reply Last reply Reply Quote 0
        • GoremanX
          GoremanX @fcwilt last edited by

          @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

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

            @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

            fcwilt 1 Reply Last reply Reply Quote 1
            • fcwilt
              fcwilt @Guest last edited by

              @bearer said in Forum Suggestion: Proper Code Highlighting:

              ```bash
              #code goes here
              ```
              

              And what is that supposed to do?

              Frederick

              Printers: A FT-5 with the 713 upgrade bits. A custom MarkForged style. A small Utilmaker style and a CoreXY from kits. Various hotends. Using Duets (2 and 3) running 3.4.1

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

                @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

                1 Reply Last reply Reply Quote 0
                • GoremanX
                  GoremanX last edited by

                  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.

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

                    @GoremanX said in Forum Suggestion: Proper Code Highlighting:

                    markup

                    the markup markdown 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
                    ```
                    ````
                    
                    1 Reply Last reply Reply Quote 0
                    • Phaedrux
                      Phaedrux Moderator last edited by

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

                      Z-Bot CoreXY Build | Thingiverse Profile

                      GoremanX 1 Reply Last reply Reply Quote 0
                      • GoremanX
                        GoremanX @Phaedrux last edited by GoremanX

                        @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

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