2014年12月29日月曜日
2014年12月28日日曜日
ブログにソースコードを張る方法
技術系ブログを作っていくので、
まずはソースコードをブログに貼る方法から調べてく
手順
- 以下のGitHubのサービスの一つであるGistを利用する
URL:https://gist.github.com/ - 普通にコードを書いて、右下にある[Create select Gist]を押下
- 画面繊維した後の[Embed]の右の文字列をコピペして貼付けする
以上!
出力結果
C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void main() { | |
printf("hello/n"); | |
} |
java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Hello { | |
// main 文 | |
public static void main(String[] args) { | |
System.out.println("Hello"); | |
} | |
} |
感想
すごく簡単にできました!
プログラム言語ごとにカラーが変わる模様
プログラム言語の指定をしていないのにすごい!
登録:
投稿 (Atom)