filmov
tv
How to Display Code as Code in a Browser

Показать описание
How do you format code to look like code in browsers? How to get monospacing, styling, and syntax highlight to display on a website in any language. I'll show you how in this video and include steps in the description below.
Komodo is one of the best Editors/IDE's for Ruby programming. If you already have an editor, I recommend trying out Komodo. I've tried all the others and I still came back to Komodo.
This is important for when you're sharing code on your own blog or website. You need to be able to share your sample code while still allowing the using to highlight the text.
Here's the code:
Put this script (with script tags) inside your head tags:
Make sure to include the opening and closing script src= tags like I show in the video. (YouTube doesn't allow me to include brackets in this description field.)
Wrap your code in this(Don't forget the brackets):
pre class="prettyprint"
Here's the standard prettify script skin names:
default, desert, sunburst, sons-of-obsidian, doxy
See what each skin/theme looks like here:
Prettify Github page:
Prettify Getting Starting page:
Bonus video: Carlos Garcia talk at DevPoint Labs about why he loves Ruby:
Komodo is one of the best Editors/IDE's for Ruby programming. If you already have an editor, I recommend trying out Komodo. I've tried all the others and I still came back to Komodo.
This is important for when you're sharing code on your own blog or website. You need to be able to share your sample code while still allowing the using to highlight the text.
Here's the code:
Put this script (with script tags) inside your head tags:
Make sure to include the opening and closing script src= tags like I show in the video. (YouTube doesn't allow me to include brackets in this description field.)
Wrap your code in this(Don't forget the brackets):
pre class="prettyprint"
Here's the standard prettify script skin names:
default, desert, sunburst, sons-of-obsidian, doxy
See what each skin/theme looks like here:
Prettify Github page:
Prettify Getting Starting page:
Bonus video: Carlos Garcia talk at DevPoint Labs about why he loves Ruby:
Комментарии