adafruit / cookiecutter-adafruit-circuitpython

Cookiecutter template for Adafruit's CircuitPython libraries.
MIT License
22 stars 37 forks source link

Please test: Update chat badge and .gitignore #181

Closed kattni closed 2 years ago

kattni commented 2 years ago

Updating to Adafruit Discord chat badge for Adafruit bundle only.

Updated the top-level cookiecutter .gitignore to match the globally updated .gitignore, with a couple of extras from the original that look cookiecutter-specific.

Please test that this generates properly for both the Adafruit and Community library options before merging. Thanks!

kattni commented 2 years ago

@askpatrickw Hmm. Any idea how to resolve that?

askpatrickw commented 2 years ago

I think the syntax is to use {%- and\or -%} like in these lines:

https://github.com/adafruit/cookiecutter-adafruit-circuitpython/blob/main/%7B%7B%20cookiecutter%20and%20'tmp_repo'%20%7D%7D/%7B%25%20if%20cookiecutter.library_prefix%20%25%7D%7B%7B%20cookiecutter.library_prefix%20%7C%20lower%20%7C%20replace(%22%20%22%2C%20%22_%22)%20%7D%7D_%7B%25%20endif%20%25%7D%7B%7B%20cookiecutter.library_name%20%7C%20lower%20%7C%20replace(%22%20%22%2C%20%22_%22)%20%7D%7D.py#L39

kattni commented 2 years ago

@askpatrickw I'm unclear on exactly how to adapt this. I asked Tim about it on Discord and he thinks it might be the following change in the endif:

{%- if cookiecutter.target_bundle == 'Adafruit' %}
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/blob/main/badges/adafruit_discord.svg
{%- else %}
.. image:: https://img.shields.io/discord/327254708534116352.svg
{%- endif %}

If that's not it, can you clarify? There are a lot of options in the code you linked, and I'm not sure exactly what is doing what.

askpatrickw commented 2 years ago

Nope... ;-) @kattni, I have some time, I'll look at this in a bit and give you the fix.

kattni commented 2 years ago

@askpatrickw Thank you so much!

askpatrickw commented 2 years ago

@kattni OK I tested that and commited into your PR. @FoamyGuy if you want to be the final reviewer, that would be great.

kattni commented 2 years ago

@askpatrickw Thank you again for all your help here! I really appreciate it.