How to use code fences

Tags: #<Tag:0x00007f616e3959c8>

We all have to type this content over and over and over. Here is a posting we can all point to when the topic comes up.

Why use code fences?

Because rules, sitemap, logs, and configs are all but unreadable when code fences are not used.

When to use code fences?

Whenever one is posting any sort of code, config, log, and any text where line wrapping, indentation, and using an equal spaced font makes the text more legible.

How to use code fences?

Use 3 backticks (```)... Or use <code>... ...to Get
```
code block
some code line 1
some code line 2
```
<code>
code block
some code line 1
some code line 2
</code>


If you are using a bit of code inline in a sentence use single backticks:
This is a sentence with `some code` in it.

becomes:

This is a sentence with some code in it.

To use code fences for a block of code, first create the fences and then paste your code, logs, etc between the fences. To create the fences there are a number of icons at the top of the text entry box for writing a new topic or replying to a topic. Hover over the icon and it will tell you what the icon represents. Below is the icon, what the hover text says, and what it drops into your posting. If you just type in the “what it drops into posting” you do not need to use the icons.

image

    indent preformatted text by 4 spaces

This uses a monospaced font and preserves indentation and line wraps but dose not perform syntax highlighting.

image
openHAB *.items code fences

```csv
your items code goes here
```

code%20fences%20-%20rules
openHAB *.rules code fences

```php
your rules code goes here
```

code%20fences%20-%20sitemaps
openHAB *.sitemap code fences

```php
your sitemap code goes here
```

code%20fences%20-%20javascript
JavaScript code fences

```javascript
your javascript code goes here
```

code%20fences%20-%20generic
generic code fences

```   
your generic code goes here
```

If you are posting some other language that Discourse supports you can try to use that language in your code fences, it often will work.

```python
python code goes here
```
15 Likes
Calculate periodic consumption of gas based on meter readings
TCP Binding - can't get it to work properly
Binding cant be configured in debug mode
How to send http request?
Rules Smarthome openHAB
Assigning Wattage, Voltage etc. of a power plug to Alexa
Two ZWave Door / Window Sensors -> both get updates while opening/closing one of them
Manually added items ignored
Limits in number of timers?
Yale Lock Convert Alarm (raw) To Human Readable Text
Looking to replace Smartthings with openHAB, need advice
Amazon Alexa Smart Skill item configuration issue - doesn't support that
How to post command to Item using HTML form
Yet Another Exec Question
How to set up configuration files?
About the Amazon Alexa category
OpenWeatherMap daily forecast using the free API
Extract temperature from an MQTT string
Configure amanda backup in openhabian-config error
No code fence button in editor
Help me pliase! I can not add the items switches from OH2 HomeKit to the smarthome on my Iphone
CalDav usage and manually set events
CBUS Binding configuration queries
maximumSince isn't the maximum
Shelly Plug S Rule compare
<SOLVED> Wrong time in openhab karaf console
Openhab stops working
ZWave binary sensor state reverts to NULL
openHAB - Filtering event logs
Sylvania Smart+ Recessed RGBW (Zigbee) - values fluctuate when set
Strange numbers in kWh-meter display of NAS-WR01ZE
Rules for Tasmota Maintenance
Z-wave device Error after update openhabian to Version 2.5.4_01
System cannot detect things anymore
Cloud OFFLINE
Shelly binding NG rule based on less the 5 Watt power
Openhab Web services stops and needs manual restarting
Rules is not working with TP-Link Plug and less then 5 W
Mqtt, binding, things and transformation
Garage Door Alert 2 Doors - Check if light is on
After Upgrade to 2.5.3-1 not working
Simple rule not working on Synology setup
Console access from freebsd via client (ssh, karaf)
[Solved] Rules trying to learn
Zigbee and Z-Wave manual install script
Newbie Question about logging stuff & receivedEvent.getEvent
Aeotec ZW164
[SOLVED] Rules, Joys of An error occurred during the script execution
How to ask a good question / Help Us Help You
Cant get push notifications to work
Cant get push notifications to work
Fritzboxtr064 - once again...rule's not working in OH2 for call identification etc
Oomi bulb zwave not responding to controls
[SOLVED] Build Error
Http item switching socket (Blitzwolf)
[SOLVED] Issues with zwave controller and OutOfMemory after switching to docker and OH 2.5.1
[SOLVED] New entry in Z-Wave Database does not work properly with Z-Wave Binding
[SOLVED] Using JSONPATH inside a rule
[SOLVED] How can i control the gpios of a raspberry pi through google assistant
[SOLVED] How can i control the gpios of a raspberry pi through google assistant
Fritzbox Tr064 Binding error
[SOLVED] GE/Jasco (14288/ZW1002) Wall Outlet - Switch Channel Not Found
HUE and Ikea
Squeez server
Fatek Plc
Motion sensor During the Day and socket timmer Triggered from Light switch
Fatek Plc
ZWave Binding failing
[SOLVED] Design Pattern: Rule Disable: Trouble getting the Thing conditions right
[SOLVED] Rule Sending Command after ZWave Room Thermostate changed SetPoint
SOLVED: Boolean expressionsin for if-statements in rules
TP-Link Kasa lights will not change color via rule
[SOLVED] I followed the doc "Creating a sitemap", but icon is grey, although switch is on
Need rules to get daylight time of today and less/more for yesterday and tomorrow
TP-Link Hs110 / NG-Rule Issue to switch off Power Plug
ZWave binding updates
Errors received for switches after upgrade to OpenHAB 2.5
[SOLVED] iCloudBinding - Openhab 2.5
Xiaomi gateway switch to brightness strange behavior
[SOLVED] [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-misc-restdocs'
[SOLVED] [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-misc-restdocs'
Using groups in Items
Lightcontrol
HS1HT-Z Temperature/Humidity Sensor NaN
Openhabian boot problem on RPi2 Model B V1.1
[BTicino/OpenWebNet] New openHAB2 binding ready for testing
[BTicino/OpenWebNet] New openHAB2 binding ready for testing
Issue after upgrade to latest milestone 2.5
[SOLVED] BME280 Temperature on Sonoff Basic with Tasmota
[SOLVED] No devices found with Vision ZU1401-5 Z-Wave USB dongle
XPATH Transformation - Casting "0" to integer returns null
[SOLVED] Error messages during timer release
Jasco GE 46202, but different manufacturer ID
Openhab and Chromecast: anybody find it useful?
2.5 Milestone 5 Issues
Schlage BE469 not finding thing on inclusion
[SOLVED] Contacts operated by sensors that reset after a minute, visible in habpanel
Creating Zigbee Device Thing
[SOLVED] Total disaster when trying on my own, with the great help of this community I got it running. Thanks
[SOLVED] Single switch individually controlling multiple ligths
MQTT 2 Chained transformations
[SOLVED] Tasmota - Sonoff - SDS011 cannot transform PM2.5
Volume Control Via Slider (Openhab)
[SOLVED] Doesn't run script in rules
Visual studio code error connecting to server Integrated Basic UI
[SOLVED] Trying to set up If Then with Outdoor Temperature
[SOLVED] Command 'string.contains()' not a member of '...items.StringItem'
Rule and << 8... something I do not understand
[SOLVED] My first rule
Integrate Shelly RGBW2 with MQTT in openHab
[SOLVED] Managing Danfos LC13: creating .sitemap
[SOLVED] Need help for off general and sitemap
[SOLVED] Time in mysql incorrect
Wifi LED-Binding cant change colors
Openhab mqtt polling every 10 seconds - why?
How Do I Find Which Element of a Group Triggered an Event?
How to get the Paradox alarm binding
Combine two Radiatior Valves with a Rule
First installation of OpenHab2. Can’t get to dashboard - Windows
Zwave delays
Problem in tutorials: Time of Day Events. "Could not cast NULL to org.eclipse.smarthome.core. "
Openhab/openhab docker fail
Flood/Water Sensors that work
Modbus binding with Sunny Boy SMA inverter
[SOLVED] -Accessing stringbuilder in a loop
[SOLVED] KODI binding not working
[SOLVED] Toggle switch for rule for Glade Plugins
[SOLVED] OH 2.5 M1 to M3 update - encountered issues
[SOLVED] Philips Hue Foh Switches
User habpanel widget for entering IP address
Persistence don't work, can read old data, but don't write new data
org.eclipse.jetty.server.HttpChannel ERROR
Zigbee binding don't find TRADFRI
Help Required with Open Hab Setup
[SOLVED] Arduino based relay controller using Relay8 boards
[SOLVED] Error first installation of openHABian 1.5 in rp4
Expose input sources to Alexa
Bitron Video ZigBee USB Funkstick stops working after a while
ZWave - Not able to switch Warm White/Cold White on ZWA001 (LED Bulb 6: Multi-White)
Unknown zwave device: Fibaro Walli Rollershutter Switch
Aeotec Wallmote Quad rules paper ui
Contact Item Type throwing an error
Need help to define item and rule while using MQTT and NikoHome Control binding
Help in defining main switches for different devices and rooms
CalDav Personal - receiving exception
Cant get espmilighthub to work
Influx and grafana just stopped
Zigbee binding
Raspi + openHAB + Razberry offline
Weatherstation python script make me crazy
[SOLVED] Need to know the correct way of implementing a recurring timer or looping thread in JSR223/Jython
[SOLVED] ExecuteCommandline shell script
KNX Gateway Disconnecting
Please help me understand zwave lock inclusion/exclusion and secure install
OpenHab2 installation on Raspberry P2 Stretch
[SOLVED] Setting a timer (createTimer) using a slider value
Events from WallMote Quad is not registered
Using one time multiple times within a rule
It drives me insane
OH 2.4. Astro event stops firering
[SOLVED] MQTT 2 Binding: Publish action with JSR223 Javascript
Mosquitto MQTT presence notifications from an Asus RT-AC68U Router / AsusWRT firmware
Bathroom fan timer rule
HANK Flood Sensor FLD01 not recognized
[SOLVED] Strange rules behavior (including timers)
[SOLVED] OH does not start after upgrade to 2.5.0 S1560
Switch with expire
Tado items keep changing back to the previous value
OpenHAB Exec Binding explained in detail on 433MHz radio transmitter example
[SOLVED] Foscam and IpCamera: New IP Camera Binding not working in OpenHAB2.4
How do I address individual elements in a 2-Dimensional array [SOLVED]
Help needed: HTTP binding, JSON and basic authentification for CCU825 controller
Rules depending on Astro sun events
Publish to 2 mqtt topics with only an item
[SOLVED] Sum up and multiply item values at startup
Timer - start when an switch turned on before executing the rule
Strange forum and stupid user (me)
New rule engine startup - rule initialisation
Issues with lists and service restart
[SOLVED] DHT22 not reading
[SOLVED] Horizon Media Box binding under OpenHab 2.0
Changing Vizio TV Inputs with Google Assistant via openHAB
[SOLVED] How to create a Timer to switch off a light?
Mysensors binding items error
[SOLVED] Installation on Windows 10
Ecolink PIR-ZWAVE2.5-ECO inclusion
Bticino My Home Server configuration
[SOLVED] Dimmer Rule with exec Binding
Linking COCO items through OpenHab2
Unable to pair with Zigbee Gateway
OpenWeatherMap Forecast not working
openHAB and local control
My Rollershutter is not working
openHAB2, 2.4, MAX! binding, command not send to hardware
Homematic radiator thermostat missing/loosing actuall temperature
How to ask a good question / Help Us Help You
FritzBoxTR064 binding: cannot check presence of device in network
[SOLVED] Calculating windchill
If value in Widget
[SOLVED] My Color Temperature Light does not work
[SOLVED] MQTT 2.x inbound command
Rule is not working
[SOLVED] Newbee: My mapping does not work
[SOLVED] OpenHAB 2.4 Binding homematic ON_TIME
GPSBinding Distance from location not working
No value in Item for Danfoss Popp Thermostat Zwave
Ecobee unable to set desired temperature
[SOLVED] What is the status on the Weather binding?
[SOLVED] MQTT2 setup on OH2
[SOLVED] Bticino Gateway Problem
Migrating MQTT1 items to MQTT2.4 items
Rules with TP-Link HS105 Smart Wi-Fi Plug
[SOLVED] Total timeout 1000 ms elapsed after Update to OH2.4
Pioneer Powerswitch not working
[SOLVED] Zwave Inverted RollerShutter
Hue Ambientlight Sensor
[SOLVED] New MQTT binding 2.4
[SOLVED] Dome motion sensor ALARM_REPORT not processed successfully
Add Items to Homekit
[SOLVED] RRD4J error
[SOLVED] KNX Bindings offline when using text file
NodeMCU based MQTT multi-sensor with OLED display
X10, CM11a, ttyUSB0, Status: OFFLINE - COMMUNICATION_ERROR Serial port /dev/ttyUSB0 is in use by another application (Unknown Linux Application)
[SOLVED] Persistence with InfluxDB not storing data?
Help me - Turn off light after 5 minutes human body go off
Owntracks CloudMQTT Setup Help
[SOLVED] MQTT inbound items and MAP
Zigbee binding
Amazon Echo Control play Amazon Station
Kernel Panic
Rules are not performed after some uptime
Novelan Heatpump Binding doesn't reply useful values for state, extended_state and massflow
[SOLVED] KNX commands dont get send to the KNX BUS
Window shutter contact in Homekit?
Simulate, debug, test rules
New rule engine startup - rule initialisation
KNX Binding, Sitemap: Number Item is not send to bus
[SOLVED] REGEX not working for my after migration to openhab 2
Enigma2 sitemap
[SOLVED] [Google TTS] Chromecast Audio Sink not working
[SOLVED] Confused about HarmonyHub Sitemap and Items
[SOLVED] [Google TTS] Chromecast Audio Sink not working
Mysql Binding, Mysql Persistence - connection is not valid
[SOLVED] Question about how createTimer works
[solved] [max] setting 'set_temp' does not do anything. i can read its value though
Controlling Thermostatic Valve with Android App
[Solved] MQTT - OpenHab2 communication issue
Z-Wave device association MCO Home
HTTP Binding for dimmers and status
Weather Binding UV Index not parsed (ForecastIO)
Trouble triggering off of dimmer
HTTP Binding for dimmers and status
[SOLVED] Create items from php json script
Going crazy with a rule, please help
[SOLVED] Problem with rules if
[MongoDB] Persistence Service cannot connect to MongoDB Atlas (DBaaS)
OH2.3 KNX - Can not write to the bus
[SOLVED] Gettings mismatch input "item" expecting "end" errors in rule
[SOLVED] OpenWebNet binding on OH2 - thermostat heating channel not updating
[Onkyo] Help with advanced troubleshooting
Zwave battery device status
My z-wave dongle acting weird not able to send commands to z-wave devices via OH2
[SOLVED] Parse file and make items
[SOLVED] OH2.3 Mqtt Tasmota setup issues
KNX does not work anymore with my items
KNX does not work anymore with my items
[SOLVED] Channel select with broadlink and mqtt
KNX rule does not work
How can I show in a string and trigger a switch if no no response received from http?
Problem writing data with OH2 + GRAFANA + INFLUXDB in WIN10
Help with timers and sleep in rules
Hue Bindung: identical Bulbs with different results / maybe binding to bridge communication issue
Fkjdsafasödf
Requirements for myOpenhab Cloud connection
[SOLVED] Help understanding rules
[SOLVED] Help understanding rules
Knx in Homekit
restoreOnStartup doesn't transmit restored value to mqtt
Knx binding 2.3 configure KNX IP Gateway
Knx binding 2.3 configure KNX IP Gateway
[SOLVED] A simple rule for turning off power (=heating)
Windows PC remote control (Shutdown, …)
Configuration with Alexa Echo Dot
Help with turning lights on when garage door opens
[SOLVED] Help with a rule
Satel Binding 2.3.0
Reading Data from Solaredge inverters via Modbus TCP
[SOLVED] Rule Error "could not invoke method"
Problem with Harmony Button Mappings
Openhab2 2.1 MQTT Service initialization completed but not starting?
Sonoff TH16 is not sending Temp to openhab
Basics of a Lambda expression
Cron Job Rules not working
Cron Job Rules not working
Rule example: Engine heater based on temperature
Rule example: Engine heater based on temperature
OpenHab2 control Alexa Skill
Astro trigger fires rule more than once per day
Solaredge: problem with readout on sitemap
Trigger a puschbutton of a VMBGPOD (velbus)
[SOLVED] Xiaomi Humidity Sensor Read Values in Rules
Edimax Binding issue
Things with Battery do not react
Weather binding with OpenWeatherMap API
[SOLVED] Looking for help with MQTT and ESP8266 communication
Xiomi (MI) Switch rule - nothing happens
[SOLVED] Sitemap error
[SOLVED] Logview on ubuntu
Zibee Yale YRD216 PBDB
New z-wave device needed and existing device to be renamed
Rule for FOB
IR blaster
GPIO Contacts not updating
Screwed my OpenHab 2.2.0
Transformation throws exception
NOOB - Just stumbling in the Dark - Help with HHTP Switch or Energenie Mi|Home (UK)
executeCommandLine being executed but not responding
Update remote OLED with a mesage using MQTT
Wemo insight state toggling unexpectedly
Items failing to update
[SOLVED] Ultimate guide to debugging rules?
Generic Presence Detection
[SOLVED] Temperature and Humidity from Sonoff is not displaing in basicUI
[SOLVED] ESP8266 publishes four topics but not 5
Rules Not working after
Z-Wave-Bindung: Unsupported Thing - Fibaro CO needs database update
Rules to only fire when its :00 or :30
Strange error when updating an item file
Rule to disable rule - or alternative solution
Eurotronic Spirit Zwave Plus thermostats not being initialized
Simple Sync Rule please
Yale L1 Z-wave Unknown Device
The MUSH-MACHINE: Rule triggering on mqtt values, storing and displaying it
[SOLVED] Can't get my MQTT Binding to work (still connected but it does nothing)
Zwave with Razberry2 Unkown Device
Where to find syntax for createTimer command
IpCamera: New IP Camera Binding
[SOLVED] Minimote Unknown Device
[SOLVED] createTimer help to prevent rule triggering again and again for a period of time
Aeotec Smart Switch 6 change in Power level not triggering Rule
[SOLVED] RaspBee http get request processing
Basic UI / Sitemap printing command besided buttos
Show two separate strings from python script in sitemap
[SOLVED] OH 2.3 - Change in persistence handling for numbers?
[SOLVED] Room Automation using OpenHAB, KNXD and Raspberry Pi 3
[SOLVED] Issue with presence detection in Basic Ui
Design Pattern: Motion Sensor Timer
New User: Avalanche of Errors (Getting Smothered)
[SOLVED] Multiple sub-directories/nesting
Server ERROR 500 in Visual Studio Code
HUSBZB Zigbee setup
[SOLVED] Google Assistant responding to question about garage door
[SOLVED] Integrating openhab and google assistant
[SOLVED] Amazon dash button works with Hue for one set of hue lights, the other not so lucky
Help with rule for temp sensor
How to set up a controlled garage door?
[SOLVED} Arithmetic operations in rules
IHC failes in 2.3 release
KNX1 to KNX2 Migration Steps
Need help to setup MQTT Binding on OH2
Need help to setup MQTT Binding on OH2
Selection item doesn't work the first time
KNX bridge UID issue
Binary math in a openhab2 rule
Linking a string and integer together to create a string for notifications
[Solved] AVM Fritz DECT210 not detected
Modbus openHAB2 binding available for alpha testing
My first working automation - feedback on my rule
Zipato RGBw2.us Color Channel- bulb does not respond
Items with multiple functions or states?
Installed GPIO Binding in OH2 and GPIO pins are not woring
[SOLVED] Problem adapting existing blinds to OpenHab
Can't initialize string variable
[SOLVED] Problem with fibaro motion sensor detection!
[SOLVED] "Failed to start The openHAB 2 Home Automation Bus Solution."
LifX Binding enters race condition of some sort. Causes LifX bulb(s) to flicker
1st time poster, another noob - with a functional design concept question
Openhab2 Nest binding - 2.2.0.SNAPSHOT An Updated 2.0 Binding that works!
Official Google Assistant Integration for openHAB
[SOLVED] Dump first text rule
[SOLVED] Mqtt state espurna
[SOLVED] Mqtt state espurna
How to turn ON/OFF Hue Lights with Xiaomi Switch?
POPP 9402 Smoke alarm triggers burglar item
How to setup a Sonoff 4ch in openHAB
Tradfri Binding: Slow reaction and communication error with gateway
Befehl wird nicht ausgeführt ( exec=">ON:)
[SOLVED] MQTT Help-cant read data to openhab
Http get?
Please Help XML Parsing with XPATH
SNMP binding not updating switch state in sitemap
Ecobee - Hold Temperature Not working for me
JSON Transformation Error
KNX Binding - I got lost
Samsung AC NewGen experience
Delay when setting items in OpenHAB
[SOLVED] Help to create a rule "turn on a lamp when motion is detected but only after sunset until sunrise"
Absolute value of a decimal
OH2 on MacOS Sierra - Restarterrors
Need help with a rule
Aeotec Water Sensor 6 ZW122
Weird crap! with my HVAC and Openhab
[SOLVED] String item not updating from TCP binding
OPENHABIAN RP2 USB KNX issue
Milight Binding Switch White light
LCN binding and Alexa
[SOLVED] Rrdj4 configuration
Zwave Fibaro 212 not posting updates after upgrade
How do you add the hue motion sensor too OH (SOLVED)
[Solved] iCloud Presence Turn on outside light
Having Trouble configuring Items
Get local UV radiation -- prevent sunburn and skin cancer
Is it possible to force a LUX sensor to update?
Network issue with Novelan binding
[solved] InfluxDB persistence not connecting to database
[SOLVED] Problem with temperature
Missing BASIC Channel?
Configuration model 'test.rules' is either empty or cannot be parsed correctly!
No values from ds18b20 in Openhab2
Unknown device - I'm lost!
Rules - An error occurred during the script execution: null
Where is the www root please?
Use Array-Items and one Rule
Openhab2 rules problem. PaperUI rules present in Karaf scheduler, HABmin rules do not import or execute
Z-wave Exception during HTTP PUT request
OH2.2 suddenly logging stopped this morning
digitalSTROM openhab2 Devices won't work
Homematic CCU still initializing - again
My sitemap gets ignored - error in openhab.log
DMX Chaser Crashing out?
Need help with openhab2, KNX & exor ebis panel
HTTP POST binding - not working
Offline showing after registering into openHAB cloud
MySensors Serial Gateway not coming online in OH2
[SOLVED] Do I have to unplug my Z-Stick Gen 5 to include new devices?
RFSniffer, 433MHz receiver RPI and MQTT
NodeMCU MQTT LED Strip Controller Build & Config How-To Videos
Transformation JSONPATH doesn't work
How to configure a contact Item in a Sitemap
Schlage BE469 - Zwave binding with security - missing features
Creating a switch to turn rules on and off
Unifi camera integration
NullPointerException in ZWaveController latest build
Item state update delayed
playSound mit Squeezebox
Need help with tomorrows date
Zigbee Binding Unable to find Bulb
Check, whether sun is set in if statement in a rule
TCP Binding receive problem
Date format Rule doesn't working on OH2
Openhab 2 Lastest Motiondetector logger
Uninstalling Weather Binding uninstalls all others as well
Better way of doing this?
Using Java code in openhab2
Homekit Color item status issue always on / Wifi LED Binding
Startup of OpenHab error in log - Variant (JP) is invalid
JS Transformation in rule does not appear to run
Zwave Aeotec MultiSensor 6 no motion detection and LED with FW 1.13
Unable to perform correct string comparison
OpenHAB 2.5.x crashes while access zwave serial port after update to java 8.0.261
Not always lines under items on sitemap openhab app
Is this a typing issue?
Wibeee circutor - smartmeter installation - xml - home-assistent binding is existing
No audio Sound
False Reports From Lock
Need help with rules

I always use the Preformatted Text </> icon. I’ll paste in code or a log, select it all, and then click the icon. But there is a trick for this and multi-line text… there needs to be a blank line between it and the previous text, or it won’t show up as fenced. So if your using the icon, and things aren’t displaying right in the preview window, put a blank line on top to separate it from the previous text.

2 Likes

Another important feature of code wrapped in a code fence is the elimination of smart quotes. If you are copying and pasting code samples that our outside of a code fence you most likely will pick up smart quotes instead of the expected regular quotes causing errors within OpenHAB.

Code fences are your friends!!

Squid

1 Like

The problem with pasting and then applying the code fences is that the forum will confer all of your quotes and double quotes to smart quotes which will not work in Rules.

Based on my experiments awhile back, code fences only if you lay down the fences before pasting in the code.

Hmmm… this must be OS or browser specific. In looking back at some of my posts, none of the quotes were converted to smart quotes. And I’ve only ever done a paste, select, and </>. I’m using Win10 and Chrome.

1 Like

Hi Rich,

Maybe some screen shot with the icons would help others:
For example:

Screenshot-2018-3-16%20How%20to%20use%20code%20fences

I would be happy to make the others, where should I post them?

Good idea. I’ve made the original posting into a wiki. You can add the screenshots and makes any other changes now.

Done, thank you

I found a bug! :bug:

On MacOS Mojave you can’t see:

*.rules code fences icon
*.sitemap code fences icon
JavaScript code fences icon
generic code fences icon

1 Like

Same on Ubuntu 2 latest Firefox updates

1 Like

image

(or this was done on purpose by the forum Admins not to confuse users and make it easier for them to use the *.items code fences? … it’s a mystery ! :smiley:)

Hmm. I never even realized there were icons. LOL I always go old school and just manually type the beginning and ending ```

1 Like

Enclose your configs in:

<code>
This is my config
</code>

Note: Additional markdown for whoever is interested: https://commonmark.org/help/

The above will become:

This is my config

1 Like

Maybe that custom plugin does not work anymore …

If you check using F12 in Chrome (dev tools) you will see that some of the svg icons are missing… (I think) so the plugin may need some maintenance. good catch @sihui

We need @ThomDietrich back ! :smiley:

updated first wiki post to show immediately how to use the generic code fences

edit: added the <code> html flavor also on the table that shows up on the first page

1 Like

I need your advice on how to properly include long log in a post.

I have used the “Hide details” option of this editor to avoid having page long post but then the code fence does not seem to have effect on the hidden text.

I have seen some topics using fixed size blocks in which your can scroll horizontally and vertically the code/text but I have no idea how to include such block in this editor

Highlight your text and use the grafik button. Make sure you have an empty line before and after your code:

Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code Here goes your code

Next line …

Thanks but my log has 100 lines and I would like to have a smaller size block (let say 20 lines) in which the reader could scroll vertically through.

Will that happen automatically with the </> feature?

Yes, but it depends on the overall length of your code. You also can combine them with the “Hide details” function: first use the hide details, then the preformatted text:

Summary
2019-11-10 22:29:54.651 [ome.event.ItemCommandEvent] - Item 'ShutterTempDetected_Proxy' received command OFF
2019-11-10 22:29:57.017 [vent.ItemStateChangedEvent] - Barometer changed from 1015.125 to 1015.1272019-11-10 22:29:50.595 [vent.ItemStateChangedEvent] - ESP8266_Five_Lux_Update changed from 0 lx (So, 22:28) to 0 lx (So, 22:29)
2019-11-10 22:29:50.598 [ome.event.ItemCommandEvent] - Item 'ShutterLuxWestDetected_Proxy' received command OFF
2019-11-10 22:29:54.646 [vent.ItemStateChangedEvent] - TemperatureShadow_Update changed from 4,0 °C (So, 22:28) to 4,0 °C (So, 22:29)
2019-11-10 22:29:54.650 [vent.ItemStateChangedEvent] - Shading_tempDiff_Proxy_Update changed from -0,2 °C (So, 22:28) to -0,2 °C (So, 22:29)
2019-11-10 22:29:54.651 [ome.event.ItemCommandEvent] - Item 'ShutterTempDetected_Proxy' received command OFF
2019-11-10 22:29:57.017 [vent.ItemStateChangedEvent] - Barometer changed from 1015.125 to 1015.1272019-11-10 22:29:50.595 [vent.ItemStateChangedEvent] - ESP8266_Five_Lux_Update changed from 0 lx (So, 22:28) to 0 lx (So, 22:29)
2019-11-10 22:29:50.598 [ome.event.ItemCommandEvent] - Item 'ShutterLuxWestDetected_Proxy' received command OFF
2019-11-10 22:29:54.646 [vent.ItemStateChangedEvent] - TemperatureShadow_Update changed from 4,0 °C (So, 22:28) to 4,0 °C (So, 22:29)
2019-11-10 22:29:54.650 [vent.ItemStateChangedEvent] - Shading_tempDiff_Proxy_Update changed from -0,2 °C (So, 22:28) to -0,2 °C (So, 22:29)
2019-11-10 22:29:54.651 [ome.event.ItemCommandEvent] - Item 'ShutterTempDetected_Proxy' received command OFF
2019-11-10 22:29:57.017 [vent.ItemStateChangedEvent] - Barometer changed from 1015.125 to 1015.1272019-11-10 22:29:50.595 [vent.ItemStateChangedEvent] - ESP8266_Five_Lux_Update changed from 0 lx (So, 22:28) to 0 lx (So, 22:29)
2019-11-10 22:29:50.598 [ome.event.ItemCommandEvent] - Item 'ShutterLuxWestDetected_Proxy' received command OFF
2019-11-10 22:29:54.646 [vent.ItemStateChangedEvent] - TemperatureShadow_Update changed from 4,0 °C (So, 22:28) to 4,0 °C (So, 22:29)
2019-11-10 22:29:54.650 [vent.ItemStateChangedEvent] - Shading_tempDiff_Proxy_Update changed from -0,2 °C (So, 22:28) to -0,2 °C (So, 22:29)
2019-11-10 22:29:54.651 [ome.event.ItemCommandEvent] - Item 'ShutterTempDetected_Proxy' received command OFF
2019-11-10 22:29:57.017 [vent.ItemStateChangedEvent] - Barometer changed from 1015.125 to 1015.1272019-11-10 22:29:50.595 [vent.ItemStateChangedEvent] - ESP8266_Five_Lux_Update changed from 0 lx (So, 22:28) to 0 lx (So, 22:29)
2019-11-10 22:29:50.598 [ome.event.ItemCommandEvent] - Item 'ShutterLuxWestDetected_Proxy' received command OFF
2019-11-10 22:29:54.646 [vent.ItemStateChangedEvent] - TemperatureShadow_Update changed from 4,0 °C (So, 22:28) to 4,0 °C (So, 22:29)
2019-11-10 22:29:54.650 [vent.ItemStateChangedEvent] - Shading_tempDiff_Proxy_Update changed from -0,2 °C (So, 22:28) to -0,2 °C (So, 22:29)
2019-11-10 22:29:54.651 [ome.event.ItemCommandEvent] - Item 'ShutterTempDetected_Proxy' received command OFF
2019-11-10 22:29:57.017 [vent.ItemStateChangedEvent] - Barometer changed from 1015.125 to 1015.1272019-11-10 22:29:50.595 [vent.ItemStateChangedEvent] - ESP8266_Five_Lux_Update changed from 0 lx (So, 22:28) to 0 lx (So, 22:29)
2019-11-10 22:29:50.598 [ome.event.ItemCommandEvent] - Item 'ShutterLuxWestDetected_Proxy' received command OFF
2019-11-10 22:29:54.646 [vent.ItemStateChangedEvent] - TemperatureShadow_Update changed from 4,0 °C (So, 22:28) to 4,0 °C (So, 22:29)
2019-11-10 22:29:54.650 [vent.ItemStateChangedEvent] - Shading_tempDiff_Proxy_Update changed from -0,2 °C (So, 22:28) to -0,2 °C (So, 22:29)
2019-11-10 22:29:54.651 [ome.event.ItemCommandEvent] - Item 'ShutterTempDetected_Proxy' received command OFF
2019-11-10 22:29:57.017 [vent.ItemStateChangedEvent] - Barometer changed from 1015.125 to 1015.1272019-11-10 22:29:50.595 [vent.ItemStateChangedEvent] - ESP8266_Five_Lux_Update changed from 0 lx (So, 22:28) to 0 lx (So, 22:29)
2019-11-10 22:29:50.598 [ome.event.ItemCommandEvent] - Item 'ShutterLuxWestDetected_Proxy' received command OFF
2019-11-10 22:29:54.646 [vent.ItemStateChangedEvent] - TemperatureShadow_Update changed from 4,0 °C (So, 22:28) to 4,0 °C (So, 22:29)
2019-11-10 22:29:54.650 [vent.ItemStateChangedEvent] - Shading_tempDiff_Proxy_Update changed from -0,2 °C (So, 22:28) to -0,2 °C (So, 22:29)
2019-11-10 22:29:54.651 [ome.event.ItemCommandEvent] - Item 'ShutterTempDetected_Proxy' received command OFF
2019-11-10 22:29:57.017 [vent.ItemStateChangedEvent] - Barometer changed from 1015.125 to 1015.1272019-11-10 22:29:50.595 [vent.ItemStateChangedEvent] - ESP8266_Five_Lux_Update changed from 0 lx (So, 22:28) to 0 lx (So, 22:29)
2019-11-10 22:29:50.598 [ome.event.ItemCommandEvent] - Item 'ShutterLuxWestDetected_Proxy' received command OFF
2019-11-10 22:29:54.646 [vent.ItemStateChangedEvent] - TemperatureShadow_Update changed from 4,0 °C (So, 22:28) to 4,0 °C (So, 22:29)
2019-11-10 22:29:54.650 [vent.ItemStateChangedEvent] - Shading_tempDiff_Proxy_Update changed from -0,2 °C (So, 22:28) to -0,2 °C (So, 22:29)
2019-11-10 22:29:54.651 [ome.event.ItemCommandEvent] - Item 'ShutterTempDetected_Proxy' received command OFF
2019-11-10 22:29:57.017 [vent.ItemStateChangedEvent] - Barometer changed from 1015.125 to 1015.1272019-11-10 22:29:50.595 [vent.ItemStateChangedEvent] - ESP8266_Five_Lux_Update changed from 0 lx (So, 22:28) to 0 lx (So, 22:29)
2019-11-10 22:29:50.598 [ome.event.ItemCommandEvent] - Item 'ShutterLuxWestDetected_Proxy' received command OFF
2019-11-10 22:29:54.646 [vent.ItemStateChangedEvent] - TemperatureShadow_Update changed from 4,0 °C (So, 22:28) to 4,0 °C (So, 22:29)
2019-11-10 22:29:54.650 [vent.ItemStateChangedEvent] - Shading_tempDiff_Proxy_Update changed from -0,2 °C (So, 22:28) to -0,2 °C (So, 22:29)
2019-11-10 22:29:54.651 [ome.event.ItemCommandEvent] - Item 'ShutterTempDetected_Proxy' received command OFF
2019-11-10 22:29:57.017 [vent.ItemStateChangedEvent] - Barometer changed from 1015.125 to 1015.1272019-11-10 22:29:50.595 [vent.ItemStateChangedEvent] - ESP8266_Five_Lux_Update changed from 0 lx (So, 22:28) to 0 lx (So, 22:29)
2019-11-10 22:29:50.598 [ome.event.ItemCommandEvent] - Item 'ShutterLuxWestDetected_Proxy' received command OFF
2019-11-10 22:29:54.646 [vent.ItemStateChangedEvent] - TemperatureShadow_Update changed from 4,0 °C (So, 22:28) to 4,0 °C (So, 22:29)
2019-11-10 22:29:54.650 [vent.ItemStateChangedEvent] - Shading_tempDiff_Proxy_Update changed from -0,2 °C (So, 22:28) to -0,2 °C (So, 22:29)
2019-11-10 22:29:54.651 [ome.event.ItemCommandEvent] - Item 'ShutterTempDetected_Proxy' received command OFF
2019-11-10 22:29:57.017 [vent.ItemStateChangedEvent] - Barometer changed from 1015.125 to 1015.1272019-11-10 22:29:50.595 [vent.ItemStateChangedEvent] - ESP8266_Five_Lux_Update changed from 0 lx (So, 22:28) to 0 lx (So, 22:29)
2019-11-10 22:29:50.598 [ome.event.ItemCommandEvent] - Item 'ShutterLuxWestDetected_Proxy' received command OFF
2019-11-10 22:29:54.646 [vent.ItemStateChangedEvent] - TemperatureShadow_Update changed from 4,0 °C (So, 22:28) to 4,0 °C (So, 22:29)
2019-11-10 22:29:54.650 [vent.ItemStateChangedEvent] - Shading_tempDiff_Proxy_Update changed from -0,2 °C (So, 22:28) to -0,2 °C (So, 22:29)
2019-11-10 22:29:54.651 [ome.event.ItemCommandEvent] - Item 'ShutterTempDetected_Proxy' received command OFF
2019-11-10 22:29:57.017 [vent.ItemStateChangedEvent] - Barometer changed from 1015.125 to 1015.1272019-11-10 22:29:50.595 [vent.ItemStateChangedEvent] - ESP8266_Five_Lux_Update changed from 0 lx (So, 22:28) to 0 lx (So, 22:29)
2019-11-10 22:29:50.598 [ome.event.ItemCommandEvent] - Item 'ShutterLuxWestDetected_Proxy' received command OFF
2019-11-10 22:29:54.646 [vent.ItemStateChangedEvent] - TemperatureShadow_Update changed from 4,0 °C (So, 22:28) to 4,0 °C (So, 22:29)
2019-11-10 22:29:54.650 [vent.ItemStateChangedEvent] - Shading_tempDiff_Proxy_Update changed from -0,2 °C (So, 22:28) to -0,2 °C (So, 22:29)
2019-11-10 22:29:54.651 [ome.event.ItemCommandEvent] - Item 'ShutterTempDetected_Proxy' received command OFF
2019-11-10 22:29:57.017 [vent.ItemStateChangedEvent] - Barometer changed from 1015.125 to 1015.127
1 Like