2010年6月23日水曜日

Bloggerでソースコードをカラー表示する

これからJavaやXMLファイルを貼り付けることから、以下のページを参考にして
ソースをカラー表示させる「Syntax Highlighter」をBloggerのガジェットに追加した。
クリボウの Blogger Tips
ASCII.JP


備忘録
ソースの前後にpreタグを追加する
preの属性nameにcode、 classにjavaやxmlを指定することでカラー表示がされる。
  1. <!--xml version="1.0" encoding="utf-8"?-->  
  2. <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" <brbr=""> xmlns:cc="http://schemas.android.com/apk/res/com.google.sites.site.sakaneya"  
  3.     android:orientation="vertical"  
  4.     android:id="@+id/MainPanel"  
  5.     android:layout_width="fill_parent"  android:layout_height="fill_parent"  
  6.     android:background="@color/background"  
  7.     android:configChanges="orientation|keyboardHidden"  
  8.     >  
  9.   
  10.   <com.google.sites.site.sakaneya.widget.timerwidget  
  11.        android:id="@+id/timer0"  
  12.        android:layout_width="fill_parent"  
  13.        android:layout_height="wrap_content"  
  14.        cc:title="@string/Title_Hotcake1"  
  15.        cc:CounterTextSize"72.0"  
  16.        cc:MSTextSize"20.0"  
  17.    />  
  18. </com.google.sites.site.sakaneya.widget.timerwidget  
  19. </linearlayout>  

0 件のコメント:

コメントを投稿