teoxoy / profile-readme-stats

Showcase your github stats on your profile README.md
https://github.com/marketplace/actions/profile-readme-stats
MIT License
257 stars 87 forks source link

TEMPLATE -> README style makes it difficult to use together with other profile actions #1

Closed nil0x42 closed 3 years ago

nil0x42 commented 3 years ago

Using profile-readme-stats is difficult for people using multiple github actions (such as blog-post-workflow).

The template completely replaces the README, so changes made by another action will be lost.

An alternative would be to use delimiters in the README:

<!-- README-STATS:START -->
<!-- README-STATS:END -->

This can also be made backwards-compatible with current behavior: If delimiters are present, put generated template content inside, otherwise, replace the whole README

Thank you !

teoxoy commented 3 years ago

So, you are proposing that the string templates should be part of the README and should be commented out so that they won't appear in the rendered markdown?

That would not work in cases where you want the result of a string template to be part of an url because the commented string templates will also become part of the url.

Another way to fix this, would be to include all your other actions templates in the TEMPLATE file (i.e. move <!-- README-STATS:START --> and <!-- README-STATS:END --> in the TEMPLATE file).

Let me know if that works.

nil0x42 commented 3 years ago

My suggestions was to have a README like this:

Hello :),
### Here are my stats generated by profile-readme-stats:
<!-- README-STATS:START -->
<!-- README-STATS:END -->
Love coding <3

Then profile-readme-stats, instead of replacing the entire README with template, would only replace everything that's betweet <!-- README-STATS:START --> and <!-- README-STATS:END --> with content generated from TEMPLATE.md. This way, the content before and after delimiters is not touched.

Or course your solution of putting everything in template works, but it's not convenient as there is a need of reconfiguring ALL other existing github actions.

teoxoy commented 3 years ago

Oh, I see what you mean but that would restrict the usage of the string templates to one block of text.

Putting everything in the TEMPLATE file doesn't require changing the configuration of the other actions though.