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

Add plonecli/bobtemplates.plone compatible markers and configuration #63

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 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
4 changes: 4 additions & 0 deletions backend_addon/{{ cookiecutter.__folder_name }}/.mrbob.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[variables]
package.dottedname = {{ cookiecutter.python_package_name }}
package.browserlayer = IBrowserLayer

31 changes: 31 additions & 0 deletions backend_addon/{{ cookiecutter.__folder_name }}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,37 @@ And to create the Plone site:
make create_site
```

## Add features using `plonecli` or `bobtemplates.plone`

This package provides markers as strings (`<!-- extra stuff goes here -->`) that are compatible with [`plonecli`](https://github.com/plone/plonecli) and [`bobtemplates.plone`](https://github.com/plone/bobtemplates.plone).
These markers act as hooks to add all kinds of subtemplates, including behaviors, control panels, upgrade steps, or other subtemplates from `plonecli`.

To use them, you need to use `bobtemplates.plone` version X.X.X or later, and run the following command.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update the version number here. The current version of bobtemplates.plone is 6.3.3. Is this feature already in a release or a future one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No yet, there's a pending PR on bobtemplates.plone to be able to use these changes.


```shell
plonecli add -b .mrbob.ini content_type
```

The command passes the `.mrbob.ini` configuration file to `plonecli` to set some configuration variables which are needed to properly run the subtemplates.

For example, you can add a behavior to your package with the following command.

```shell
plonecli add -b .mrbob.ini behavior
```

You can add a control panel with the following command.

```shell
plonecli add -b .mrbob.ini controlpanel
```

```{seealso}
You can check the list of available subtemplates in the [`bobtemplates.plone` `README.md` file](https://github.com/plone/bobtemplates.plone/?tab=readme-ov-file#provided-subtemplates).
See also the documentation of [Mockup and Patternslib](https://6.docs.plone.org/classic-ui/mockup.html) for how to build the UI toolkit for Classic UI.
stevepiercy marked this conversation as resolved.
Show resolved Hide resolved
```


## Contribute

- [Issue Tracker](https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.python_package_name }}/issues)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[main]
version = 6.0.13
template = plone_addon
git_init = True
python = python3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessarily a blocker, but would it be possible to add support for mr.bob/bobtemplates.plone to get their settings from pyproject.toml, so that we don't need more config files?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that there's no problem with that. Would you mind adding an issue in bobtemplates.plone repo?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
file="permissions.zcml"
/>


<include file="dependencies.zcml" />
<include file="profiles.zcml" />
<include file="permissions.zcml"/>

<include package=".controlpanel" />
<include package=".indexers" />
Expand All @@ -21,4 +23,6 @@
{%- endif %}
<include package=".vocabularies" />

<!-- -*- extra stuff goes here -*- -->

</configure>
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
i18n_domain="{{ cookiecutter.python_package_name }}"
>

<!-- -*- extra stuff goes here -*- -->

</configure>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

<!-- Indexers/Metadata -->

<!-- -*- extra stuff goes here -*- -->

</configure>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="{{ cookiecutter.python_package_name }}"
>

<!-- -*- extra stuff goes here -*- -->

</configure>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<object name="portal_controlpanel">

<!-- -*- extra stuff goes here -*- -->

</object>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<registry
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="{{ cookiecutter.python_package_name }}">

<!-- -*- extra stuff goes here -*- -->

</registry>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<rolemap>
<permissions>

<!-- -*- extra stuff goes here -*- -->
</permissions>
</rolemap>
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
</genericsetup:upgradeSteps>
-->

<!-- -*- extra stuff goes here -*- -->

</configure>
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<configure xmlns="http://namespaces.zope.org/zope">

<!-- -*- extra stuff goes here -*- -->

</configure>