a-know / Pixela

A service for generating GitHub-like graphs. Record and Track your habits or effort. All by API.

Home Page:https://pixe.la

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to properly render svg on markdown of GitHub

serima opened this issue · comments

I write it in README.md as follows, but it becomes png output on GitHub side.
I am using the API of increment, but the graph is not updated.

How do I write it for rendering correctly?

![GameWith-Pixela](https://pixe.la/v1/users/<username>/graphs/<graphid>)
<img src="https://pixe.la/v1/users/<username>/graphs/<graphid>">

@serima
Thanks for your feedback!

I am also aware of the behavior that feedback. (see(in Japanese): https://twitter.com/mattn_jp/status/1052197970173550593 )

In GitHub, it seems that all images referenced from GitHub are forcibly cached by GitHub.
And this behavior seems to be based on that specification.

The cache of GitHub seems to be able to be purged by http purge request. (see (in Japanese) :
https://qiita.com/mpyw/items/16b693cb62820b480ce2 )
Even in Pixela, I intend to be able to send a purge request each time the graph is updated.

I already have started, so please wait a little more...!

Thanks!

Even in Pixela, I intend to be able to send a purge request each time the graph is updated.

That's cool. Does the user need something work?
I am waiting for the release 👍

@serima
Sorry I made you wait! We addressed this problem.
https://github.com/a-know/Pixela/releases/tag/v1.1.0

Does the user need something work?

Yes. It is necessary to do the following work.

  1. When an image is cached in GitHub, a URL is generated for each cached image.( https://camo.githubusercontent.com/... )Please keep track of that URL.
  2. Since you can specify purgeCacheURLs by PUT /v1/users/<username>/graphs/<graphID> API, record the URL you grasp in 1.
    • For details on the API, refer to API reference.
  3. Then the cache of GitHub will be purged every time the graph is updated. (Super-reload seems necessary on the browser side, too.)

Please, try it! 😄

@a-know Thanks! it seems to be working fine 👍