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

documentation tab #5

Open
mathieudutour opened this issue Oct 30, 2017 · 5 comments
Open

documentation tab #5

mathieudutour opened this issue Oct 30, 2017 · 5 comments
Labels

Comments

@mathieudutour
Copy link
Member

would it be useful to have a documentation tab?

we could show the headers from https://github.com/abynim/Sketch-Headers, show the docs for the actions, what else?

@julianburr
Copy link

Yeah, this is mainly what I thought of as well. Having the headers in a searchable form right in the panel rather than having to manually search them would save me so much time 😄 ... Other resources could be links to apples docs of objc classes and maybe the Sketch JS API as far as helpful?!

About the Sketch headers, I thought ideally they could be parsed to make the information more accessible for beginners, instead of just showing a plain objc header. It also would be nice to connect this docs panel with the other panels, so e.g. when selecting a logged objc class, you could show the available methods for that class and where they come from inheritance wise ... same goes for the elements tree.

This also ties in with the other proposal you had with the input/playground panel, that lets you run scripts. Being able to quickly access available methods makes experimenting much easier.

@mathieudutour
Copy link
Member Author

yeah I really want to try to parse the headers. Would be useful for so many things, even after documentation (example: skpm/skpm#73 (comment))

@julianburr
Copy link

I wrote a very basic node script that downloads the headers from abynims sketch headers repo (assuming this is a reliable source of truth for the latest headers) and runs them through some regexes to extract the data and put it into json ... nothing special but maybe a helpful first step

https://gist.github.com/julianburr/03b7ef8b0e90f3ae44026f64cb610564

@mathieudutour
Copy link
Member Author

nice!

It's actually pretty easy to generate the headers for both Sketch and macOS: https://github.com/skpm/eslint-config-sketch/blob/master/build.js

We could automate both in a single script to generate everything! I'll take a look tomorrow

@mathieudutour
Copy link
Member Author

mathieudutour commented Nov 10, 2017

I made a repo with a script to generate the headers + parsing them (changed a bit your script to handle protocols as well and merge the different implementations of the classes): https://github.com/skpm/sketch-headers

It's available as an API but what I was thinking is that the script could be run locally by the devTools the first time (and check when we run a new sketch version, in which case we can regenerate the docs)

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

No branches or pull requests

2 participants