Dash Ver.2로 CheatSheet 혼자 만들기!상당히 좋다!

5261 단어 DashMac
Mac에서 다양한 참고 자료를 조회할 수 있으며 Dash 이미 비교적 큰 업데이트가 진행되었다.
어쨌든 눈동자 기능은 Chaeat Sheet으로 참고가 아니라 이른바 비슷한 지령집 같은 것을 열람할 수 있다.
그리고 이 Chaeat Sheet은 루비의 DSL로 간단하게 혼자만의 물건을 만들 수 있다.이번에는 그 방법을 설명해 드리겠습니다.

전제 조건

  • OSX 10.9
  • Xcode Command Line Tools(필수)
  • CheatSheet 제작 단계


    후술한 순서대로 루비 파일을 쓰면 이런 cheatheet을 만들 수 있습니다!이번에는 깃 커맨즈라는 지령집을 만들었다.
    (왼쪽 목록에 있는 Git Commands의 Git는 기본적으로 준비된 영어 cheatheet)

    CheatSheet을 만들기 위해 다음 동작을 수행합니다
    $ sudo gem install cheatset # dashが読み込むdocsetファイルの生成に必要
    $ xcode-select --install # Xcode Xcode Command Line Toolsをインストールしていない場合は実行
    $ vim git_commands.rb # チートシートのファイル名(任意)。ファイルの内容は後述
    $ cheatset generate git_commands.rb # docsetファイルに変換
    # cheatset command not foundのようなことを言われる場合は source .zshrcなりターミナルを閉じるなりしてからコマンド再実行
    $ open git_commands.docset # 生成されたdocsetをdashに読み込む
    

    CheatSheet 컨텐트


    라벨의 내용은 루비의 DSL로 기술되어 있습니다.일본어도 돼요.다음 내용 중 캡처와 같은 내용을 생성합니다.
    git_commands.rb
    cheatsheet do
      title 'Git Commands'
      docset_file_name 'git_commands'
      keyword 'git'
      source_url 'http://cheat.kapeli.com'
    
      category do
        id 'コミット'
    
        entry do
          name '部分的にコミット'
          notes <<-'CODE'
            ```bash
            $ git add -p hoge.txt
            ```
          CODE
        end
      end
    
      category do
        id '変更を退避'
    
        entry do
          name '変更を一時退避'
          notes <<-'CODE'
            ```bash
            $ git stash
            ```
          CODE
        end
    
        entry do
          name '変更に名前をつけて退避'
          notes <<-'CODE'
            ```bash
            $ git stash save 'hogehoge'
            ```
          CODE
        end
    
        entry do
          name 'stashを一覧表示'
          notes <<-'CODE'
            ```bash
            $ git stash list
            ```
          CODE
        end
    
        entry do
          name '最新のstashを復元'
          notes <<-'CODE'
            ```bash
            $ git stash pop
            ```
          CODE
        end
    
        entry do
          name '特定のstashを復元'
          notes <<-'CODE'
            ```bash
            $ git stash pop stash@{1}
            ```
          CODE
        end
      end
    end
    

    참조 페이지

  • https://github.com/Kapeli/cheatsheets#readme
  • https://github.com/Kapeli/cheatset#readme
  • https://github.com/Kapeli/cheatsheets/tree/master/cheatsheets
  • 좋은 웹페이지 즐겨찾기