本機能はGitHub repo本文(READMEなど)では機能しないことに注意。効果はこの本文の下にあるコメント欄を見ると確認できる。
GitHubのComments/Issues/Pull requestsではコードスパンの中にCSSの色表現を記述するとカラーサンプル付きで表示する。
ただし全ての表現が使えるのではなく、使える書式とそうでないものがある。確認コードは次の通り。
| 表現 | 文例 | 判定 |(2022-08-11現在) 次のMarkdown文書はPreviewとOutputで結果が異なる。
\[これはリンクではない、しかしリンク先に注意](https\://www\.example\.com)[これはリンクではない、しかしリンク先に注意](https://www.example.com)
https://...の部分は次のように処理される。
Backslash escape effects for all ASCII printable characters (→ source)
| U+ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0020 | \ \ |
\!! |
\"" |
\## |
\$$ |
\%% |
\&& |
\'' |
\(( |
\)) |
\** |
\++ |
\,, |
\-- |
\.. |
\// |
| 0030 | \0⁠\0 |
\1⁠\1 |
\2⁠\2 |
\3⁠\3 |
\4⁠\4 |
\5⁠\5 |
\6⁠\6 |
\7⁠\7 |
\8⁠\8 |
\9& |
| # Render markdown-escapes.md | |
| N_COL = 16 | |
| puts "# Backslash escapes in Markdown" | |
| puts | |
| puts "Backslash escape effects for all ASCII printable characters (→ [source](https://gist.github.com/higuma/15de141310855a8f654792046dca5c50))" | |
| puts | |
| puts "| U+ |" + (0...N_COL).inject('') {|row, col| row + sprintf(" %X |", col) } | |
| puts (0..N_COL).inject('|') {|row, _| row + ' :-: |' } |
| #!/usr/bin/env ruby | |
| # Recursive line/word/byte counter | |
| require 'find' | |
| require 'fileutils' | |
| ARGV.push '.' if ARGV.empty? | |
| total_lines = total_words = total_bytes = 0 |
| #!/usr/bin/env ruby | |
| require 'optparse' | |
| require 'webrick' | |
| # Add additional MIME types here | |
| WEBrick::Config::HTTP[:MimeTypes].update({ | |
| 'wasm' => 'application/wasm' | |
| }) |
| #!/usr/bin/env ruby | |
| # git-id: calculates the git ID (sha-1) with the specified object type | |
| require 'optparse' | |
| require 'openssl' | |
| type = 'blob' # as default | |
| opt = OptionParser.new |
| // MNIST database reader | |
| // http://yann.lecun.com/exdb/mnist/ | |
| package mnist | |
| import ( | |
| "fmt" | |
| "os" | |
| "path/filepath" | |
| ) |
| require 'net/http' | |
| URI_BASE = 'https://www.marutsu.co.jp/contents/shop/marutsu/mame' | |
| EXT = ['html', 'htm', 'pdf'] | |
| NUMBER_RANGE = 1..220 # max = 205? | |
| def https_request(uri) | |
| uri = URI uri | |
| Net::HTTP.start uri.host, uri.port, use_ssl: uri.scheme == 'https' do |http| | |
| response = http.request Net::HTTP::Get.new(uri) |