how can i add source code in my instructable(one that appear in box on some instructables)?

i know that this can be done by source button but the main problem is that despite being a pro member their is no source button on my editor.so is their any check box or something in the account settings that must be checked in order to use rich editor

sort by: active | newest | oldest
bwrussell1 year ago

This is where the source code button is in the new editor (See image below).
The text box I tend to use is:

<textarea style="width: 600px; height: 300px;" rows="20" readonly="readonly" name="code" cols="75">Enter Code Here</textarea>

You may need to tweak the sizes as necessary.

image embbed.png
pber bwrussell1 year ago

Thanks big help with that.

Very very cool, Thank you bwrussell :)


Raitis1 year ago

The last time I had to publish code in an 'ible was for the heart lamp and while initially tricky, it eventually turned out fine. See it here.

My solution was to use this for the text box:
<p style="width: 640.0px;height: 360.0px;line-height: 1.0em;overflow: scroll;padding: 5.0px;"><font size="2">

Hope it helps. Although as I understand you have an issue entering the html editing mode as such? If so I have no idea why is that, sorry.

iceng Raitis1 year ago

That's a knockout ible you have there, and that scrolling text box is really neat.

Raitis iceng1 year ago

Thanks, it's really just about the two lines of code I provided here which made that box for me. (:

iceng1 year ago

Convert the code to a jpeg or bmp or other format picture if you don't do PDFiles....

Raitis iceng1 year ago

Code in a picture seems like a bad idea since people aren't able to copy it. I'd say just post it in github and provide external link if nothing else works.

Fair enough, both ways work to some extend but it nothing but a poor (very poor) workaround.
A good forum or site like this simply needs a build in function for adding any form of text without the editor messing with it.
The editing options so far are just sub standard for any type of forum :(

Was wondering the same a few times, more to add some HTLM or similar so it can be seen and used by others.
Seems there is no way to add any form of code without it either being converted into Instructable text or being converted into links or similar.
Especially for the Arduino guys it would be helpful to have at least a scrollable text box that it unaffected by the editor functions.

They broke the system....