Code
Basics
[[code]] is used to display the code of a wiki page or of a programmiing language.
[[code type="php"]] allows you to highlight your PHP code. Wikidot uses PEAR::Text_Highlighter.
Current supported languages are Cpp, CSS, diff, HTML, Java, JavaScript, Perl, PHP, Python, Ruby, SQL, XML.
Tip
Enclose your block of html code between [!-- and --] before iframing it.1
Hello everyone,
Currently, I`m learning Java and would like to ask you about the most productive java online courses. I heard and read about CodingBat, Codecademy, and Code.org. For example the cons of Codingbat is no guides for getting started. But I`m not sure of what is the best way to start?
I wanted to put a bookmarklet1 inside a Javascript code block but the text does not wrap. I tried with and without spaces in the code. Any idea ?
Code type="JavaScript"
With spaces
Without spaces
Div
With spaces
javascript:location.href='http://twitter.com/home?status=' +encodeURIComponent(document.title) +'+' +encodeURIComponent(location.href)
Without spaces
javascript:location.href='http://twitter.com/home?status='+encodeURIComponent(document.title)+'+'+encodeURIComponent(location.href)
EDIT: I see that it works perfectly here with Rob's CSS customisation.
My problem comes with the orange theme from the Irongian serie.
gerdami - Visit Handbook en Français - Rate this howto:import-simple-excel-tables-into-wikidot up!
Hmmm… I don't think it is working correctly. If it is indeed a one line bit of code, it should not wrap inside a code block. You should get a horizontal scroll bar if the line is longer than the width of the code block container.
In your "Without spaces" code block example example, I get horizontal scroll bars if I make my browser window narrow, but the code is still displayed on 2 lines. Are you sure you don't have a hard line break in there? [edit: I see you don't. This is very strange! The code should display on a single line with horizontal a scroll bar.]
This bit of css sets the scroll bars to appear if they are needed.
Can you point us to your other site so we can look?
-Ed
Community Admin
Is this what you were trying to achieve?
javascript:location.href='http://twitter.com/home?status='+encodeURIComponent(document.title)+'+'+encodeURIComponent(location.href)
In which case add word-wrap:break-word; to your div:
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
.. and for wrapping things inside normal Wikidot codeblocks add this to your CSS:
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Thanks !
EDIT: I couldn't find the solution at w3schools.com and elsewhere but now I googled "word-wrap:break-word;" and found this article on word-wrap at css3.info.
References at W3.org
gerdami - Visit Handbook en Français - Rate this howto:import-simple-excel-tables-into-wikidot up!
@ed: you are right, the "pre { white-space: pre-wrap; }" is not enough for IE7 to display the code wrapped properly.
gerdami - Visit Handbook en Français - Rate this howto:import-simple-excel-tables-into-wikidot up!
Yes IE 7 can be a right pain, but this should work:
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
I checked. It works now on my legacy but mandatory IE7@work.
Thanks again, Rob.
gerdami - Visit Handbook en Français - Rate this howto:import-simple-excel-tables-into-wikidot up!