Closed HEmile closed 3 years ago
Is this happening for all your annotations or a specific one?
Seems to be happening to all of them!
Hmm, I'm not sure what's causing this. Could you make an example annotation on this page (on the Public group) and let me know if it's still empty? (you'd have to change the gooseberry config group
to Public) I can then download the annotation with the hypothesis CLI as JSON and see if I can spot what's happening.
I made an annotation here. My template is
annotation_template = '''
{{#each highlight}}> [{{this}}]({{incontext}}){{/each}}
{{text}}
{{#each tags}}#{{this}}{{#unless @last}}, {{/unless}}{{/each}}
'''
I can't see it, are you sure it's Public?
Sorry, I think I set it to show only for me. Should work now?
Still can't see it I'm afraid
I tried creating a new one: (I'm an hypothes.is noob, tbh)
Yes, works now! Here is the JSON:
{"id":"fFRTYFsGEeueWGsAsPNqoQ","created":"2021-01-20T10:01:37.786553Z","updated":"2021-01-20T10:01:37.786553Z","user":"acct:HEmile@hypothes.is","uri":"https://github.com/out-of-cheese-error/gooseberry/issues/50","text":"An annotation","tags":[],"group":"__world__","permissions":{"read":["group:__world__"],"delete":["acct:HEmile@hypothes.is"],"admin":["acct:HEmile@hypothes.is"],"update":["acct:HEmile@hypothes.is"]},"target":[{"source":"https://github.com/out-of-cheese-error/gooseberry/issues/50","selector":[{"type":"RangeSelector","endOffset":60,"endContainer":"/div[5]/div[1]/main[1]/div[2]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[2]/div[8]/div[1]/div[2]/div[1]/div[2]/task-lists[1]/table[1]/tbody[1]/tr[1]/td[1]/p[1]","startOffset":0,"startContainer":"/div[5]/div[1]/main[1]/div[2]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/div[1]/div[1]/div[2]/div[8]/div[1]/div[2]/div[1]/div[2]/task-lists[1]/table[1]/tbody[1]/tr[1]/td[1]/p[1]"},{"type":"TextPositionSelector","start":27977,"end":28037},{"type":"TextQuoteSelector","exact":"Sorry, I think I set it to show only for me. Should work now","prefix":" \n\n\n \n \n \n ","suffix":"?\n \n \n \n\n\n\n\n \n"}]}],"links":{"incontext":"https://hyp.is/fFRTYFsGEeueWGsAsPNqoQ/github.com/out-of-cheese-error/gooseberry/issues/50","html":"https://hypothes.is/a/fFRTYFsGEeueWGsAsPNqoQ","json":"https://hypothes.is/api/annotations/fFRTYFsGEeueWGsAsPNqoQ"},"hidden":false,"flagged":false,"references":[],"user_info":{"display_name":null}}
The incontext link is right there, so I'm not sure what's happening! I'll take a closer look.
I could reproduce this now and realized that it's because of the template. For example:
annotation_template = '''
{{#each highlight}}> {{this}}{{/each}}
{{incontext}}
{{text}}
{{#each tags}}#{{this}}{{#unless @last}}, {{/unless}}{{/each}}
'''
works fine but using incontext within the each
doesn't work. I guess this is a problem with the Handlebars templating language - maybe there's a different syntax for it? I don't know the syntax well enough but it should be described somewhere in the docs
Ahh, you're right. It should've been {{#each highlight}}> [{{this}}]({{../incontext}}){{/each}}
. Thanks for the help!
Bug description
I have {{incontext}}| in my annotation template, however, it's being parsed as an empty string.