趣味のためのMacに関するサイト > AppleScript > ソースコード > ブログ本文中にソースコードをきれいに書くには2
ソースコード

ブログ本文中にソースコードをきれいに書くには2

02/11-2 ブログ本文中にソースコードをきれいに書くには2

[From 01/04 ブログ本文中に構文(ソースコード)をきれいに書くには | 梶原工務店社長ブログ1]

でブログ本文中にpreタグを使わないでAppleScriptの構文をきれいに書く

方法を探していました。

 

[From ソースコードを手軽に表示させるWordPressプラグイン「SyntaxHighlighter Evolved」 | ウェブデザイナー的ホームページ制作最適化]

上記を参考にして、きれいに表示させられるのではないかと思ったところ、

言語の中にAppleScriptがないので探したところ

下記のものをみつけました。

AppleScript syntax highlightingから引用しました。

Setup
To add AppleScript syntax highlighting to your own site or blog, do the following:
Download SyntaxHighlighter, and follow the setup instructions.

  1. Download AppleScript brush, and upload it to your SyntaxHighlighter scripts directory.
  2. Download AppleScript theme, and upload it to your SyntaxHighlighter styles directory.
  3. Download background image, and upload it to your SyntaxHighlighter styles directory.
  4. Include the brush like so:

Usage
To have SyntaxHighlighter parse a block of AppleScript, wrap the code in pre tags like so:

 

brush: applescript; tells SyntaxHighlighter to use the AppleScript brush for the text within the pre tag. class-name: applescript; tells SyntaxHighlighter to add the class name “applescript” to the container div that is inserted into the page. (Hopefully I’m able to convince Alex that the brush name should be added as a class name automatically, which would remove the need to include class-name: applescript; each time.)
Note that including ruler: true; will have no effect. Since AppleScript is displayed in a variable-width font, the ruler serves no purpose. The ruler is still inserted into the page (unless ruler: false; is included), but is hidden by the style sheet.[From AppleScript syntax highlighting]

説明の通りやってみても動かないんですね。

もう少しテストする必要があります。

ecto + WordPressではブログ本文中に書いたコードが消えてしまいますので

こちらを使う必要があります。

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

ページトップに戻る↑                           ページ一番下へ↓

Mac

About 1q3

ツールとしてのMacについてのメリットデメリットなどの事について書いています。

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です