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

Tagger: fail on accentuated words #304

Open
renard opened this issue Nov 21, 2015 · 4 comments
Open

Tagger: fail on accentuated words #304

renard opened this issue Nov 21, 2015 · 4 comments

Comments

@renard
Copy link

renard commented Nov 21, 2015

If you tag an article with an accentuated word (Réseau for example) the tagger plugin will fail:

16:44:07 hyde Error occured when calling tagger
Traceback (most recent call last):
  File "/usr/local/bin/hyde", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/hyde/main.py", line 11, in main
    Engine().run()
  File "/usr/local/lib/python2.7/site-packages/commando/application.py", line 309, in run
    args.run(self, args)
  File "/usr/local/lib/python2.7/site-packages/hyde/engine.py", line 102, in gen
    gen.generate_all(incremental=incremental)
  File "/usr/local/lib/python2.7/site-packages/hyde/generator.py", line 213, in generate_all
    self.events.begin_site()
  File "/usr/local/lib/python2.7/site-packages/hyde/plugin.py", line 95, in __call_plugins__
    plugin.plugin_name, sys.exc_info())
  File "/usr/local/lib/python2.7/site-packages/hyde/plugin.py", line 91, in __call_plugins__
    res = function(*args)
  File "/usr/local/lib/python2.7/site-packages/hyde/ext/plugins/meta.py", line 317, in begin_site
    self._process_tags_in_resource(resource, tags)
  File "/usr/local/lib/python2.7/site-packages/hyde/ext/plugins/meta.py", line 359, in _process_tags_in_resource
    tag=tag)
  File "/usr/local/lib/python2.7/site-packages/hyde/util.py", line 23, in add_method
    m = make_method(method_name, partial(method_, *args, **kwargs))
  File "/usr/local/lib/python2.7/site-packages/hyde/util.py", line 13, in make_method
    method__.__name__ = method_name
hyde.exceptions.HydeException: Error occured when calling tagger

As far as I can investigate, the make_method is in cause.

I see 2 options:

  • Either sanitize the method name in make_method
  • Or adding an internal "safe name" property for a tag object.

I cannot find a decent documentation on how it works and what would be the impacts of one or the other solution.

Please be aware this is a big issue since an article cannot be correctly tagged.

Thanks in advance.

@navilan
Copy link
Member

navilan commented Nov 21, 2015

@renard - Sorry about the lack of documentation. Might be rectified soon.

As far as the issue is concerned, you can think of the tag names as variables - as in they need to be the safe name you mention. For displaying the tag, you can use an attribute in site.yml. This has the additional benefit of making the tag translatable as well.

See vincent bernat's site configuration for example.

@fergyfresh
Copy link

can you not tag a post? I am currently getting the same error since I deleted all the tags. Now I cannot hyde gen. HAAAALP

@navilan
Copy link
Member

navilan commented Nov 28, 2015

@fergyfresh - You can simply remove the tagger plugin from site.yaml to avoid tagging.

But, do take a look at the link in my previous comment. Its straightforward to have tag descriptions.

@fergyfresh
Copy link

Yeah I figured that out, thanks though!

On Fri, Nov 27, 2015, 9:53 PM Lakshmi notifications@github.com wrote:

@fergyfresh https://github.com/fergyfresh - You can simply remove the
tagger plugin from site.yaml to avoid tagging.

But, do take a look at the link in my previous comment. Its
straightforward to have tag descriptions.


Reply to this email directly or view it on GitHub
#304 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants