diff --git a/icm/__init__.py b/icm/__init__.py index 490f6c4..6dc6cab 100644 --- a/icm/__init__.py +++ b/icm/__init__.py @@ -5,7 +5,7 @@ # -- Author Jesús Arroyo # -- Licence GPLv2 -VERSION = (0, 4, 7) +VERSION = (0, 4, 8) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "icm" diff --git a/icm/commands/cmd_update.py b/icm/commands/cmd_update.py index 83917a8..cc5528c 100644 --- a/icm/commands/cmd_update.py +++ b/icm/commands/cmd_update.py @@ -155,6 +155,8 @@ def _generate_readme_string(): version=package["version"].replace("-", "--"), description=package["description"], license=package.get("license"), + # -- Add the header image + header=_create_header(package), # -- Add the logo image logo=_create_logo(package), # -- Add the wiki section @@ -169,6 +171,8 @@ def _generate_readme_string(): languages=_create_languages_section(), authors=_create_authors_section(package), contributors=_create_contributor_section(package), + # -- Add the footer image + footer=_create_footer(package), ) return data @@ -183,12 +187,38 @@ def _create_wiki(package): if package.get("wiki"): url = package["wiki"] data += "## Documentation\n" - data += "Find more information in the " + data += "Find all the information on the " data += f"[WIKI page]({url}) \n" return data +def _create_header(package): + """README: create the markdown string with the header image""" + + data = "" + + # -- Get the header image + if package.get("header"): + file = package["header"] + data += f"![]({file})\n" + + return data + + +def _create_footer(package): + """README: create the markdown string with the footer image""" + + data = "" + + # -- Get the header image + if package.get("footer"): + file = package["footer"] + data += f"![]({file})\n" + + return data + + def _create_logo(package): """README: create the markdown string with the logo""" diff --git a/icm/resources/README.tpl.md b/icm/resources/README.tpl.md index d768bfd..d01d9d2 100644 --- a/icm/resources/README.tpl.md +++ b/icm/resources/README.tpl.md @@ -1,3 +1,5 @@ +$header + # $name Collection [![Icestudio][icestudio-image]][icestudio-url] @@ -25,6 +27,9 @@ $examples $authors $contributors +------- +$footer + [icestudio-image]: https://img.shields.io/badge/collection-icestudio-blue.svg [icestudio-url]: https://github.com/FPGAwars/icestudio