CC: Tweaked

CC: Tweaked

42M Downloads

Fleshing out examples

SquidDev opened this issue · 5 comments

commented

One massive thing the current docs are missing right now is any good set of examples. For instance, the fs API doesn't have a single one, despite being a core bit of functionality!

It'd be nice to have short (1-5 lines) examples for most "interesting" functions. Ideally all these examples would be self contained - there's definitely some existing examples which are pretty nonsensical on their own.

The examples both on the cc.cc and cc.info wikis are pretty good, so I imagine they can be sourced from there.


There's some cases where the examples are much longer (20 lines). We probably want to avoid including them in doc comments - in these cases I suspect we want a system within illuaminate to embed external files. This would have also been useful for #553, so probably worth doing (though not really part of this issue).

commented

I know this is an old post but is there still a lot of stuff undocumented?

commented

There's a couple of modules with some undocumented definitions (io, window). However, there's definitely still lots of things whose documentation could be fleshed out or examples added.

commented

I'm going to close this, as I don't really think it's an issue we can ever say is done. I think instead it's better that if people find examples they'd like (or existing ones which are bad), please do create an issue (or even better, PR them!)

commented

It occurs to me that it might also be worth allowing something like Plethora does for longer examples. I'm quite partial to the more "literate" style of longer examples (but not sure how useful it is for others).

commented

Just copying the local checklist I have into something more useful:

APIs

  • fs
  • io
  • os - time functions
  • paintutils
  • parallel
  • rednet
  • vector
  • window

Modules

  • cc.expect
  • cc.image.nft - download from a website instead of loading a (non-existent) local image.
  • cc.pretty - just ensure docs are well defined.
  • cc.require - current example is fine, but should demonstrate using env.require.
  • cc.shell.completion
  • cc.completion - ensure current docs are well defined.