documentation icon indicating copy to clipboard operation
documentation copied to clipboard

False documentation

Open dninet opened this issue 5 years ago • 12 comments

  • I'm submitting a ...

    • [x] bug report
    • [ ] feature request
  • Do you want to request a feature or report a bug? bug

  • What is the current behavior? In https://github.com/plone/documentation/blob/0ea1b1f715e9031a434d72f57c189f25aa1f4b73/develop/addons/bobtemplates.plone/README.rst : 31 it says the following:

To create a package like ``collective.myaddon``::

    $ mrbob -O collective.myaddon bobtemplates.plone:addon

You can also create a package with nested namespace::

    $ mrbob -O collective.foo.myaddon bobtemplates.plone:addon

These commands don't work and should be $ mrbob bobtemplates.plone:addon -O collective.myaddon respectively $ mrbob bobtemplates.plone:addon -O collective.foo.myaddon

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem It's just a false bit of documentation.

  • What is the expected behavior? That the instructions are correct and have the desired effect.

  • What is the motivation / use case for changing the behavior? Not wasting time to find out why the commands above don't work.

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc) No.

dninet avatar Apr 18 '19 09:04 dninet

@AlbertDavid94 - it should work because the output directory is a named param and could be in either position. For example mrbobs docs and the training are using the same order as written here originally. (https://training.plone.org/5/mastering-plone/eggs1.html#creating-the-package, https://mrbob.readthedocs.io/en/latest/userguide.html#remember-answers-to-a-config-file). What exactly is the error you get?

staeff avatar Apr 18 '19 10:04 staeff

@staeff I've gotten multiple different errors and after trying various combinations, I've decided to google for hints whether someone had encountered this error before.

I found this https://github.com/plone/bobtemplates.plone/issues/277 and tried the suggested combination. It seemed to work..

dninet avatar Apr 18 '19 10:04 dninet

@AlbertDavid94 - but the issue you are pointing to is slightly different. Position should not matter.

The poster of the issue uses a command thats bobtemplates.plone pre 2.0.0:

$ mrbob -O my.package bobtemplates:plone_addon

and the command in the solution is (I edited names and changed order to emphasize the difference)

$ mrbob -O my.package bobtemplates.plone:addon

the training page I linked shows the old version in a note (https://training.plone.org/5/mastering-plone/eggs1.html#creating-the-package).

What errors did you encounter?

staeff avatar Apr 18 '19 10:04 staeff

@staeff Your first command results in

Traceback (most recent call last):
  File "/home/albert/.local/bin/mrbob", line 11, in <module>
    sys.exit(main())
  File "/home/albert/.local/lib/python3.6/site-packages/mrbob/cli.py", line 155, in main
    defaults=defaults)
  File "/home/albert/.local/lib/python3.6/site-packages/mrbob/configurator.py", line 138, in __init__
    self.template_dir, self.is_tempdir = parse_template(template)
  File "/home/albert/.local/lib/python3.6/site-packages/mrbob/configurator.py", line 92, in parse_template
    path = resolve_dotted_path(template_name)
  File "/home/albert/.local/lib/python3.6/site-packages/mrbob/configurator.py", line 40, in resolve_dotted_path
    return os.path.join(os.path.dirname(module.__file__), dir_name)
AttributeError: module 'bobtemplates' has no attribute '__file__'

dninet avatar Apr 18 '19 10:04 dninet

okay, looks like that error. Could you paste your command?

staeff avatar Apr 18 '19 10:04 staeff

@staeff mrbob -O my.package bobtemplates:plone_addon

dninet avatar Apr 18 '19 11:04 dninet

Yap - use this. Its a subtle diffrence :)

mrbob -O my.package bobtemplates.plone:addon

staeff avatar Apr 18 '19 11:04 staeff

@staeff Maybe it's a good idea to change the sequence of commands in this documentation? I didn't look further and thought that, if the first command isn't going to work, I won't need to try to attempt the second command.

dninet avatar Apr 18 '19 11:04 dninet

This page (for example) also gives wrong information on how to create a theme..

dninet avatar Apr 18 '19 11:04 dninet

You are right. The page is outdated. I think, there will be a few more things to update there, I'll have a look.

I don't understand your comment about the first and second command. On the docs page you mentioned originally in this ticket, all commands are working with bobtemplates.plone >= 2.0.0. The "wrong" command is coming from the ticket. It might be a good idea though, to mention the caveat that the templates used to work differently (as the training material does)

staeff avatar Apr 18 '19 12:04 staeff

Well, the documentation is written as if it's partially a tutorial. I tried the first command first to see what effects it had but by giving me an error, I didn't bother to try the second command.

dninet avatar Apr 18 '19 12:04 dninet

I am still lost. Are we talking about this document: https://github.com/plone/documentation/blob/0ea1b1f715e9031a434d72f57c189f25aa1f4b73/develop/addons/bobtemplates.plone/README.rst ?

staeff avatar Apr 18 '19 13:04 staeff

Closing as not reproducible. Please reopen or create a new issue in the correct repo.

stevepiercy avatar Sep 07 '22 11:09 stevepiercy