Skip to content

Commit

Permalink
README: update for v0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Jan 12, 2020
1 parent a9756e9 commit c74abc5
Show file tree
Hide file tree
Showing 6 changed files with 236 additions and 146 deletions.
100 changes: 56 additions & 44 deletions README-ja_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ $ make INSDIR=/path/to/blesh install

`wget` を使う場合:
```console
$ wget https://github.com/akinomyoga/ble.sh/releases/download/v0.3.0/ble-0.3.0.tar.xz
$ tar xJf ble-0.3.0.tar.xz
$ source ble-0.3.0/ble.sh
$ wget https://github.com/akinomyoga/ble.sh/releases/download/v0.3.1/ble-0.3.1.tar.xz
$ tar xJf ble-0.3.1.tar.xz
$ source ble-0.3.1/ble.sh
```
`curl` を使う場合:
```console
$ curl -LO https://github.com/akinomyoga/ble.sh/releases/download/v0.3.0/ble-0.3.0.tar.xz
$ tar xJf ble-0.3.0.tar.xz
$ source ble-0.3.0/ble.sh
$ curl -LO https://github.com/akinomyoga/ble.sh/releases/download/v0.3.1/ble-0.3.1.tar.xz
$ tar xJf ble-0.3.1.tar.xz
$ source ble-0.3.1/ble.sh
```

指定したディレクトリに `ble.sh` を配置するには単に `ble-0.1.7` ディレクトリをコピーします。
```console
$ cp -r ble-0.3.0 /path/to/blesh
$ cp -r ble-0.3.1 /path/to/blesh
```

## `.bashrc` に設定する
Expand Down Expand Up @@ -204,37 +204,46 @@ bleopt edit_abell=
構文に従った着色で使用される、各文法要素の色と属性は `ble-color-setface` シェル関数で設定します。
既定の設定は以下のコードに対応します:
```bash
ble-color-setface region bg=60,fg=white
ble-color-setface region_target bg=153,fg=black
ble-color-setface region_match bg=55,fg=white
ble-color-setface region_insert fg=12,bg=252
ble-color-setface disabled fg=242
ble-color-setface overwrite_mode fg=black,bg=51
ble-color-setface syntax_default none
ble-color-setface syntax_command fg=brown
ble-color-setface syntax_quoted fg=green
ble-color-setface syntax_quotation fg=green,bold
ble-color-setface syntax_expr fg=26
ble-color-setface syntax_error bg=203,fg=231
ble-color-setface syntax_varname fg=202
ble-color-setface syntax_delimiter bold
ble-color-setface syntax_param_expansion fg=purple
ble-color-setface syntax_history_expansion bg=94,fg=231
ble-color-setface syntax_function_name fg=92,bold
ble-color-setface syntax_comment fg=242
ble-color-setface syntax_glob fg=198,bold
ble-color-setface syntax_brace fg=37,bold
ble-color-setface syntax_tilde fg=navy,bold
ble-color-setface syntax_document fg=94
ble-color-setface syntax_document_begin fg=94,bold
ble-color-setface command_builtin_dot fg=red,bold
ble-color-setface command_builtin fg=red
ble-color-setface command_alias fg=teal
ble-color-setface command_function fg=92
ble-color-setface command_file fg=green
ble-color-setface command_keyword fg=blue
ble-color-setface command_jobs fg=red
ble-color-setface command_directory fg=26,underline
# 編集に関連する着色の設定
ble-color-setface region bg=60,fg=white
ble-color-setface region_target bg=153,fg=black
ble-color-setface region_match bg=55,fg=white
ble-color-setface region_insert fg=12,bg=252
ble-color-setface disabled fg=242
ble-color-setface overwrite_mode fg=black,bg=51
ble-color-setface auto_complete fg=238,bg=254
ble-color-setface menu_filter_fixed bold
ble-color-setface menu_filter_input fg=16,bg=229
ble-color-setface vbell reverse
ble-color-setface vbell_erase bg=252
ble-color-setface vbell_flash fg=green,reverse

# 構文着色の設定
ble-color-setface syntax_default none
ble-color-setface syntax_command fg=brown
ble-color-setface syntax_quoted fg=green
ble-color-setface syntax_quotation fg=green,bold
ble-color-setface syntax_expr fg=26
ble-color-setface syntax_error bg=203,fg=231
ble-color-setface syntax_varname fg=202
ble-color-setface syntax_delimiter bold
ble-color-setface syntax_param_expansion fg=purple
ble-color-setface syntax_history_expansion bg=94,fg=231
ble-color-setface syntax_function_name fg=92,bold
ble-color-setface syntax_comment fg=242
ble-color-setface syntax_glob fg=198,bold
ble-color-setface syntax_brace fg=37,bold
ble-color-setface syntax_tilde fg=navy,bold
ble-color-setface syntax_document fg=94
ble-color-setface syntax_document_begin fg=94,bold
ble-color-setface command_builtin_dot fg=red,bold
ble-color-setface command_builtin fg=red
ble-color-setface command_alias fg=teal
ble-color-setface command_function fg=92
ble-color-setface command_file fg=green
ble-color-setface command_keyword fg=blue
ble-color-setface command_jobs fg=red
ble-color-setface command_directory fg=26,underline
ble-color-setface filename_directory underline,fg=26
ble-color-setface filename_directory_sticky underline,fg=white,bg=26
ble-color-setface filename_link underline,fg=teal
Expand All @@ -250,12 +259,15 @@ ble-color-setface filename_block underline,fg=yellow,bg=black
ble-color-setface filename_warning underline,fg=red
ble-color-setface filename_url underline,fg=blue
ble-color-setface filename_ls_colors underline
ble-color-setface auto_complete fg=238,bg=254
ble-color-setface menu_filter_fixed bold
ble-color-setface menu_filter_input fg=16,bg=229
ble-color-setface vbell reverse
ble-color-setface vbell_erase bg=252
ble-color-setface vbell_flash fg=green,reverse
ble-color-setface varname_array fg=orange,bold
ble-color-setface varname_empty fg=31
ble-color-setface varname_export fg=200,bold
ble-color-setface varname_expr fg=92,bold
ble-color-setface varname_hash fg=70,bold
ble-color-setface varname_number fg=64
ble-color-setface varname_readonly fg=200
ble-color-setface varname_transform fg=29,bold
ble-color-setface varname_unset fg=124
```

現在の描画設定の一覧は以下のコマンドでも確認できます (`ble-color-setface` を無引数で呼び出す)。
Expand Down
100 changes: 56 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ $ make INSDIR=/path/to/blesh install

With `wget`:
```console
$ wget https://github.com/akinomyoga/ble.sh/releases/download/v0.3.0/ble-0.3.0.tar.xz
$ tar xJf ble-0.3.0.tar.xz
$ source ble-0.3.0/ble.sh
$ wget https://github.com/akinomyoga/ble.sh/releases/download/v0.3.1/ble-0.3.1.tar.xz
$ tar xJf ble-0.3.1.tar.xz
$ source ble-0.3.1/ble.sh
```
With `curl`:
```console
$ curl -LO https://github.com/akinomyoga/ble.sh/releases/download/v0.3.0/ble-0.3.0.tar.xz
$ tar xJf ble-0.3.0.tar.xz
$ source ble-0.3.0/ble.sh
$ curl -LO https://github.com/akinomyoga/ble.sh/releases/download/v0.3.1/ble-0.3.1.tar.xz
$ tar xJf ble-0.3.1.tar.xz
$ source ble-0.3.1/ble.sh
```

If you want to place `ble.sh` in a specific directory, just copy the directory:
```console
$ cp -r ble-0.3.0 /path/to/blesh
$ cp -r ble-0.3.1 /path/to/blesh
```

## Setup `.bashrc`
Expand Down Expand Up @@ -192,37 +192,46 @@ bleopt edit_abell=

The colors and attributes used in the syntax highlighting are controlled by `ble-color-setface` function. The following code reproduces the default configuration:
```bash
ble-color-setface region bg=60,fg=white
ble-color-setface region_target bg=153,fg=black
ble-color-setface region_match bg=55,fg=white
ble-color-setface region_insert fg=12,bg=252
ble-color-setface disabled fg=242
ble-color-setface overwrite_mode fg=black,bg=51
ble-color-setface syntax_default none
ble-color-setface syntax_command fg=brown
ble-color-setface syntax_quoted fg=green
ble-color-setface syntax_quotation fg=green,bold
ble-color-setface syntax_expr fg=26
ble-color-setface syntax_error bg=203,fg=231
ble-color-setface syntax_varname fg=202
ble-color-setface syntax_delimiter bold
ble-color-setface syntax_param_expansion fg=purple
ble-color-setface syntax_history_expansion bg=94,fg=231
ble-color-setface syntax_function_name fg=92,bold
ble-color-setface syntax_comment fg=242
ble-color-setface syntax_glob fg=198,bold
ble-color-setface syntax_brace fg=37,bold
ble-color-setface syntax_tilde fg=navy,bold
ble-color-setface syntax_document fg=94
ble-color-setface syntax_document_begin fg=94,bold
ble-color-setface command_builtin_dot fg=red,bold
ble-color-setface command_builtin fg=red
ble-color-setface command_alias fg=teal
ble-color-setface command_function fg=92
ble-color-setface command_file fg=green
ble-color-setface command_keyword fg=blue
ble-color-setface command_jobs fg=red
ble-color-setface command_directory fg=26,underline
# highlighting related to editing
ble-color-setface region bg=60,fg=white
ble-color-setface region_target bg=153,fg=black
ble-color-setface region_match bg=55,fg=white
ble-color-setface region_insert fg=12,bg=252
ble-color-setface disabled fg=242
ble-color-setface overwrite_mode fg=black,bg=51
ble-color-setface auto_complete fg=238,bg=254
ble-color-setface menu_filter_fixed bold
ble-color-setface menu_filter_input fg=16,bg=229
ble-color-setface vbell reverse
ble-color-setface vbell_erase bg=252
ble-color-setface vbell_flash fg=green,reverse

# syntax highlighting
ble-color-setface syntax_default none
ble-color-setface syntax_command fg=brown
ble-color-setface syntax_quoted fg=green
ble-color-setface syntax_quotation fg=green,bold
ble-color-setface syntax_expr fg=26
ble-color-setface syntax_error bg=203,fg=231
ble-color-setface syntax_varname fg=202
ble-color-setface syntax_delimiter bold
ble-color-setface syntax_param_expansion fg=purple
ble-color-setface syntax_history_expansion bg=94,fg=231
ble-color-setface syntax_function_name fg=92,bold
ble-color-setface syntax_comment fg=242
ble-color-setface syntax_glob fg=198,bold
ble-color-setface syntax_brace fg=37,bold
ble-color-setface syntax_tilde fg=navy,bold
ble-color-setface syntax_document fg=94
ble-color-setface syntax_document_begin fg=94,bold
ble-color-setface command_builtin_dot fg=red,bold
ble-color-setface command_builtin fg=red
ble-color-setface command_alias fg=teal
ble-color-setface command_function fg=92
ble-color-setface command_file fg=green
ble-color-setface command_keyword fg=blue
ble-color-setface command_jobs fg=red
ble-color-setface command_directory fg=26,underline
ble-color-setface filename_directory underline,fg=26
ble-color-setface filename_directory_sticky underline,fg=white,bg=26
ble-color-setface filename_link underline,fg=teal
Expand All @@ -238,12 +247,15 @@ ble-color-setface filename_block underline,fg=yellow,bg=black
ble-color-setface filename_warning underline,fg=red
ble-color-setface filename_url underline,fg=blue
ble-color-setface filename_ls_colors underline
ble-color-setface auto_complete fg=238,bg=254
ble-color-setface menu_filter_fixed bold
ble-color-setface menu_filter_input fg=16,bg=229
ble-color-setface vbell reverse
ble-color-setface vbell_erase bg=252
ble-color-setface vbell_flash fg=green,reverse
ble-color-setface varname_array fg=orange,bold
ble-color-setface varname_empty fg=31
ble-color-setface varname_export fg=200,bold
ble-color-setface varname_expr fg=92,bold
ble-color-setface varname_hash fg=70,bold
ble-color-setface varname_number fg=64
ble-color-setface varname_readonly fg=200
ble-color-setface varname_transform fg=29,bold
ble-color-setface varname_unset fg=124
```

The current list of faces can be obtained by the following command (`ble-color-setface` without arguments):
Expand Down
13 changes: 11 additions & 2 deletions blerc
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,12 @@
# ble-color-setface syntax_quoted fg=green
# ble-color-setface syntax_quotation fg=green,bold
# ble-color-setface syntax_expr fg=navy
# ble-color-setface syntax_error bg=203,fg=231 # bg=224
# ble-color-setface syntax_error bg=203,fg=231
# ble-color-setface syntax_varname fg=202
# ble-color-setface syntax_delimiter bold
# ble-color-setface syntax_param_expansion fg=purple
# ble-color-setface syntax_history_expansion bg=94,fg=231
# ble-color-setface syntax_function_name fg=92,bold # fg=purple
# ble-color-setface syntax_function_name fg=92,bold
# ble-color-setface syntax_comment fg=gray
# ble-color-setface syntax_glob fg=198,bold
# ble-color-setface syntax_brace fg=37,bold
Expand Down Expand Up @@ -407,6 +407,15 @@
# ble-color-setface filename_warning underline,fg=red
# ble-color-setface filename_url underline,fg=blue
# ble-color-setface filename_ls_colors underline
# ble-color-setface varname_array fg=orange,bold
# ble-color-setface varname_empty fg=31
# ble-color-setface varname_export fg=200,bold
# ble-color-setface varname_expr fg=92,bold
# ble-color-setface varname_hash fg=70,bold
# ble-color-setface varname_number fg=64
# ble-color-setface varname_readonly fg=200
# ble-color-setface varname_transform fg=29,bold
# ble-color-setface varname_unset fg=124


##-----------------------------------------------------------------------------
Expand Down
94 changes: 62 additions & 32 deletions generate-release-note.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
#!/bin/bash
#!/usr/bin/env bash

fname_changelog=changelog.txt

function read-arguments {
while (($#)); do
local arg=$1; shift 1
case $arg in
(--changelog)
if (($#)); then
fname_changelog=$1; shift
else
flags=E$flags
echo "release-note: missing option argument for '$arg'." >&2
fi ;;
esac
done
}
read-arguments "$@"

function process {
## @arr commits
Expand All @@ -7,44 +25,56 @@ function process {
## そして before は after に対応する master における commit である。
local -a commits; commits=("$@")

local commit_pair
for commit_pair in "${commits[@]}"; do
local b=${commit_pair#*:}
local a=${commit_pair%:*}
local a=${commit_pair%%:*}
commit_pair=${commit_pair:${#a}+1}
local b=${commit_pair%%:*}
local c=${commit_pair#*:}

local result=$(sed -n "s/$b/$a (master: $b)/p" changelog.txt)
local result=
[[ $b ]] && result=$(sed -n "s/$b/$a (master: $b)/p" "$fname_changelog")
if [[ $result ]]; then
echo "$result"
elif [[ $c ]]; then
echo "- $c $a (master: ${b:-N/A}) @@@NOT-FOUND@@@"
else
echo "@@@not found $a"
fi
done
}

# ble-0.3.0
#
# 232767a:30cc31c
# 244205f:3f1f472
# 655fbaa:2e6f44c
# 1bc9934:b29f248
# 910313e:309b9e4
# e6ae0be:ab8dad2
# a235aa4:467b7a4
# d2aa2d2:1666ec2
# 8926704:4ce2753
# 7b15550:d94f691
# f8bdf9d:376bfe7
# 45db2ec:b52da28

# ble-0.2.0
#
process \
6713766:f199215 \
b109b46:88a1b0f \
73a191d:36b9a8f \
ae72dc3:ae176b2 \
50fbadf:8e4180c \
7109acf:4efe1a9 \
637ec53:f20f840 \
6f5058d:a46ada0 \
6c931fd:9290adb \
6ad206a:9892d63
function find-commit-pairs {
{
echo __MODE_HEAD__
git log --format=format:'%h%s' --date-order --abbrev-commit "$1"..HEAD; echo
echo __MODE_MASTER__
git log --format=format:'%h%s' --date-order --abbrev-commit "${2:-master}"; echo
} | awk -F '' '
/^__MODE_HEAD__$/ {
mode = "head";
nlist = 0;
next;
}
/^__MODE_MASTER__$/ { mode = "master"; next; }
mode == "head" {
i = nlist++;
titles[i] = $2
commit_head[i] = $1;
title2index[$2] = i;
}
mode == "master" && (i = title2index[$2]) != "" && commit_master[i] == "" {
commit_master[i] = $1;
}
END {
for (i = 0; i < nlist; i++) {
print commit_head[i] ":" commit_master[i] ":" titles[i];
}
}
'
}

IFS=$'\n' eval 'commit_pairs=($(find-commit-pairs "$@"))'
process "${commit_pairs[@]}"
Loading

0 comments on commit c74abc5

Please sign in to comment.