-
Notifications
You must be signed in to change notification settings - Fork 324
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
CIP-0100 | Add index and hash to references
and allow for basic HTML tags
#748
Conversation
|
||
For downstream tooling we define a reduced supported set of HTML tags which can be included in freefrom text fields. | ||
|
||
| Tag | Description | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please people feel free to suggest more :)
Also is HTML the method we want to use, could use the markdown ones like **bold text**
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of incorporating this into the base CIP, shouldn't this be an extension that redefines these fields as able to support HTML?
If it's just what's allowed, then free-form text already allowed HTML; if it's what we expect tooling to support in some way order to be compliant, then this is lifting the lowest common denominator of what tools can be built.
Whereas the whole point of the context was for feature negotiation; a very minimal metadata browser, for example, might just show raw text, and fall back to showing raw data for any fields it doesn't recognize.
Also, why HTML over the much more industry standard markdown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why HTML over the much more industry standard markdown?
one justification: because there is one convergent definition of HTML while the "industry standard" of Markdown has produced a bunch of flavours with irreconcilable special features. Those special features in Markdown come from special symbol behaviour, while HTML is always delineated with tag symbols which can be specifically whitelisted herein.
Generally (and maybe even more relevant for blockchain histories), if I had to produce a richly formatted document to go into a time capsule to be readable and/or parseable in 100 years I would rather it be in HTML than any other format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't actually feel that that's the case, except in some extreme niche features; for the most part, people have standardized on github flavored markdown.
The reason I'd argue for GHMD over html, is that it's a lot easier for someone (especially non-technical users) to write in a textbox, and it's also a lot less confusing to read if you're looking at the raw data without the formatting applied.
Even if you know nothing about markdown, asterisks around a word are pretty intuitively indicative of emphasis, while <b>Some word</b>
could be confusing to someone very non-technical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I'd argue for GHMD over html, is that it's a lot easier for someone (especially non-technical users) to write in a textbox, and it's also a lot less confusing to read if you're looking at the raw data without the formatting applied.
This is a good point, id be in favour of adopting this, via CIP-108.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ryun1 @Quantumplation yes, Markdown in hindsight I do think would be better. I was thinking last night in terms of generality but today in terms of failure modes... mainly what happens if the markup isn't rendered. As also suggested in #748 (comment) the non-rendered Markdown is more readable than non-rendered HTML.
|
||
For downstream tooling we define a reduced supported set of HTML tags which can be included in freefrom text fields. | ||
|
||
| Tag | Description | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of incorporating this into the base CIP, shouldn't this be an extension that redefines these fields as able to support HTML?
If it's just what's allowed, then free-form text already allowed HTML; if it's what we expect tooling to support in some way order to be compliant, then this is lifting the lowest common denominator of what tools can be built.
Whereas the whole point of the context was for feature negotiation; a very minimal metadata browser, for example, might just show raw text, and fall back to showing raw data for any fields it doesn't recognize.
Also, why HTML over the much more industry standard markdown?
@@ -180,8 +190,12 @@ The following properties are considered common to all types of transactions, and | |||
- `references` | |||
- An array of objects | |||
- Each object specifies a `@type`, which is either "GovernanceMetadata" or "Other" | |||
- Each object specifies a unique integer `index` field value which increases without gaps from `0`. This is to act as a unique referable ID which can be mentioned in via other fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be better achieved using the @list
keyword on the container: https://www.w3.org/TR/json-ld/#representing-lists-as-arrays
i.e. just express that the references
are ordered, and use their natural index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might even specify that we use @set
keyword, then use something else to reference
- Each object specifies a `label`, which serves as a human readable display name | ||
- Each object specifies a `uri`; when the type is set to "GovernanceMetadata", the URI should point to another CIP-0100 compliant document | ||
- Each object MAY have a OPTIONAL `uriHash` object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to add these to the context and schema.
We should also define a time where we're cutting off all further changes (barring mistakes / errors) to CIP-100; This could be a separate CIP which defines the context for this addition, for example, that was the whole point of using JSON-LD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to add these to the context and schema.
Will do, but wanted to get confirmation on people's opinion on these changes first.
We should also define a time where we're cutting off all further changes (barring mistakes / errors) to CIP-100; This could be a separate CIP which defines the context for this addition, for example, that was the whole point of using JSON-LD.
Yes, I did only make a PR because I don't believe there are any implementations of CIP-100 yet, so thought id try to sneak in these changes.
Thinking about it more, with @Quantumplation's insights 🙏 I will move the HTML/Markdown out of this CIP, as they really only apply to longer form text, which is what CIP-108 adds. I will keep the suggestion of adding the |
@Ryun1 I'd also suggest making sure to specify html (or markdown) on a field by field basis; otherwise you end up with like, the authors name having html in it, as that's "free form text" heh |
Good call! |
For ease, I am just going to add these additions via CIP-108 |
Changes
references
field.references
field.cc: @Quantumplation