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

Store Id field #97

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

kellrott
Copy link

Make the id field from schema doc visible to user. This PD adds the Id field to schema struct and populates it using draft.getID method. Otherwise, the contents of the id field is not visible.

@santhosh-tekuri
Copy link
Owner

  • rename Id to ID

You are saving id from schema document as it is. in schema id can be relative also.
I am thinking it would be better to store absolute id in struct.

@kellrott
Copy link
Author

Renaming Id to ID should be easy. Do you have any thoughts on the best way to resolve the global URL and append the id?

@santhosh-tekuri
Copy link
Owner

currently id is computed and stored in resource.url see draft.go:80. but here also we don't store the anchor in resource.url. anchors are calculated on demand see Draft.anchors method

you can combine resource.url+'#'+anchor to compute id. it is little bit involved.
I do not see anyone has an use case where they need ID. I don't find any compelling reason to add additional time to compilation just to compute this field

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

Successfully merging this pull request may close these issues.

None yet

2 participants