my_help 1.2.10 → 1.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -10
  3. data/Gemfile.lock +6 -91
  4. data/README.org +24 -0
  5. data/Rakefile +0 -35
  6. data/development_memo.org +4 -0
  7. data/lib/my_help/cli.rb +32 -6
  8. data/lib/my_help/config.rb +8 -3
  9. data/lib/my_help/init.rb +8 -1
  10. data/lib/my_help/list.rb +15 -20
  11. data/lib/my_help/modify.rb +9 -7
  12. data/lib/my_help/org2hash.rb +3 -3
  13. data/lib/my_help/version.rb +1 -1
  14. data/lib/templates/kick_off.md +51 -0
  15. data/lib/templates/kick_off.org +65 -0
  16. data/lib/templates/template.md +17 -0
  17. data/lib/templates/template.org +11 -1
  18. data/my_help.gemspec +3 -3
  19. metadata +6 -85
  20. data/.DS_Store +0 -0
  21. data/.dockerignore +0 -2
  22. data/.my_help/example2.org +0 -9
  23. data/.rspec +0 -3
  24. data/.rspec_status +0 -13
  25. data/.travis.yml +0 -4
  26. data/.yardoc/checksums +0 -11
  27. data/.yardoc/complete +0 -0
  28. data/.yardoc/object_types +0 -0
  29. data/.yardoc/objects/root.dat +0 -0
  30. data/.yardoc/proxy_types +0 -0
  31. data/doc/MyHelp/CLI.html +0 -895
  32. data/doc/MyHelp/Config.html +0 -759
  33. data/doc/MyHelp/Error.html +0 -124
  34. data/doc/MyHelp/GetConfig.html +0 -198
  35. data/doc/MyHelp/Git.html +0 -291
  36. data/doc/MyHelp/Init.html +0 -449
  37. data/doc/MyHelp/List.html +0 -646
  38. data/doc/MyHelp/Md2Hash.html +0 -632
  39. data/doc/MyHelp/Modify.html +0 -393
  40. data/doc/MyHelp/Org2Hash.html +0 -554
  41. data/doc/MyHelp.html +0 -135
  42. data/doc/Org2Yaml.html +0 -497
  43. data/doc/_index.html +0 -230
  44. data/doc/class_list.html +0 -54
  45. data/doc/css/common.css +0 -1
  46. data/doc/css/full_list.css +0 -58
  47. data/doc/css/style.css +0 -503
  48. data/doc/file.README.html +0 -181
  49. data/doc/file_list.html +0 -59
  50. data/doc/frames.html +0 -22
  51. data/doc/index.html +0 -181
  52. data/doc/js/app.js +0 -344
  53. data/doc/js/full_list.js +0 -242
  54. data/doc/js/jquery.js +0 -2
  55. data/doc/method_list.html +0 -486
  56. data/doc/top-level-namespace.html +0 -112
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a894f2dbb0d0c8bd125f5541200c80dedbeda4ea010ea799ceca55c03d298cc9
4
- data.tar.gz: accda83181514df9ccecb2f65d8298483248ebabba042b12c34e8acdc740ca4f
3
+ metadata.gz: 0fd67abb14b0d569344de74e692acd4e7b0fd5c3fdc532b9c21db1ecc43c7505
4
+ data.tar.gz: 02342034d58896f2903b37d2ef77b94269cad1e3039b97bf256243efa113adb3
5
5
  SHA512:
6
- metadata.gz: 716080d0afbbdfe615045b6ed8c49624f91c5cb5a4dfe83ed7e4dca849c81d97c6e3b14b95ecff4474575816dbb3c1e633ab7f581e7281d992efad43036bb047
7
- data.tar.gz: 47d66e2e6e89d98b7b140ffce747fb018c849f1b49ce61f108a267e3e2de490df08db191bd381b504fd6429ac606f38793a3ec8248c06231a4c552462d1e26a5
6
+ metadata.gz: 7113f1321958ad62b3d2214193586d6d3e0e8ded6c4e4a62b4664bf41224007d85fdcedaef965019393fb8182dbc38003b44a7b1f001cccc4c6e8ff485166912
7
+ data.tar.gz: 1e4a6bd0ba7e64574ddde58cb4bd7a8b3177004909ba3f3dbc48ef7e44618e7724b6c2c5e555fb760bfbb41ab12e7f7c32594e4eb489adde2c9cb15838279c61
data/Gemfile CHANGED
@@ -1,11 +1,2 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in my_help.gemspec
1
+ source "http://www.rubygems.org"
6
2
  gemspec
7
-
8
- gem "rake", "~> 13.0"
9
-
10
- gem "rspec", "~> 3.0"
11
- gem 'aruba', '~> 2.1.0'
data/Gemfile.lock CHANGED
@@ -1,109 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- my_help (1.2.9)
4
+ my_help (1.2.11)
5
5
  colorize
6
6
  command_line
7
7
  thor
8
8
 
9
9
  GEM
10
- remote: https://rubygems.org/
10
+ remote: http://www.rubygems.org/
11
11
  specs:
12
- aruba (2.1.0)
13
- bundler (>= 1.17, < 3.0)
14
- childprocess (>= 2.0, < 5.0)
15
- contracts (>= 0.16.0, < 0.18.0)
16
- cucumber (>= 4.0, < 9.0)
17
- rspec-expectations (~> 3.4)
18
- thor (~> 1.0)
19
- ast (2.4.2)
20
- builder (3.2.4)
21
- childprocess (4.1.0)
22
- colorize (1.0.1)
12
+ colorize (1.1.0)
23
13
  command_line (2.0.1)
24
- contracts (0.17)
25
- cucumber (8.0.0)
26
- builder (~> 3.2, >= 3.2.4)
27
- cucumber-ci-environment (~> 9.0, >= 9.0.4)
28
- cucumber-core (~> 11.0, >= 11.0.0)
29
- cucumber-cucumber-expressions (~> 15.1, >= 15.1.1)
30
- cucumber-gherkin (~> 23.0, >= 23.0.1)
31
- cucumber-html-formatter (~> 19.1, >= 19.1.0)
32
- cucumber-messages (~> 18.0, >= 18.0.0)
33
- diff-lcs (~> 1.5, >= 1.5.0)
34
- mime-types (~> 3.4, >= 3.4.1)
35
- multi_test (~> 1.1, >= 1.1.0)
36
- sys-uname (~> 1.2, >= 1.2.2)
37
- cucumber-ci-environment (9.2.0)
38
- cucumber-core (11.0.0)
39
- cucumber-gherkin (~> 23.0, >= 23.0.1)
40
- cucumber-messages (~> 18.0, >= 18.0.0)
41
- cucumber-tag-expressions (~> 4.1, >= 4.1.0)
42
- cucumber-cucumber-expressions (15.2.0)
43
- cucumber-gherkin (23.0.1)
44
- cucumber-messages (~> 18.0, >= 18.0.0)
45
- cucumber-html-formatter (19.2.0)
46
- cucumber-messages (~> 18.0, >= 18.0.0)
47
- cucumber-messages (18.0.0)
48
- cucumber-tag-expressions (4.1.0)
49
- diff-lcs (1.5.0)
50
- ffi (1.15.5)
51
- json (2.6.3)
52
- mime-types (3.4.1)
53
- mime-types-data (~> 3.2015)
54
- mime-types-data (3.2023.0218.1)
55
- multi_test (1.1.0)
56
- parallel (1.23.0)
57
- parser (3.2.2.3)
58
- ast (~> 2.4.1)
59
- racc
60
- racc (1.7.3)
61
- rainbow (3.1.1)
62
- rake (13.0.6)
63
- regexp_parser (2.8.1)
64
- rexml (3.2.6)
65
- rspec (3.12.0)
66
- rspec-core (~> 3.12.0)
67
- rspec-expectations (~> 3.12.0)
68
- rspec-mocks (~> 3.12.0)
69
- rspec-core (3.12.2)
70
- rspec-support (~> 3.12.0)
71
- rspec-expectations (3.12.3)
72
- diff-lcs (>= 1.2.0, < 2.0)
73
- rspec-support (~> 3.12.0)
74
- rspec-mocks (3.12.5)
75
- diff-lcs (>= 1.2.0, < 2.0)
76
- rspec-support (~> 3.12.0)
77
- rspec-support (3.12.0)
78
- rubocop (1.52.1)
79
- json (~> 2.3)
80
- parallel (~> 1.10)
81
- parser (>= 3.2.2.3)
82
- rainbow (>= 2.2.2, < 4.0)
83
- regexp_parser (>= 1.8, < 3.0)
84
- rexml (>= 3.2.5, < 4.0)
85
- rubocop-ast (>= 1.28.0, < 2.0)
86
- ruby-progressbar (~> 1.7)
87
- unicode-display_width (>= 2.4.0, < 3.0)
88
- rubocop-ast (1.29.0)
89
- parser (>= 3.2.1.0)
90
- ruby-progressbar (1.13.0)
91
- sys-uname (1.2.3)
92
- ffi (~> 1.1)
93
- thor (1.2.2)
94
- unicode-display_width (2.4.2)
95
- yard (0.9.37)
14
+ thor (1.3.2)
96
15
 
97
16
  PLATFORMS
98
17
  arm64-darwin-20
18
+ ruby
99
19
 
100
20
  DEPENDENCIES
101
- aruba (~> 2.1.0)
102
21
  my_help!
103
- rake (~> 13.0)
104
- rspec (~> 3.0)
105
- rubocop
106
- yard
107
22
 
108
23
  BUNDLED WITH
109
- 2.4.14
24
+ 2.5.21
data/README.org CHANGED
@@ -113,6 +113,30 @@ Commands:
113
113
  -d, dired : ファイラとして使う
114
114
  #+end_src
115
115
 
116
+ * .md + code
117
+ vscodeを使うuserからの要望で,vscodeと.mdを組み合わせて
118
+ 使えるようにしました.
119
+ ** init
120
+ init時に.mdを選択するとdefaultのファイル拡張子を.mdにします.
121
+ ** default editorをvscodeに
122
+ : > my_help set editor
123
+ * batcatによるcolorize
124
+ bat(cat)でlist時にcolorize出力をさせるようにしました.<2025-06-20 Fri>
125
+ ただ,実行環境(os)のチェックや,terminalの設定に対して
126
+ 特定の状況を想定しています.
127
+ 出力が見にくい場合は,
128
+ : > my_help set bat false
129
+ として,plain出力に戻してください.今の設定は,
130
+ : > my_help list | batcat --theme ColdarkCold -l zsh
131
+ です.pull requestを投げてもらったら対応できるかもしれません.
132
+ * current dir file
133
+ : my_help list ./readme.org hoge
134
+ のように,current dirを指定して*.orgなどをlistすると
135
+ item: hogeがcolorizeして表示されます.
136
+
137
+ 長いreadme.orgからitemを抽出して表示するときに便利です.
138
+
139
+ * 詳しい解説
116
140
  ** my_helpがやっていること
117
141
  my_helpの個々のヘルプファイルは'~/.my_help'に置かれています.
118
142
  ヘルプファイルのフォーマットはEmacsのorg-modeです.
data/Rakefile CHANGED
@@ -1,5 +1,4 @@
1
1
  # frozen_string_literal: true
2
- require 'yard'
3
2
  require 'bundler/gem_tasks'
4
3
  require 'rake/testtask'
5
4
 
@@ -10,42 +9,8 @@ Rake::TestTask.new(:test) do |t|
10
9
  t.test_files = FileList['test/**/*_test.rb']
11
10
  end
12
11
 
13
- desc 'make documents by yard'
14
- task :yard do
15
- # api_output_dir = 'doc'
16
- YARD::Rake::YardocTask.new do |t|
17
- # t.options << '-o#{api_output_dir}' # output dir = doc_api
18
- # t.files=['**/*.md']
19
- t.options += ['--title', 'my_help']
20
- # t.options=['--exclude','lib.rb','--files','**/*.org']
21
- # see [[https://github.com/lsegal/yard/issues/66]] for the other options
22
- end
23
- end
24
-
25
- require 'rubocop/rake_task'
26
-
27
- RuboCop::RakeTask.new
28
-
29
12
  #task default: %i[test rubocop]
30
13
  task :default do
31
14
  system "rake -T"
32
15
  end
33
16
 
34
- require "colorize"
35
- require 'command_line/global'
36
-
37
- desc 'git auto'
38
- task :git_auto do
39
- print "Input comments: "
40
- comment = STDIN.gets.chomp
41
- comment = comment == "" ? "auto pull and push" : comment.gsub("\'", "\\'")
42
- ["git add -A",
43
- "git commit -m '#{comment}'",
44
- "git pull origin main",
45
- "git push origin main"].each do |comm|
46
- puts comm.cyan
47
- res = command_line comm
48
- puts res.stdout.green
49
- end
50
- end
51
-
data/development_memo.org CHANGED
@@ -12,6 +12,10 @@
12
12
  #+TWITTER: off
13
13
  #+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup
14
14
 
15
+ * batcat <2025-06-19 Thu>
16
+ - ENV['wsl']でbatcatを強制
17
+ - markdown を再修正
18
+ - さらにGemfileを.gemspecにして,Gemfile.lockは' bundle install'で自動生成
15
19
  * new development <2024-09-26 Thu>
16
20
  - test作ろう
17
21
  - '* ' 問題の解決
data/lib/my_help/cli.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'colorize'
1
2
  module MyHelp
2
3
  class CLI < Thor
3
4
  include GetConfig
@@ -53,7 +54,7 @@ module MyHelp
53
54
  end
54
55
  end
55
56
  end
56
-
57
+
57
58
  map "-i" => :init
58
59
  desc "init", "initialize my_help environment"
59
60
 
@@ -62,14 +63,20 @@ module MyHelp
62
63
 
63
64
  #config.ask_default
64
65
  init = Init.new(config)
65
- raise "Local help dir exist." if init.help_dir_exist?
66
+ begin
67
+ init.help_dir_exist?
68
+ rescue RuntimeError => e
69
+ puts "RuntimeError: #{e.message}"
70
+ exit
71
+ end
66
72
  puts "Choose default markup '.org' [Y or .md]? "
67
73
  response = $stdin.gets.chomp
68
74
  config.configure(:ext => response) unless response.upcase[0] == "Y"
69
75
  init.mk_help_dir
70
76
  config.save_config
71
77
  init.cp_templates
72
- puts "If you want change editor use my_help set editor code."
78
+ puts "For changing editor to code: 'my_help set editor code'.".green
79
+ puts "For activating batcat: 'my_help set bat true'.".green
73
80
  end
74
81
 
75
82
  desc "set [:key] [VAL]", "set editor or ext"
@@ -77,7 +84,13 @@ module MyHelp
77
84
  def set(*args)
78
85
  config = get_config # for using methods in Config
79
86
  key = args[0] || ""
80
- config.configure(key.to_sym => args[1])
87
+ begin
88
+ config.configure(key.to_sym => args[1])
89
+ rescue => e
90
+ puts e
91
+ exit
92
+ end
93
+
81
94
  config.save_config
82
95
  conf_file_path = config[:conf_file]
83
96
  puts "conf_file_path: %s" % conf_file_path
@@ -93,16 +106,29 @@ module MyHelp
93
106
  config = get_config
94
107
  help_dir = options["help_dir"] || config[:local_help_dir]
95
108
  layer = options["layer"] || 1
96
- puts List.new(help_dir,
109
+ text = List.new(help_dir,
97
110
  config[:ext],
98
111
  layer).list(*args.join(" "))
112
+ if config[:bat]
113
+ require "tempfile"
114
+ t = Tempfile.open(['hoge', 'bar'])
115
+ File.write(t.path, text)
116
+ if ENV["WSL_DISTRO_NAME"]=="Ubuntu"
117
+ # p ['config[:bat]',config[:bat]]
118
+ system("cat #{t.path} |batcat --theme Coldark-Cold -l zsh -p") #| bat -l org -p")
119
+ else
120
+ system("cat #{t.path} |bat -l zsh -p") #| bat -l org -p")
121
+ end
122
+ else
123
+ puts text
124
+ end
99
125
  end
100
126
 
101
127
  map "-e" => :edit
102
128
  desc "edit [HELP]", "edit help"
103
129
  def edit(*args)
104
130
  c = get_config
105
- help_name = args[0]
131
+ help_name = *args[0] #.join(" ")
106
132
  Modify.new(c).edit(help_name)
107
133
  end
108
134
 
@@ -16,6 +16,7 @@ module MyHelp
16
16
  editor: ENV["EDITOR"] || "emacs",
17
17
  ext: ".org",
18
18
  verbose: false,
19
+ bat: false,
19
20
  }
20
21
  @valid_config_keys = @config.keys
21
22
  configure_with(@config[:conf_file])
@@ -41,10 +42,13 @@ module MyHelp
41
42
  if @valid_config_keys.include? k.to_sym
42
43
  @config[k.to_sym] = v
43
44
  elsif k == "".to_sym
44
- print "Valid key words are follows:"
45
- p @valid_config_keys
45
+ print "Valid key words are follows: "
46
+ puts [@valid_config_keys.map{|v| v.to_s}].join(", ")
46
47
  else
47
- raise KeyError.new("Error: keyword '#{k}' is invalid",
48
+ raise KeyError.new("KeywordError: keyword '#{k}' is invalid.\n
49
+ Valid key words are follows;
50
+ #{[@valid_config_keys.map{|v| v.to_s}].join(", ")}
51
+ ",
48
52
  receiver: @config,
49
53
  key: k)
50
54
  end
@@ -69,6 +73,7 @@ module MyHelp
69
73
 
70
74
  # save config in @config[:conf_file]
71
75
  def save_config()
76
+ puts " save config in #{@config[:conf_file]}"
72
77
  File.write(@config[:conf_file], YAML.dump(config))
73
78
  end
74
79
 
data/lib/my_help/init.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'colorize'
1
2
  module MyHelp
2
3
  class Init
3
4
  def initialize(config)
@@ -5,7 +6,11 @@ module MyHelp
5
6
  end
6
7
 
7
8
  def help_dir_exist?
8
- File.exist?(@config[:local_help_dir])
9
+ if File.exist?(@config[:local_help_dir])
10
+ raise "Local help dir exist.\n".red+
11
+ "local help dir: #{@config[:local_help_dir]};
12
+ if you are sure, delete local help dir first.".green
13
+ end
9
14
  end
10
15
 
11
16
  def check_conf_exist
@@ -13,6 +18,7 @@ module MyHelp
13
18
  end
14
19
 
15
20
  def mk_help_dir
21
+ puts "making local help dir: #{@config[:local_help_dir]}"
16
22
  FileUtils.mkdir(@config[:local_help_dir])
17
23
  end
18
24
 
@@ -20,6 +26,7 @@ module MyHelp
20
26
  target_dir = @config[:local_help_dir]
21
27
  src_dir = @config[:template_dir]
22
28
  ext = @config[:ext]
29
+ puts "cp help templates *#{ext}"
23
30
  Dir.glob(File.join(src_dir, "*#{ext}")).each do |file|
24
31
  FileUtils.cp(file, target_dir, verbose: false)
25
32
  end
data/lib/my_help/list.rb CHANGED
@@ -4,6 +4,7 @@ require "colorized_string"
4
4
 
5
5
  module MyHelp
6
6
  # Your code goes here...
7
+
7
8
  class List
8
9
  def initialize(path = "", ext = ".org", layer = 1)
9
10
  @path = path
@@ -16,6 +17,7 @@ module MyHelp
16
17
  if item == nil && name == nil
17
18
  list_helps()
18
19
  else
20
+ name = File.basename(name, @ext)
19
21
  path = File.exist?(name + @ext) ? name + @ext :
20
22
  File.join(@path, name + @ext)
21
23
  list_help_with(path, name, item)
@@ -24,7 +26,15 @@ module MyHelp
24
26
 
25
27
  def read_help(file)
26
28
  info = {}
27
- info[:items] = Org2Hash.new(File.read(file)).contents
29
+
30
+ info[:items] = case @ext
31
+ when '.org'
32
+ Org2Hash.new(File.read(file)).contents
33
+ when '.md'
34
+ Md2Hash.new(File.read(file)).contents
35
+ else
36
+ RaiseError(:NoExtension)
37
+ end
28
38
  info[:name] = File.basename(file).split(".")[0]
29
39
  return info
30
40
  end
@@ -35,26 +45,13 @@ module MyHelp
35
45
  # p [out, file]
36
46
  help_info = read_help(file)
37
47
  head = help_info[:items]["head"] ?
38
- help_info[:items]["head"].split("\n")[0] : ''
48
+ help_info[:items]["head"][0] : ''
39
49
  # out << "%10s: %s\n" % [help_info[:name], head]
40
50
  out << "%s: %s\n" %
41
51
  [pad_multi_bytes(help_info[:name],20), head]
42
52
  end
43
53
  end
44
54
 
45
- # def pad_multi_bytes(str, length, padstr=" ")
46
- # str_bytes = str.each_char.map do |c|
47
- # c.bytesize == 1 ? 1 : 2
48
- # end.reduce(0, &:+)
49
- # p [str, length, str_bytes]
50
- # if str_bytes<length
51
- # pad = padstr * (length - str_bytes)
52
- # return pad + str
53
- # else
54
- # return str
55
- # end
56
- # end
57
-
58
55
  def pad_multi_bytes(str, length, padstr=" ")
59
56
  str_bytes = str.each_char.map { |c| c.bytesize == 1 ? 1 : 2 }.sum
60
57
  pad_length = length - str_bytes
@@ -69,9 +66,7 @@ module MyHelp
69
66
 
70
67
  def list_help_with(path, name, item)
71
68
  @help_info = read_help(path)
72
- output = ColorizedString[
73
- "my_help called with name : #{name},item : #{item}\n"
74
- ].colorize(:cyan)
69
+ output = "my_help called with name : #{name},item : #{item}\n"
75
70
 
76
71
  if item == nil
77
72
  @help_info[:items].each_pair do |item, val|
@@ -95,8 +90,8 @@ module MyHelp
95
90
  "Can't find similar item name with : #{input_item}"
96
91
  else
97
92
  contents = candidates.collect do |near_item|
98
- ColorizedString["item : #{near_item} \n"].colorize(:cyan) +
99
- @help_info[:items][near_item]
93
+ # ColorizedString["item : #{near_item} \n"].colorize(:cyan) +
94
+ "item : #{near_item} \n" + @help_info[:items][near_item].join("\n")
100
95
  end
101
96
  contents.join("\n")
102
97
  end
@@ -2,12 +2,13 @@ module MyHelp
2
2
  class Modify
3
3
  def initialize(conf)
4
4
  @conf = conf
5
+ @ext = @conf[:ext]
5
6
  end
6
7
 
7
8
  def new(help_file)
8
9
  target = help_file
9
- source = File.join(@conf[:template_dir], "example.org")
10
- FileUtils.cp(source, target, verbose: @conf[:verbose])
10
+ source = File.join(@conf[:template_dir], "template#{@ext}")
11
+ FileUtils.cp(source, target, verbose: true)
11
12
  end
12
13
 
13
14
  def delete(help_file)
@@ -19,13 +20,14 @@ module MyHelp
19
20
  end
20
21
 
21
22
  def edit(help_name)
22
- p help_file = File.join(@conf[:local_help_dir],
23
- help_name + @conf[:ext])
24
- if File.exist?(help_file)
25
- p comm = "#{@conf[:editor]} #{help_file}"
23
+ name = File.basename(help_name[0], @ext)
24
+ path = File.exist?(name + @ext) ? name + @ext :
25
+ File.join(@conf[:local_help_dir], name + @ext)
26
+ if File.exist?(path)
27
+ p comm = "#{@conf[:editor]} #{path}"
26
28
  system(comm)
27
29
  else
28
- puts "file #{help_file} does not exist,"
30
+ puts "file #{path} does not exist,"
29
31
  puts "make #{help_name} first by 'new' command."
30
32
  end
31
33
  end
@@ -22,7 +22,7 @@ module MyHelp
22
22
 
23
23
  def simple_fsm()
24
24
  state = :header_read
25
- item = ""
25
+ item = []
26
26
  @text.split("\n").each do |line|
27
27
  next if line.size < 1
28
28
  state, action = TRANSITIONS[state][line[0..1]] ||
@@ -31,9 +31,9 @@ module MyHelp
31
31
  when :ignore
32
32
  when :start_new_item
33
33
  item = read_item(line)
34
- @contents[item] = ""
34
+ @contents[item] = []
35
35
  when :add_contents
36
- @contents[item] += line + "\n"
36
+ @contents[item] << line
37
37
  end
38
38
  end
39
39
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MyHelp
4
- VERSION = "1.2.10"
4
+ VERSION = "1.2.14"
5
5
  end
@@ -0,0 +1,51 @@
1
+ # head: kickoff for wsl novice
2
+
3
+ # license: cc by Shigeto R. Nishitani, 2025
4
+
5
+ # initial_operation
6
+ 最初(initial)の操作
7
+ 1. cd comp_a_25s
8
+ 2. git stash # 変更をgitに無かったことに
9
+ 3. git pull origin main # 最新のfilesをgitでpull(引っ張ってくる)
10
+ 4. cp bin/kick_off ~/bin # 最新版のkick_offを~/binにcopy
11
+ 5. cd ~/my_comp_a/python
12
+ 6. cp ~/comp_a_25s/python/hogehoge . # hogehogeファイルを'.'にcp
13
+
14
+ # wsl shell commands
15
+ - cat : catenate # 中身を出力する
16
+ - cat results | pbcopy(clip.exe)
17
+ - bat : batcat
18
+ - kick_off -f | bat -l zsh
19
+ - python3 d1_print_calendar.py > results.txt
20
+ - history
21
+ - history -r | tail -20 | clip.exe
22
+ - tree, open, code .,
23
+
24
+ # directory(path) comms
25
+ - pwd : print working directory
26
+ - ls [DIR] : list # defaultは'.'
27
+ - cd [DIR] : change directory # defaultは'~'
28
+ - '~' tilde, ホームdirectoryを指す
29
+
30
+ # file comms
31
+ - mv : move
32
+ - cp : copy
33
+ - mkdir : make directory
34
+ - rm : remove
35
+ - rm -rf DIR # DIRごとremove
36
+ # editor key binds
37
+ - c-p(previous)
38
+ - c-a(ahead), c-b(back), c-f(forward), c-e(end)
39
+ - c-n(next)
40
+ - c-d(delete), c-k(kill-line), del
41
+ - c-y(yank, paste)
42
+
43
+ # capture comms
44
+ - Mac
45
+ - whole : Shift + Command + 3
46
+ - select: Shift + Command + 4
47
+ - window: Shift + Command + 4 , space
48
+ - Desktopに保存
49
+ - Windows :
50
+ - Win + Shift + S, それからIcon操作
51
+ - 「ピクチャ」->「スクリーンショット」に保存
@@ -0,0 +1,65 @@
1
+ #+OPTIONS: ^:{}
2
+ #+STARTUP: indent nolineimages overview num
3
+ * head:
4
+ 最初心者のためのコマンドメモ
5
+ * license: cc by Shigeto R. Nishitani, 2025
6
+ * initial(最初)の操作
7
+ 1. cd comp_a_25s
8
+ 2. git stash # 変更をgitに無かったことに
9
+ 3. git pull origin main # 最新のfilesをgitでpull(引っ張ってくる)
10
+ 4. cp bin/kick_off ~/bin # 最新版のkick_offを~/binにcopy
11
+ 5. cd ~/my_comp_a/python
12
+ 6. cp ~/comp_a_25s/python/hogehoge . # hogehogeファイルを'.'にcp
13
+ * git
14
+ 1. git config --global user.name "John Doe"
15
+ 1. git config --global user.email johndoe@example.com
16
+ 1. git config --global core.editor code
17
+ 1. git config pull.rebase true
18
+ 1. git stash # 変更をgitに無かったことに
19
+ 1. git pull origin main # 最新のfilesをgitでpull(引っ張ってくる)
20
+
21
+ * wsl shell commands
22
+ - cat : catenate # 中身を出力する
23
+ - cat results | pbcopy(clip.exe)
24
+ # '|' pipe : 出力結果を次のclaに渡す
25
+ # 'clip.exe'->'pbcopy' for mac users
26
+ - bat : batcat
27
+ - kick_off -f | bat -l zsh
28
+ # | bat -l zsh
29
+ - python3 d1_print_calendar.py > results.txt
30
+ # '>' redirect : 出力をfileに保存
31
+ - history
32
+ - history -r | tail -20 | clip.exe
33
+ - tree, open, code .,
34
+ * directory(path)ディレクトリ
35
+ - pwd : print working directory
36
+ # 今いる絶対path(dir)
37
+ - ls [DIR] : list # defaultは'.'
38
+ # '.' current dir, 今いるdirectory
39
+ - cd [DIR] : change directory # defaultは'~'
40
+ # '~' tilde, ホームdirectoryを指す
41
+ # '..' 一つ上の相対path
42
+ * fileファイル
43
+ - mv : move
44
+ - cp : copy
45
+ - mkdir : make directory
46
+ - rm : remove
47
+ - rm -rf DIR # DIRごとremove
48
+ # recursive 繰り返し(再帰的に), force 強制的に
49
+ * editor key binds
50
+ - c-p(previous)
51
+ - c-a(ahead), c-b(back), c-f(forward), c-e(end)
52
+ - c-n(next)
53
+ - c-d(delete), c-k(kill-line), del
54
+ - c-y(yank, paste)
55
+ * capture画面捕
56
+ Screen capture
57
+ Mac
58
+ whole : Shift + Command + 3
59
+ select: Shift + Command + 4
60
+ window: Shift + Command + 4 , space
61
+ Desktopに保存
62
+
63
+ Windows :
64
+ Win + Shift + S, それからIcon操作
65
+ ピクチャ」->「スクリーンショット」に保存
@@ -0,0 +1,17 @@
1
+ # head
2
+
3
+ - help_title example
4
+
5
+ # license
6
+
7
+ - cc by Shigeto R. Nishitani, 2016-26
8
+
9
+ # a_item
10
+
11
+ - item_short_description
12
+ - content_a
13
+
14
+ # b_item
15
+ ``` python
16
+ print("hello")
17
+ ```
@@ -5,5 +5,15 @@
5
5
  #+EMAIL: (concat "shigeto_nishitani@mac.com")
6
6
  #+LANGUAGE: jp
7
7
  #+OPTIONS: H:4 toc:t num:2
8
- #+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup
8
+ #+SETUPFILE: https://fniessen.github.io/org-html-themes/org/html-theme-readtheorg.setup
9
+
10
+ * head1
11
+ ** head2
12
+ - list
13
+ - [[URL][URL-tag]]
14
+
15
+ #+begin_src ruby
16
+ name = ARGV[0] || 'Rudy'
17
+ puts "Hello #{name}."
18
+ #+end_src
9
19