Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generate private addon readmes with markdown fragments #408

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .module-readme.rst.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
{{ manifest.name }}
{{ '=' * manifest.name|length }}

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: {{ source_digest }}
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge_devstat| image:: https://img.shields.io/badge/maturity-{{ development_status | replace("-", "--") | urlencode }}-brightgreen.png
:target: https://odoo-community.org/page/development-status
Expand All @@ -40,7 +43,8 @@
.. contents::
:local:

{{ fragment('INSTALL', 'Installation') }}
{{ fragment('CONTEXT', 'Use Cases / Context') }}
{{- fragment('INSTALL', 'Installation') }}
{{- fragment('CONFIGURE', 'Configuration') }}
{{- fragment('USAGE', 'Usage') }}
{{- fragment('DEVELOP', 'Development') }}
Expand All @@ -52,17 +56,17 @@ Credits

{% if authors -%}
Authors
~~~~~~~
{{ level3_underline * 7 }}

{% for author in authors if author -%}
* {{ author }}
{% endfor %}
{% endif -%}

{{ fragment('CONTRIBUTORS', 'Contributors', sub='~') }}
{{- fragment('CREDITS', 'Other credits', sub='~') -}}
{{ fragment('CONTRIBUTORS', 'Contributors', sub=level3_underline) }}
{{- fragment('CREDITS', 'Other credits', sub=level3_underline) -}}
Maintainers
~~~~~~~~~~~
{{ level3_underline * 11 }}

This module is maintained by {{ org_name }}.

Expand Down
25 changes: 13 additions & 12 deletions .pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,15 @@ repos:
entry: found forbidden files; remove them
language: fail
files: "\\.rej$"
- repo: https://github.com/oca/maintainer-tools
- &maintainer_tools
repo: https://github.com/oca/maintainer-tools
rev: 1070863d1298b1bf373a0e69458dd8a88ab91578
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
args:
- --addons-dir
- odoo/custom/src/private
- repo: https://github.com/oca/maintainer-tools
rev: 1070863d1298b1bf373a0e69458dd8a88ab91578
hooks:
- id: oca-gen-addon-readme
args:
- --addons-dir=odoo/custom/src/private
- --org-name={{ project_author }}
- --repo-name={{ project_name }}
- --gen-html
- --branch={{ odoo_version }}
- --template-filename=.module-readme.rst.j2
- repo: https://github.com/myint/autoflake
rev: v2.2.0
hooks:
Expand Down Expand Up @@ -148,3 +138,14 @@ repos:
args:
- --color
- --fix
- <<: *maintainer_tools
hooks:
# Generate readme is last, so its digest includes changes from above
- id: oca-gen-addon-readme
args:
- --addons-dir=odoo/custom/src/private
- --org-name={{ project_author }}
- --repo-name={{ project_name }}
- --gen-html
- --branch={{ odoo_version }}
- --template-filename=.module-readme.rst.j2