Ben
(Ben Edwards)
May 30, 2014, 5:18pm
1
Just a quick note on showing code in the new forums. You don’t need to use CODE tags. Simply copy in your syntax, highlight it, and and click the little button between quote and upload in the formatting menu.
Also if you come across an old post (of your own) and want to modify it to look nice again, you can remove the…
<pre><code>
and
</pre></code>
From around the block of code and then highlight the code and change it as stated above.
Enjoy.
egid
(Eric)
May 30, 2014, 9:23pm
2
Also, Discourse handles Github Flavored Markdown . You can also enter a code block using 4 backticks, and specify a language:
```js
console.log("foo");
```
will output:
console.log("foo");
…for example. It seems to work with Groovy.
1 Like
Ben
(Ben Edwards)
May 30, 2014, 9:28pm
3
Cool! I also will point out that I love how it brings in github links:
/**
* Arduino + 8-way relay board Device Type for SmartThings
*
* Author: badgermanus@gmail.com
* Code: https://github.com/jwsf/device-type.arduino-8-way-relay
*
* Copyright (C) 2014 Jonathan Wilson <badgermanus@gmail.com>
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following
* conditions: The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
This file has been truncated. show original
1 Like