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

Best way to document a schema? #18

Open
otherjoel opened this issue Feb 3, 2020 · 3 comments
Open

Best way to document a schema? #18

otherjoel opened this issue Feb 3, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@otherjoel
Copy link
Contributor

How would you go about writing Scribble docs for a deta schema? Use defstruct and add a caveat that it’s not actually a vanilla struct? Or just document the make- id function?

It would be neat if there was a defschema form for Scribble, but I can see why it might not be high on the list.

@Bogdanp
Copy link
Owner

Bogdanp commented Feb 4, 2020

I haven't thought much about this yet, because I mostly use deta in private applications. I agree that a defschema would be neat. I don't think I'll get to that any time soon since it's not a priority for me, but I'd be happy to accept any changes toward that end!

@Bogdanp Bogdanp added the enhancement New feature or request label Feb 4, 2020
@otherjoel
Copy link
Contributor Author

otherjoel commented Feb 8, 2020

I took a look at the source for defstruct and, well, let’s say it gave me pause.

@otherjoel
Copy link
Contributor Author

Update: Using defstruct* with the #:constructor-name argument actually works very well. It produces Scribble reference link/bindings for the getters, setters, type predicate and constructor.

Example: https://thelocalyarn.com/code/uv/scribbled/cache-rkt.html#%28part._.Schema%29

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

No branches or pull requests

2 participants