Monday, May 27, 2013

Insert code into your Blogger posts

Programmers know that blogger doesn't support code insertion (usefull if you need to demonstrate how to program something by copy/pasting code samples). Thus, you need to swicth  Blogger's editor to HTML and paste HTMLized text.

The nicest solution I found to format your code to HTML is to use this online code formatter : http://hilite.me/

So, let's show an example:


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
         http://maven.apache.org/maven-v4_0_0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.horstmann.violet</groupId>
 <artifactId>parent</artifactId>
 <name>Violet UML Editor Parent Maven Project</name>
 <version>1.0.0</version>
 <packaging>pom</packaging>
 <modules>
     <module>violet-framework</module>
     <module>violetplugin-activitydiagram</module>
     <module>violetplugin-classdiagram</module>
     <module>violetplugin-objectdiagram</module>
     <module>violetplugin-sequencediagram</module>
     <module>violetplugin-statediagram</module>
     <module>violetplugin-usecasediagram</module>
     <module>violetproduct-swing</module>
     <module>violetdistrib-rpm</module>
 </modules>
 <properties>
     <applicationVersion>2.0.0-SNAPSHOT</applicationVersion>
   </properties>
 <build>
  <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.gif</include>
                    <include>**/*.jpg</include>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>
  <pluginManagement>
         <plugins>
             <plugin>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <version>2.0.2</version>
                 <configuration>
                     <source>1.6</source>
                     <target>1.6</target>
                 </configuration>
             </plugin>
         </plugins>
  </pluginManagement>
 </build>


 <distributionManagement>
  <repository>
   <id>web.sourceforge.net</id>
   <name>Violet's Maven Repository</name>
   <url>
                sftp://web.sourceforge.net/home/groups/v/vi/violet/htdocs/maven2/repo
            </url>
  </repository>
 </distributionManagement>
 <repositories>
  <repository>
   <id>violet.repo</id>
   <name>Violet's Maven repository (public access)</name>
   <url>http://violet.sourceforge.net/maven2/repo/
            </url>
  </repository>
 </repositories>
</project>

So nice!

21 comments:

Volodymyr Levytskyi said...

Hello!

This helped me out! Just after I switched to HTML editor when posting it began to work!
Look nice!
Thank you!

Volodymyr Levytskyi said...

Do you know what is even cooler.

I can myself easily remove border, change padding,margin,line-height, whatever!

B13 Technology said...

Really amazing blog you have it is very informative. Really I learn something new from you. Thanks for sharing.

Press Release Writing Service said...

I am delighted to see that people are in fact writing about this subject in such a elegant way, presenting us all diverse parts to it. You’re a fine blogger.

ARKA Softwares & Outsourcing said...

Thanku for visit us:

ARKA Softwares & Outsourcing is an IT Company focusing on software & Web development and providing offshore outsourcing solutions to enterprises worldwide.

website development company in india

Allan said...
This comment has been removed by the author.
Allan said...

The developers provide solutions independent of the operating system. Their templates and guidelines are applicable universally. It is the next level in Mobile App Development in Dwarka that an infrastructure is established at broad level with the aid of software environment that can be utilized to make apps for any operating system such as Android or iOS.

Rafi Saleem said...

thanks its work

Purob said...

Helpfull For me. I have used in my site. You can visit my site to see this and get Exclusive Skill Test Answers of oDesk, Elance & Freelancer.

dinesh kumar said...

I would like to say this is an excellent site that I have ever come across. Very informative. Please write more so that we can get more details.
Hosted Navision Pris

Yogesh Patil said...

Thanks. This is something i was looking for my blog.

Mahendhar E said...

Thanks

live casino; casino online; live casino online; casino indonesia said...

Thank you for another fantastic posting. Where else could anyone get that kind of information in such a perfect way of writing? I have a speech next week, and I was looking for more info ;)

taruhan bola; judi bola; agen bola; sbobet; judi online; bandar bola sbobet online; judi online; agen bola said...

Continue writing like this, very informative content, nice way to write, a real pleasur to read you !

dewapoker; poker online; game poker; poker indonesia; poker online indonesia said...

Whoah this weblog is great i love studying your posts. Keep up the great paintings! You realize, lots of persons are hunting round for this information, you can help them greatly.

game poker online said...

Great post ~

Hikari Azuma Asian Big Tits Hot Photos said...

Thank you guys ~

niazi said...

This blog awesome and i learn a lot about programming from here.The best thing about this blog is that you doing from beginning to experts level.

Love from

niaziakmal khan said...

Programming is combination of intelligent and creative work. Programmers can do anything with code. The entire Programming tutorials that you mention here on this blog are awesome. Beginners Heap also provides latest tutorials of Programming from beginning to advance level. Be with us to learn programming in new and creative way.

simashree said...

Thanks for the great information in your blog Selenium Training in Chennai

Java Certification said...

Hi, your blog really nice, keep it up! I’ll go ahead and bookmark your website to come back later.
Regards,
Java Training in Hyderabad
Java online Training in Hyderabad
Java Training in India
Java online Training in India