2013년 7월 18일 목요일

블로그에 하이라이트 기능 넣기

델파이 관련 자료를 많이 다루다 보니 소스 코드가 많은데 보기에 별로여서 보기 좋게 꾸미려고 구굴링해보았더니 있더군요. 해서 따라 해보았습니다.

Adding Syntax Highlighting to Blogger 를 참조하세요. 

막상 따라해보니 이해가 잘 안되는 곳도 있더군요.

먼저

1. Go to http://syntaxhighlighter.googlecode.com/svn/trunk/Styles/SyntaxHighlighter.css, then perform a "select all" and "copy". The css information is now in the clipboard.

링크 따라가서 복사 한다음
[템플릿  > 사용중인 디자인 > HTML 편집] 한다음

2. Paste the css information at the end of the css section of your blogger html template (i.e., after <b:skin><!--[CDATA[/* and before ]]--></b:skin>).

]] 껏쇠 바로 앞부분에 넣으라는 이야기고..

3. [Updated March 25, 2009 to include closing script tags] Before the </head> tag, paste the following:

부분 코드 박스 위쪽에 있는  [View plain / Copy to Clipboard / Print / ?] 에서 Copy to Clipboard 를 선택하여 복사 한다음 </head> 바로 앞부분에 붙여 넣고

4. [Updated to add final /script] Before the </body> tag, insert the following:
역시 Copy to Clipboard 를 선택하여 복사 한다음  </body> 바로 앞에 붙여 넣습니다.

코드 작성 할때
<pre name="code" class="delphi">
...Your html-escaped code goes here...
</pre>
이렇게 하면 됩니다.

(4) 에서 아래와 같이 코드를 수정하면 Copy To Clipboard 가 활성화 됩니다.

<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.ClipboardSwf = '/flash/clipboard.swf'; 
dp.SyntaxHighlighter.HighlightAll('code');
</script>

** 복사하여 붙여 넣기 하면 ' 문자가 바뀌여 들어 가더군요.

델파이의 부활(Antigravity와의 만남)?

 델파이 프로그램을 사용하여 개인적으로 필요한 프로그램을 생성해 왔는데, 얼마전부터 파이썬으로 옮겨갔다.  그런데 Google 의 Antigravity를 만나고 나서 델파이에 대한 미련을 버리지 못해  제미나이가 Delphi이에 대한 학습도 엄청 했을...