Coder Social home page Coder Social logo

nomlab / jay Goto Github PK

View Code? Open in Web Editor NEW
3.0 18.0 15.0 301 KB

Jay is a simple markdown editor for memo and taking minutes

License: MIT License

Ruby 56.26% JavaScript 0.43% CSS 7.67% HTML 2.78% CoffeeScript 18.88% SCSS 2.43% Haml 6.18% Shell 4.66% Dockerfile 0.72%

jay's Introduction

README

What is jay?

jay is a simple markdown editor for memo and taking minutes

Setup Ruby Environment

Ruby3.0.0
Rails6.1.3

I recommend you to install new Ruby and Bundler on the top of Rbenv before install jay.

  1. Install rbenv + ruby-build (check https://github.com/sstephenson/rbenv#basic-github-checkout for details)
    $ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
    $ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
    # Edit your shell dot files to add some path and environment variables.
        
  2. Install Ruby and Bundler
    # Install ruby 3.0.0
    $ rbenv install 3.0.0
    
    # Installation check
    $ rbenv global 3.0.0
    $ ruby -v # -> You will see: ruby 3.0.0...
    
    # Install bundler for your new Ruby
    $ gem install bundler
    
    # Activate bundler
    $ rbenv rehash
    
    # Get back to your system default Ruby if you want
    $ rbenv global system # say, /usr/bin/ruby
    $ ruby -v
        

Install jay

Clone jay

  1. clone jay from github
    $ git clone https://github.com/nomlab/jay.git ~/Programs/jay
        
  2. Setup to use installed ruby
    $ cd ~/Programs/jay
    $ ruby -v # -> You will see: ruby 3.0.0...
        

Setup config files

  1. Install vendor/bundle stuffs
    $ bundle install --path vendor/bundle
        
  2. Setup secret key
    $ bundle exec rake secret # -> You will see: foobarbuz... Copy the string.
    $ vim config/secrets.yml # -> Replace all <SECRETKEY> with the string outputted
        
  3. Initialize application settings from sample
    $ cp config/application_settings_sample.yml config/application_settings.yml
        
  4. Set your github organization
    $ vim config/application_settings.yml
    # Set as the following if your organization name is foobarbuz:
    # default: &default
    #   github:
    #     organization: foobarbuz
        
  5. Setup GitHub OAuth
    1. Register a new OAuth application
      Authorization callback URL
      http://example.com/auth/github/callback
    2. Set client id, client secret, allowed team id
      $ vim config/application_settings.yml
      # Set as the following:
      # default: &default
      #   oauth:
      #     github:
      #       client_id: foo
      #       client_secret: bar
      #       ## allowed_team_id is a github team id adllowed to login.
      #       ## It can be checked by:
      #       ##   curl -u [your-github-account] https://api.github.com/orgs/:org/teams
      #       allowed_team_id: buz
              
  6. Setup incoming webhook
    • GitHub
      1. Generate token
        $ bundle exec rake secret # -> You will see: foobarbuz... Copy the string.
                    
      2. Add webhook to your repository
        Payload URL
        http://example.com/incoming_webhook/github
        Secret
        foobarbuz…
        Which events would you like to trigger this webhook?
        Let me select individual events. -> Issues
      3. Set strategy and token
        $ vim config/application_settings.yml
        # Set as the following:
        # default: &default
        #  incoming_webhooks:
        #    - strategy: github
        #      token: foobarbuz
                    
  7. create master.key
    $ EDITOR='vi' bundle exec rails credential:edit
        
  8. Setup DB
    $ bundle exec rake db:migrate
    $ bundle exec rake db:migrate RAILS_ENV=production
        

Setup by Docker

  1. Clone jay from github
    $ git clone https://github.com/nomlab/jay.git ~/Programs/jay
    $ cd ~/Programs/jay
        
  2. Setup application settings
    1. See above items 3 ~ 6
  3. Setup jay image
    $ ./scripts/setup-docker.sh jay
    # Replace "jay" with the name of user that runs jay container
        

Launch jay

development

# start
$ export RAILS_ENV="development"
$ export RAILS_SERVE_STATIC_FILES=true
$ bundle exec rails server -p 3000 -d -e "$RAILS_ENV"
$ open http://localhost:3000

# stop
$ kill $(cat tmp/pids/server.pid)

production

# start
$ export RAILS_ENV="production"
$ export RAILS_SERVE_STATIC_FILES=true
$ bundle exec rails server -p 3000 -d -e "$RAILS_ENV"
$ bundle exec rake assets:precompile RAILS_ENV="$RAILS_ENV"
$ bundle exec rake assets:precompile:image
$ open http://localhost:3000

# stop
$ kill $(cat tmp/pids/server.pid)

launch production by Docker

# start with foreground
$ ./scripts/jay-docker.sh start

# start with background
$ ./scripts/jay-docker.sh start -d

# stop
$ ./scripts/jay-docker.sh stop

systemd

settings

  1. Copy service file to systemd service directory
    $ sudo cp systemd_conf/jay.service /etc/systemd/system/jay.service
        
  2. Change below settings in service file to suit your environment
    1. Path of jay
    2. Port to bind

launch

# manual start
$ sudo systemctl start jay

# manual stop
$ sudo systemctl stop jay

# check status
$ sudo systemctl status jay

jay's People

Contributors

emiksk avatar hamamoto-j avatar ichikawa85 avatar ikeda-yuko avatar kitagaki avatar kobayashi1027 avatar masafumi0612 avatar matsuo0227 avatar miyake13000 avatar nakazono0424 avatar okada-takuya avatar yoshida564 avatar yoshinari-nomura avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jay's Issues

Listing Minutes は上部に新しい議事録が並ぶようにする.

現在Listing Minutes は新しい議事録が下に追加されているが,今後議事録が増えていく新しい議事録を参照するためには下にスクロールしなければならなくなる.このため,新しい議事録を上部に追加されるようにして欲しい(日付昇順).

「)」(半角閉じ丸括弧)を特定条件で用いた際に txt 出力できない

「)」(半角閉じ丸括弧)を用いた際に,以下の2つの条件を満たすとき txt 出力できない.(firefoxのページ読み込みエラー: ファイルが見つかりませんでした)

  • txt 出力時の折り返しにより2行目になる位置で使用
  • 「)」の直後に半角スペースが入っている

たとえば,txt 出力時に5文字で折り返される場合は,以下のようにすると出力できない.

あああああああ) あああ

jay と GitHub の連携の仕組みを強化する

Created from AI0083 of minute 158.

Story

jay の議事録から作成された issue について,議事録と issue の相互参照を可能にする

Demo

議事録から作成した issue が相互参照できることを確認する

Cost

テキストでレンダリングする機能を実装する

インデントが深すぎるため,2文字程度に浅くする必要がある.
指定した文字数で改行する必要がある.このとき,先頭にきてはいけない文字があった場合,1文字多く取る.
Markdown を テキストにレンダリングする仕組みがある.

Fluentdの設定を行う

Created from AI0020 of minute 107.
以下の2点を設定する

  • jay からの POST を受け入れ可能にする
  • Lastnote にデータを転送する

txt形式に変換時にhtmlタグで囲まれた文字が表示されない

下添え字付きの文字を表現する際に,C<sub>b</sub>のように表記する.
これをtxt形式に変換すると,下添え字が表示されず,Cのみ表示される.
これは,txt形式に変換する際に,htmlタグを消していて,囲まれている文字を含めて消してしまっているためだと考えられる.
txt形式に変換する際にhtmlタグのみを消し,Cbのように表示してほしい.

txt 出力の際,折り返し位置の英文字列が改行されない

  • txt 出力の際,折り返し位置に英文字列が入っていると,その英文字列の終わりまで改行されない.
    • 変換前
      * あいうえおあああ Long english word あいうえおあいうえ
      
    • txt 出力時
      * あいうえお
        あああ Long english word 
        あいうえお
        あいうえ
      

jayの検索フォームで使用するqueryの設計

Created from AI0021 of minute 107.
jayの検索フォームで使用するqueryを設計する.

  • GitHubの実装例を参考に,フォームで使用できるqueryを定義する.
  • :を入力した際にauto completeを有効にする.

ビュレットの調整

ビュレットが文字に食い込んでいる部分があるため,修正する.
通番の表示位置を右寄せにする.

IssueとPRを自動で生成する機能を実装する

comment にしたい部分をハイライトし,Lastnote/#31 をクリックすると対応する Issue にコメントがつく.
description にしたい部分をハイライトし,担当者の名前をクリックすると対応する Issue が作成される.

jayのAPI Hookを実装する

Created from AI0022 of minute 158.

  • config/application_setting.ymlの階層を以下にする.
   incoming_webhooks:
       - strategy: GitHub    
         token: XXXXXXXX
   outgoing_webhooks:
       - url: http://XXXXXXXX
         content_type:
         events:
           - create
  • webhook_actionメソッドは,payloadの中身を単純にPOSTするだけにする.
  • requestのbodyを成形する部分はプライベートメソッドとし,各actionのメソッド内でそのメソッドを呼び出す.
  • 現状,前処理が必要な場面が想定できないため,webhook_action メソッドは around_action からafter_actionに変更する.
  • POSTに失敗し,rescueしたときに nil を返却するのではなく,エラーオブジェクトを返却する.
  • flash にはエラーオブジェクトのメッセージを表示する.

jay と GitHub の連携の仕組みを強化する

Created from AI0025 of minute 107.
(1) 議事録から作成した issue について,相互参照を行いたいという要求がある.
(2) 議事録に存在する[:repo/#:number]から,issueのリンク索引リストを作成し,リンクとして機能させる.
(3) 議事録の宿題から作成した issue へのリンクを作成する方法として次の2点が考えられる.
(A) 議事録の行番号を指定し,アノテーションとしてリンクを作成する.
(B) 議事録の宿題に一意の番号を埋め込み,issue の番号との対応表を作成し,表を基にリンクを作成する.
(4) (3-A)では,議事録が編集されると行番号がずれる問題がある.
(5) (3-B)の方針で実装する.
(6) (3-B)の番号は,すべての議事録に対して一意な番号となるようにする.
(7) (3-B)の番号は,ユーザが割り当てても,システムがランダムに割り当てても良い.
(8) issue から議事録の宿題への参照を可能とするために,以下の2点の処理が必要となる.
(A) markdown から HTML に変換する際に,(3-B)の番号をアンカーとして埋め込む.
(B) (8-A)で埋め込んだアンカーを指すURLを issue のコメントに書き込む.
(9) issue 作成のモーダルで「OK」をクリックした時に,GitHub API を用いて issue を作成する.
(10) webhook を用いて宿題から作成した issue の情報を取得し,対応表に書き込む.
(11) 議事録を表示する際は,対応表から,宿題に割り当てられた番号を issue 番号に書き換える.
(12) TODO は以下の4点である.
(A) 議事録から issue のリンク索引リストを自動生成させる.
(B) 議事録の宿題に番号を割り振り,その番号から HTML にアンカーを自動で埋め込む.
(C) GitHub API を用いて,jay から issue を作成する.
(D) 議事録の宿題から issue への参照を可能とする.
(a) webhook を用いて,issue と アンカー番号の対応表を作成する.
(b) 対応表からアンカー番号を issue 番号に書き換える.

txt出力の際,資料名の改行でインデントが入らない

  • txt 出力の際,箇条書きの文章の改行にはインデントが入るが,資料の名前で改行される場合にインデントが入らない.
    • 変換前
      * [No.xxx-xx] :: ああああああああああああああああああ(名前)
      
    • txt 出力時
      * [No.xxx-xx] :: ああああああああああああ
        ああああああ(名前)
      

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.