Hatena Markdown

Markdown記法 サンプル集

Markdown記法 サンプル集

見出し

1個から6個シャープで見出しを記述する。

記述例

~~~markdown

見出し1

見出し2

見出し3

見出し4

見出し5
見出し6

~~~

表示例

見出し1

見出し2

見出し3

見出し4

見出し5
見出し6

箇条書きリスト

ハイフン、プラス、アスタリスクのいずれかで箇条書きリストを記述可能。

記述例

markdown - リスト1 - ネスト リスト1_1 - ネスト リスト1_1_1 - ネスト リスト1_1_2 - ネスト リスト1_2 - リスト2 - リスト3

表示例

  • リスト1
    • ネスト リスト1_1
      • ネスト リスト1_1_1
      • ネスト リスト1_1_2
    • ネスト リスト1_2
  • リスト2
  • リスト3

番号付きリスト

記述例

markdown 1. 番号付きリスト1 1. 番号付きリスト1_1 2. 番号付きリスト1_2 1. 番号付きリスト2 1. 番号付きリスト3

表示例

  1. 番号付きリスト1
    1. 番号付きリスト1_1
    2. 番号付きリスト1_2
  2. 番号付きリスト2
  3. 番号付きリスト3

引用

~~~markdown

お世話になります。xxxです。

ご連絡いただいた、バグの件ですが、仕様です。 ~~~

表示例

お世話になります。xxxです。

ご連絡いただいた、バグの件ですが、仕様です。

二重引用

記述例

~~~markdown

お世話になります。xxxです。

ご連絡いただいた、バグの件ですが、仕様です。

お世話になります。 yyyです。

あの新機能バグってるっすね ~~~

表示例

お世話になります。xxxです。

ご連絡いただいた、バグの件ですが、仕様です。

お世話になります。 yyyです。

あの新機能バグってるっすね

pre記法(スペース4 or タブ)

半角スペース4個もしくはタブで、コードブロックをpre表示できます

記述例

~~~markdown # Tab class Hoge def hoge print 'hoge' end end


# Space
class Hoge
  def hoge
    print 'hoge'
  end
end

~~~

表示例

class Hoge
  def hoge
    print 'hoge'
  end
end

class Hoge
  def hoge
    print 'hoge'
  end
end

code記法

バッククォートで文字列を囲むことでコードの一部を表示可能です。

記述例

markdown インストールコマンドは gem install hoge です

表示例

インストールコマンドは gem install hoge です

強調:斜体

アスタリスクもしくはアンダースコア1個で文字列を囲むことで太字にします。

記述例

markdown normal italic normal normal italic normal

表示例

normal italic normal normal italic normal

強調:太字

アスタリスクもしくはアンダースコア2個で文字列を囲むことで太字にします。

記述例

markdown normal bold normal normal bold normal

表示例

normal bold normal normal bold normal

強調:斜体かつ太字

アスタリスクもしくはアンダースコア3個で文字列を囲むことで太字にします。

記述例

markdown normal bold normal normal bold normal

表示例

normal bold normal normal bold normal

水平線

アンダースコア、アスタリスク、ハイフンなどを3つ以上連続して記述することで水平線を表示します。 ※連続するハイフンなどの間にはスペースがあっても良い

記述例

~~~markdown





~~~

表示例





リンク

[表示文字](リンクURL)形式でリンクを記述できます

markdown Google先生

Google先生

定義参照リンク

Markdownの文書の途中に長いリンクを記述したくない場合は、 同じリンクの参照を何度も利用する場合は、リンク先への参照を定義することができます。

~~~markdown こっちからgoogle その他の文章 こっちからもgoogle

~~~

こっちからgoogle その他の文章 こっちからもgoogle

GitHub Flavored Markdown(GFM)

GitHub Flavored Markdown(GFM)はGitHubの独自仕様を加えたMarkdown記法。 以降、GFMと記載します。

GFM:リンクテキスト簡易記法

URLは記述するだけで自動的にリンクになります。

記述例

markdown https://www.google.co.jp/

表示例

https://www.google.co.jp/

GFM:取り消し線

チルダ2個で文字列を囲むことで取り消し線を利用できます。

記述例

markdown 取り消し線

表示例

取り消し線

GFM:pre記法(チルダ×3)

記述例

 ~~~
 class Hoge
   def hoge
     print 'hoge'
   end
 end
 ~~~

表示例

~~~ class Hoge def hoge print 'hoge' end end ~~~

GFM:pre記法(バッククォート×3)

記述例

markdown    class Hoge   def hoge   print 'hoge'   end  end  

表示例

class Hoge
  def hoge
    print 'hoge'
  end
end

GFM:pre記法(シンタックスハイライト)

チルダ、もしくはバッククォート3つの後ろに対象シンタックスの言語名を記述します。

記述例

 ~~~ruby
 class Hoge
   def hoge
     print 'hoge'
   end
 end
 ~~~

表示例

ruby class Hoge def hoge print 'hoge' end end

GFM:表組み

記述例

markdown |header1|header2|header3| |:--|--:|:--:| |align left|align right|align center| |a|b|c|

表示例

header1 header2 header3
align left align right align center
a b c

GFM:ページ内リンク

GitHubのMarkdownを利用すると、見出し記法を利用した際に アンカーが自動的に作成されます。 そのアンカーを利用したページ内リンクを簡単に作成できます。

~~~markdown

menu

return to menu

header1

header2

~~~

少し省略してますが、こんなかんじのHTMLになります。

~~~html

menu

to header1 to header2

to menu

header1

header2

~~~

参照

QiitaでのMarkdownの使用について Qiitaの目次生成機能について

How to quickly upload your Play Framework web app to AWS Elastic Beanstalk

  1. Create your Play Framework application and initialize the project as a git repository.
  2. Install AWS CLI.
  3. Create your elastic beanstalk application environment using the Docker container in the online AWS Elastic Beanstalk Management Console.
  4. Create configuration files (Dockerfile, Dockerrun.aws.json and, optionally, .ebextentions/*.conf) in the project top directory.
  5. Place the following bash script file as aws.sh in the top directory of your play framework application (play-scala).
#!/bin/bash

readonly APP_NAME=play-scala
readonly APP_VERSION=1.0
readonly EB_BUCKET=<name of your S3 bucket to store your app bundles> #e.g., elasticbeanstalk-us-east-1-000000000000
readonly EB_APP=<name of your elastic beanstalk application>
readonly EB_ENV=<name of your elastic beanstalk environment>
GIT_COMMIT=`git rev-parse HEAD`
GIT_MSG=`git log --oneline -1`

production_build() {
    ./activator clean compile universal:package-zip-tarball
}

build_package() {
    cd `dirname $0`/target/universal
    cp ../../Dockerfile .
    cp ../../Dockerrun.aws.json .
    cp -r ../../.ebextentions/ .
    zip -r ../aws.zip Dockerfile Dockerrun.aws.json play-scala-1.0.tgz .ebextentions/
}

eb_upload() {
    cd `dirname $0`
    aws s3api put-object --bucket $EB_BUCKET --key $GIT_COMMIT.zip --body ./target/aws.zip
    aws elasticbeanstalk create-application-version --application-name $EB_APP --description "$GIT_MSG" --version-label $GIT_COMMIT --source-bundle S3Bucket=$EB_BUCKET,S3Key=$GIT_COMMIT.zip
    aws elasticbeanstalk update-environment --environment-name $EB_ENV --version-label $GIT_COMMIT
}

production_build
build_package
eb_upload
  1. Change the variables (APP_NAME, APP_VERSION, EB_BUCKET, EB_APP and EB_ENV) depending on your development environment.
  2. Make the script executable and run it.
chmod +x aws.sh
./aws.sh


Now that the automation script is in place, you can easily upload the latest version of your application to the Elastic Beanstalk production environment by repeating the following processes.

  1. Update your Play application code
  2. git add . && git commit -m "commit message"
  3. ./aws.sh
  4. Open the Elastic Beanstalk Management Console in your web browser: eb console
  5. Wait for a few minutes untill the environment update is completed.
  6. View your latest Play application in production in your web browser: eb open

Karabiner custom key mappings for HHKB Pro 2 and Logitech K810 on Mac OSX

Early this year I started using Logitech K810 keyboard on Mac and, more recently purchased an additional keyboard that is popular among picky programmers, HHKB Professional 2 (US key, black). As is often the case for non-Apple-native keyboards on Mac OSX, I needed to modify some key bindings of these two keyboards to enjoy a comfortable coding experience on the Mac desktop environment.

Below is the custom Karabiner settings which I have put in ~/Library/Application\ Support/Karabiner/private.xml. The key bindings for Logitech K810 and HHKB Pro2 do not interfere with each other thanks to the device_only option, so it is okay to enable the options for the both keyboards at the same time. The custom key mappings for K810, if enabled, take effect only while K810 is being used and vice versa.

Combined with these tweaks, my favorite Karabiner key bindings are as follows:

f:id:userafmm:20151021233245p:plain

I can't live a day without these key mappings.