Code Monkey home page Code Monkey logo

yaml_2_resume_fork's Introduction

YAMLによる履歴書作成

MIT License Ruby Build Status Test Coverage Maintainability

kaityo256氏が開発した yaml_cvのマイクロサービス版です。
YAML形式で書かれたデータファイルと、 YAMLもしくはテキストファイル形式で書かれたスタイル から履歴書PDFファイルを作成します。 Qiita記事はこちら

dockeri.co

Application

DEMO: https://yaml-2-resume.herokuapp.com/

sample/photo.png

インストール&使用

ローカルインストール

必要なライブラリ等

MacOS

依存パケージのインストール

$ brew install imagemagick
$ gem install bundler
$ bundle install

フォントのダウンロード、バージョンは適宜に替えていいです

$ curl https://moji.or.jp/wp-content/ipafont/IPAexfont/IPAexfont00401.zip > fonts.zip
$ unzip -oj fonts.zip -d fonts/ && rm -rf fonts.zip

上記コマンドを使わなくても、ここよりフォントを ダウンロードして、下記の配置になるよう解凍すればいい。

├── fonts
│   ├── ipaexg.ttf
│   └── ipaexm.ttf
└── make_cv.rb

アプリの起動

webアプリとして
$ bundle exec ruby app.rb
$ open http://localhost:4567
また、ローカルではkaityo256/yaml_cvが提供したコマンドも実行できる。
$ ruby make_cv.rb -h
Usage: make_cv [options]
    -i, --input [datafile]
    -s, --style [stylefile]
    -o, --output [output]
    -v, --version
ruby make_cv.rb -i templates/data.yaml -s templates/style.txt -o output.pdf
テストの実行
$ bundle exec rspec

Dockerを使う

純Docker(Webアプリとして)

ローカルでビルドする

$ docker build -t my_yaml_2_resume .
$ docker run --rm -p 14567:4567 my_yaml_2_resume
$ open http://localhost:14567

Docker Hubを利用する

$ docker pull jerrywdlee/yaml_2_resume:latest
$ docker run --rm -p 14567:4567 jerrywdlee/yaml_2_resume
$ open http://localhost:14567

Docker Composeを使う

Webアプリ

$ docker-compose build
$ docker-compose up
$ open http://localhost:14567

CMDモード

share/の配下にご自分のデータを置いて、docker-compose.ymlcommandフィールドを修正して使う。もちろん、templates/配下のサンプルデータも使える。

version: '3.5'
services:
  yaml_2_resume:
    container_name: yaml_2_resume
    build: .
    ports:
      - 14567:4567
    working_dir: /usr/src/app
    volumes:
      - ./share:/usr/src/app/share
    # web app mode
-    command: ruby app.rb -o 0.0.0.0
    # cmd mode
+    command: ruby make_cv.rb -i share/YOUR_DATA.yaml -s share/YOUR_STYLE.txt -o share/output.pdf
$ docker-compose build
$ docker-compose up
$ open ./share/output.pdf

HerokuでDeploy

$ heroku create YOUR-APP-NAME
$ heroku stack:set container
$ git push heroku master

kaityo256/yaml_cvとの変更点

  • data.yamlphotoフィールドは、URLも使えることになった。
  • 提供された画像は向きを補正し、サイズも自動調節することになった。
  • コマンドモードを使う際、data.yamlstyle.txtの中に、erb文法が書けるようになった。
  • data.yaml@dateで現在の年月日を出していて、和暦も使えることになった。
    • セキュリティの観点で、WEB版ではerb文法の利用ができません。
  • data.yamldate: 令和2年1月14日現在 は空白の場合、和暦で本日の日付が入れられます。
  • data.yamlbirth_day Field「日付」はのみ記入した場合、年齢が自動で計算されます。
    • 「日付」の書式については、和暦または西暦が使えます。
  • サンプルデータとスタイルはtemplates/配下に置いた。
  • サンプルデータを当たり障りのない文章に再構成した。
  • サンプル写真をStyleGANで生成された偽の人物像を使用した。

yaml_2_resume_fork's People

Contributors

jerrywdlee avatar kaityo256 avatar tk3fftk avatar

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.