{"id":21102179,"url":"https://github.com/renyijiu/daily_image","last_synced_at":"2025-05-16T18:34:39.821Z","repository":{"id":59152692,"uuid":"149617649","full_name":"renyijiu/daily_image","owner":"renyijiu","description":"日签 Or 日历，生成一张指定日期的图片，可作为日历。Just For Fun!  👏","archived":false,"fork":false,"pushed_at":"2020-07-05T14:09:52.000Z","size":189,"stargazers_count":38,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-17T06:17:21.606Z","etag":null,"topics":["calendar","gem","image","ruby"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/daily_image","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/renyijiu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-20T13:55:41.000Z","updated_at":"2024-10-30T14:16:34.000Z","dependencies_parsed_at":"2022-09-13T11:01:23.362Z","dependency_job_id":null,"html_url":"https://github.com/renyijiu/daily_image","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renyijiu%2Fdaily_image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renyijiu%2Fdaily_image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renyijiu%2Fdaily_image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renyijiu%2Fdaily_image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renyijiu","download_url":"https://codeload.github.com/renyijiu/daily_image/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225444688,"owners_count":17475354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calendar","gem","image","ruby"],"created_at":"2024-11-19T23:54:19.025Z","updated_at":"2024-11-19T23:54:19.613Z","avatar_url":"https://github.com/renyijiu.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DailyImage\n\n日签 Or 日历，生成一张指定日期的图片，可作为日历。Just For Fun!👏\n\n[PHP实现版本](https://github.com/dolphin836/make-calendar-image)\n[Python版本实现](https://github.com/wnma3mz/Tools/tree/master/daily_image)\n[Android桌面小部件](https://github.com/fairytale110/DailyImageWidget)\n\n## 使用\n\n如果需要在项目中使用，在你的gemfile中添加以下代码\n\n```ruby\ngem 'daily_image'\n```\n\n然后执行下面的命令\n\n    $ bundle\n\n或者，你可以直接安装使用\n\n    $ gem install daily_image\n\n## 使用\n\n### 配置使用\n\n当你需要项目使用时，可以通过下面方式修改默认配置：\n\n```ruby\n\n# 初始项目配置\nDailyImage.configure do |config|\n  config.bg_color = [255, 255, 255]        # 背景颜色\n  config.frame_color = [151, 158, 160]     # 边框颜色\n  config.text_color = [100, 145, 170]      # 文字颜色\n  config.date_color = [100, 145, 170]      # 中间日期颜色\n  config.unused_color = [200, 205, 215]    # 进度条未使用颜色\n  config.used_color = [100, 145, 170]      # 进度条已使用颜色\n  config.out_frame_offset = 15             # 外层边框偏移量\n  config.in_frame_offset = 50              # 下半部分内层边框偏移量\n  config.font = 'Hiragino Sans GB'         # 文字默认字体\nend\n\n# 调用方法\nDailyImage.draw_image(output_path = nil, date = Date.today)           # 默认图片存放地址，包所在的目录; 默认生成为当日\n\n# 例子\nDailyImage.draw_image('./', '2018-09-30')\n```\n\n### 命令行\n\n如果是直接安装，可以通过命令行直接调用。**当然，还是需要安装ruby以及对应的依赖**\n\n```shell\n$ bundle exec daily_image -h\nUsage: daily_image [options]\n\nSpecific options:\n    -b, --bg_color BG_COLOR          the image's background color\n    -r, --frame_color FRAME_COLOR    the image's frame color\n    -t, --text_color TEXT_COLOR      the image's text color\n    -c, --date_color DATE_COLOR      the middle date's text color\n    -n, --unused_color UNUSED_COLOR  unused color of the progress bar\n    -u, --used_color USED_COLOR      used color of the progress bar\n    -o OUT_FRAME_OFFSET,             the outside frame offset\n        --out_offset\n    -i, --in_offset IN_FRAME_OFFSET  the inside frame offset\n    -f, --font FONT                  the text font\n    -s, --output OUTPUT              the output path, save the new image\n    -d, --date Specific date         the date you want to generate\n\nCommon options:\n    -h, --help                       Show the help message\n    -v, --version                    Show version\n\n```\n\n### docker \n\n打包镜像\n\n```shell\n$ docker build . -t ruby-image\n\n```\n\n使用\n\n```shell\n$ docker run -it --mount src=\"$(pwd)\",target=/home,type=bind ruby-image daily_image -s /home/\n```\n\n然后你就可以在当前目录看到新生成的图片文件了\n\n## 示例\n\n![](./tmp/daily_2018-10-06.jpeg)\n\n## 感谢🙏\n\n站在巨人的肩膀上\n\n1. 画图使用了 [ruby-vips](https://github.com/jcupitt/ruby-vips)\n\n2. 诗词来自于 [一言·古诗词 API](https://github.com/xenv/gushici)\n\n## 待完成\n\n- [ ] 使用机器学习生成古诗词，替代一言·古诗词API\n\n## 如何贡献\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n欢迎贡献相关代码或是反馈使用时遇到的问题👏，另外请记得为你的代码编写测试。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenyijiu%2Fdaily_image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenyijiu%2Fdaily_image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenyijiu%2Fdaily_image/lists"}