[How to] Post correctly formatted and colorized code on the forum?

Continuing the discussion from Ruby backtick returns nothing!:

Triple backtick delimiter lines.


  • image

Backquote character key on US keyboard.


If it is error message text (or some other plain text that contains <, >, #, or other characters that can confuse Discourse markdown,) then specify “text” as a lexing language:

```text
paste error message here
```

If it is Ruby, then:

```ruby
# code here
```

If it is Javascript, then:

```javascript
/* js code here */
```

If it is HTML, then:

```html
<!-- html here -->
```

If it is C, then:

```c
// C code here
```

… etc. (Discourse code lexer recognizes the major programming languages.)

IFC Export - labelname sync definition
Alternative to get_element_value method for HtmlDialog
Help lines and wall
How create an attribute for guidepoint?
Error While loading sqlite3 in ruby
Basic Cube Grid Wireframe Script (Cubic Array)
Creating button using sketchup Ruby
How to delete two circles at one time?
Parametric.rb
Texture inconsistent on the same component in different locations
Get the coordinate of a component
Extension to read & update .skp file
Play a sound in Sketchup
Add dimensions
Mass instance rename help
Place component with dynamic attribute change
Problem of control of the vertices
How to select inner faces of square wall
Genereted dynamic attributes not appearing in report
Is adding entities in Local or Global coordinates
Bugsplat after a component definition save_as
Failed to add AutoText into LO by Ruby
Model GeoReference
File.new File.open Errno::ENOENT
Attempting to load a component file from my disk via ruby script file I receive an Error: #<IOError: Invalid component file>
Bounding Box of Component Instance is changing after adding lines to its entitiesBox
Count sub-components with the definition "TOTO"
Extension web interface
Ruby Code for Recreating Native Text Tool
Extract face area from component using generate report
Quotes in Text
Writing Functions in Ruby Code Editor
Changing icons on Mac and PC
Entities used by a Component Instance
How to update pages without changing settings of irrelevant section planes?
Cannot repeat my first lesson in Ruby
API Ruby ....face problem...help me
Transformations consistency problem
Unable to setup VS Code debugger for SketchUp Ruby
Win32Api Dll Load
Gem install issue
How to save extension preferences -- question about write_default & read_default
Problem with SUModelRelease
How do I create a component from an instance I have drawn?
Undo Stack, Sketchup Crash...why?
SUModelSaveToFileWithVersion has performance regression in version sketchup toolkit 21.0.339
Su 2023 script - height tag for every vertex in active context - overlay used - performance issues
How to delete the same instances with simple code
Extracting Face Areas based on Layers in model groups
Need help identifying a Plugin used in a Tatlin Sofa You Tube video
How can I get width and depth of component instance in Api C++?
How to export multiple 2d views at once
Inserting a group or component with Ruby API
Need guidance on surface area script
Follow data in file in realtime and import them if data in file was changed. Ruby script
How do I create a component from an instance I have drawn?
How do I create a component from an instance I have drawn?
The problem of ruby load c dll. editor says :'unknown symbol'
Sketchup C API how to add new layers to a model
Unit UI issue?
Iterate Over Existing Dimensions
Stop API calls from creating duplicate Materials
Problem in using Sketchup.open_file method
How to group groups
C++ observer?
Component attributes using Ruby
Persistent ID Errors when Copying Groups/Components
How much iteration for dynamic component calculation?
Swapping Component definition with instance
Trying to access right click menu with no selection
Error occur when require file in Plugin
Question about htmldialog and pushing variables from Ruby to Javascript
Interesting AI generated Ruby Code example
Interesting AI generated Ruby Code example
Installing and Signing developed RBZ
How to translate a box made by pushpull into a component? (modified post with correct coding format)
Get and change dynamic attribute
How can I do if I want to solve this problems?(ruby script)
SketchUp refuses to load my plugin after adding texture related API, C++
SketchUp refuses to load my plugin after adding texture related API, C++
Set rendering option "SectionCutDrawEdges" to false
Add_action_callback problem
How to draw a line from centerpoint of face?
Error: #<TypeError: wrong argument type (expected Sketchup::ComponentDefinition)>
Hide geometry lines with Ruby
Smoothing edges when creating faces in a loop
Help w This Ruby Script for Orienting Components for Cut Sheet?
Juncture plane of two touching Solid group
Help me set funtion outer shell for components
Sending json post request in thirdparty api from sketchup
Somebody help me to make simple plugin for this code
Somebody help me to make simple plugin for this code
Interesting AI generated Ruby Code example
Newbie: face destroyed after transformation ?!?!?
Wrong face problem
How to edit rbs file?
API: SUEntitiesFill() return error code when export skp
Is there a way to bring the materials from the sketchup to the list?
Getting prebuilt materials on a object
Select a box and edit it
Solving Drill.rb Problem
How can I select a point on a face?
Html dialog box to set and get information
Different geometric data can be obtained from the same geometry
What should i learn to be sketchup developer
LWPOLYLINE creating arcs from vertices / edges
Creating log files for ruby code
Add a group to an existing group
Creating log files for ruby code
Get copper busbar side face
Namespace in Multiple .rb Files
Duplicate persistent id not fixed by 'Fix Problems' in Sketchup 2017
Component Rotation and movement
Error in Model.import function for dae file in SketchUp2023
Nokogiri vs SU2018
Explode in ruby script
Selecting Faces inside multiple groups
Creating multiple groups from multiple surfaces
Cannot get a specific material from .skp file
Dynamic Components conflicting with modified versions when imported - code workaround
How to move entity in local axis
Persistent_id for ComponentDefinition always returns zero
Apply material to all nested or non-nested instances that have the dynamic attribute "x" in the selection
SketchUp Ruby coding a dialog
Definition.save_as has issue?
How To Make Custom Dynamic Component Attribute
[code] undoable place_component() "MoveTool" clone
Issue with .html file on Box Drive
Skp2Xml for 2017 causes crash
How is "lf" special
How is "lf" special
Adding an Arc via API
I’m having trouble redrawing the dynamic component
Issue with passing arguments
Multiply-thread create model from file get error
Find the orientation of a component relative to the model
Issue with unused definitions
Adding an Arc via API
Union multiple instances
Please correct this snippet of code
Extension awaiting review
Measure units of 3dPoint
Make toolbar icon using code
Need to place the loaded component with my courser and place on a click
Observer for recognize object moved
Count sub-components with the definition "TOTO"
Make unique, a manually placed component
Can sketchup components be saved as other versions via ruby?
Dynamically changing color of entity created with ruby is very slow
Check if attribute is holding data
How to Use SUTransform to correctly render my geometry?
How to Apply Material and Texture to model p-a-r-s-e-d using sdk in unreal
Why is add_arc so slow?
Highlight detect tool - nested instances
I need help with aggregating (summing) grouped structures
Adding suffix or prefix to instance name for multiple components
IFC-Dictionary
Merge vertices by distance in a complex mesh
entityID doesn't update in a group copy
Insert dynamic component from the component folder by a plugin
1001 bit pro not load sketchup 2023.1
Assign material to entity existing in a component instance (imported dwg)
Beginner Help with SDK - C++ example file and dev environment
Why isn't showing all options?
Rubocop Offense: Extensions must have exactly one root Ruby (.rb) file
Saved views api
I'm new, please help me with this, thanks!
Sketchup API--Warehouse layouts
Help to create a custom tool
Undo multiple methods in a tool at once?
Ruby error with SketchUp 2024
Move sub-groups to the root
Cant install extention
Script is hanging?
Someone please make this simple Ruby
I can not remove bottom circular face of a nut model
How to force ruby to interact with selected edges in order of creation?
When a face is in a group,uv I get is wrong,why?
What is the Ruby script for selecting all scenes
Pushpull tool error in SketchUp 2026
Export performance issue with parameter: selectionset_only
How to rotate a texure following the bigger face side?
Help.Outer shell
Help.Outer shell
Is there any performance optimized solution to collect object vertices without crashing when the number of vertices is large, please?
Script to apply offset
Change axes position of the selected group or component and pick new position form viewport
When the object is a nested group my transformation accumulation is affected and cannot draw correctly globally
Onkeyd - flags in skp 2025
Sketchup Crashing with unstability generated
Moving a section plane using ruby
What is a best practice for HtmlDialog error handling
System ' cmd ' -call to run aws-s3 cli commands ends with error 127
Code to create a Tags folder and tags
Copying and transforming Entities
The SUStylesMoveStyle function cannot delete a specified style, and the image obtained by the SUStyledThumbnail function is only 1kb
Custom toolbar editor
Camera is saved programmatically but then when project is opened its not in saved postion
HTML via RUBY
I encode my rbz file and import it into sketchup giving me an error, I'm new
Extension code from my dev directory won't load on starting Sketchup
Layout Ruby API Document.save
(SketchUp 2026) VCB loses focus after pressing Tab in SketchUp tool
SU freezes when creating lines - ruby plugin
Can Sketchup execute a proc's
How to apply bound.center for each group after groups.each?
Websocket: callback not functioning after window.locaiton=
# Test
module Eneroth3::TestSyntaxHighlight
  def self.method_name
    puts "String"
    5+12
    yield false
    return true
  end
end

I had no idea this forum supported syntax highlighting :open_mouth: .

2 Likes

Yep! Discourse processes your post’s text through a Markdown language formatter, and implements this feature of Markdown. The Markdown formatter is also why posts of error messages and code can get so screwed up if people don’t use the triple backtick syntax!

2 Likes

Welcome Dylan … the wikipedia page (linked below) explains what markdown is in detail.

But it is basically a simple, human-readable text code that can be used to nicely format posting on the web or documents.

The forum system should have sent you a message explaining the basics of using markdown on the forum.
(Click your avatar menu at the top right, see if the welcome message from the system is there.)

1 Like