Using the Code Capsule
Today, we added the code capsule to the HubPages hubtool. This will make it easier for technical people to use code samples as part of their hub.
The code capsule supports a large number of formats including PHP, HTML, XML, and SQL.
Code can be presented in normal size or small and you can decide whether or not to include line numbers.
Below is a Hello World code sample from Java that includes line numbers.
Java hello world example
package hello; public class HelloWorld { public static void(String[] arg) { System.out.println("Hello, World!"); } }
Of course, if you prefer not to use line numbers, then you don't have to use them.
Below is a PHP version of the same code that does not use line numbers.
PHP hello world example
<?php echo "Hello, World!"; ?>
I hope that you enjoy the code capsule. Please feel free to post your comments and let me know any additional features that you would like to see.