-
Notifications
You must be signed in to change notification settings - Fork 639
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
nip31: template-based "alt" tags for known kinds #1828
base: master
Are you sure you want to change the base?
Conversation
I like it, although it would be nice if we could remove conditionals to keep the parser stupidly simple. Why HTTP instead of publishing templates as events? |
I'm retarded, let's publish templates as events. |
I'm also ok with removing conditionals, they just sounded useful in some cases, but they're probably not worth the hassle. |
+1 for alt templates. But I am against having a list of kinds and templates in this NIP. I find that practice very confusing for people that are implementing other NIPs. Each NIP MUST have its I am also against |
The idea of templates is that they will be just rendered on the client, at the time an event is being displayed. The idea is absolutely not to render these templates and shove them in an In fact in the long run I hope we can get rid of alt tags entirely, at least for the top-1000 most common kinds. But if you got confused about that then I must reword the NIP. |
ohhhh, I misunderstood this. I don't think we need trusted providers. At least I would not use them (I wouldn't send DMs to a server). I would rather prefer a little library that takes any Event object and gives me a string based on hardcoded templates made by the lib author. All local. I was actually going to suggest we move beyond alts and added opengraph tags (image, title, description) to each event so that It can be rendered as a link preview on our apps. The link would then open a third-party app when the user clicks on it. But the more I think about this the more I prefer doing this at the reference level: put the opengraph tags inside the nevent, naddr1 uris so that they can be immediately previewed. |
so is the idea that app developers will write these alt-kind templates? how will rendering clients know which template to use? |
Library authors can do it, but if you're very fancy you can also have a library that fetches from a provider at compile-time. All these modes of operation are suggested in the proposal. The idea behind providers is just that there could be divergence about what exactly to write for each kind and the text style, that kind of thing, but that is probably a very minor concern.
I don't follow the question. Each kind has a template. Client developers decide what templates to use (or they can be super fancy and allow users to pick from a set of options, but this is probably too much). All the information is already in the event itself anyway. Ultimately these templates are just lightweight implementations of a full-blown event view. In some cases they can be almost sufficient, in others they can be just slightly better than nothing, but the idea is that app developers won't have to think about implementing a view for every kind, as with the "alt" tag. |
Clients hardcoding
alt
tags are not very trustworthy.alt
tags tend to be garbage in a long-enough timeframe.This fixes it with hardcoded rich templates that anyone can implement very easily without having to do it manually for each kind.
alt
tags can still be used as a fallback.Readable: https://github.com/nostr-protocol/nips/blob/6b56a0b2063ac60ca3bf720ddd12b3b335f1407b/31.md