Giter Club home page Giter Club logo

image_updater_for_shiba's Introduction

Image updater for Shiba

概要

  • Shibaでプレビュー中に画像を差し替えても反映されない
  • imgタグの挙動からすると仕方ない
  • src属性を変化させると画像が更新されるらしい
  • 画像の変更を監視してsrc属性にクエリパラメータをつけてやればいい
  • Shibaを修正しようと試みたがビルドすら通せなくて断念
  • 対象のMarkdownファイルが更新されたとき, 画像のURLにクエリパラメータを付加したURLに書き換えたMarkdownファイルを生成して, それをShibaに読み込ませるという操作をシェルスクリプトでやらせることにした

起動

npm install Shiba  # shiba コマンドのパスが通っていれば他の方法で入れてもよい
brew install fswatch
./watch sample.md

動作確認

起動を行った状態で,

cp yakisanma.png sanma.png

または、

cp namasanma.png sanma.png

とすると、サンマの画像が差し替わる。

ライセンス

Public Domain

ただし、以下のファイルを除く。

  • namasanma.png
  • sanma.png
  • yakisanma.png

これら3つのファイルはいらすとやの利用規約に従い再配布しているものであり, 当レポジトリの所有者の著作物ではありません。

image_updater_for_shiba's People

Contributors

miminashi avatar

Watchers

 avatar James Cloos 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.