-
Notifications
You must be signed in to change notification settings - Fork 140
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
Switch documentation to JSDoc and Sphinx #997
Conversation
I don't seem to have the |
|
I also had to add
|
@galfert Great, thanks! I also just moved all untouched legacy docs to the same folder/namespace, so that they're all in one place. |
Building and serving the docs works for me now. I just get this warning:
And when browsing the documentation, I can see this in the logs:
Other than that it looks good. Great work @skddc 👍 |
You can just create that |
@galfert I think it would be a good idea if you ported the rest of the public JS API ( |
By the way, we've been lucky with the RTD builds today. Some still failed, but the last 3 passed, so whoever's interested can also preview the current state of the new docs over there: |
Ok, I will give it a try. |
src/remotestorage.js
Outdated
|
||
}; | ||
/** | ||
* TODO: do we still need this, now that we always instantiate the prototype? |
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.
Not sure I get the question, but I think we still need this for enabling/disabling the logging during runtime (i.e. after initial creation of the remoteStorage instance).
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.
Yes, but my question was why would you do that? Or, in other words, did you ever do that yourself? And if so, did you not just do it, because you couldn't instantiate the instance?
It would be lost after a reload, no? So you'd have added a line to your code enabling the logs, instead of using this from a console. And then you might as well add it to the configuration object upon initialization was the point.
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 can't really anticipate all use-cases others might have. I myself used it a few times for debugging, enabling the log for a certain action and then disabling it again so it's not so noisy.
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.
It's not really about anticipating, but more like giving away clothes you haven't used in the last 12 months. Enabling the logs for a certain action and then disabling before reload seems like a rather rare use case to me.
However, adding this function to app code, instead of the init config, and then losing lots of logs without realizing it (which happened to me every time I used it myself) seems like an actual problem we should try to not have people run into.
@galfert I'm pretty sure everything but |
doc/js-api/caching.rst
Outdated
|
||
.. code:: javascript | ||
|
||
remoteStorage.caching.set('/bookmarks/archive') |
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 is missing a strategy, because usually you'd use enable()
if you don't have any explicit setting in mind.
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.
Most functions in Caching
are missing examples. Also, I'm not sure if we should advertise all of them as being useful or even public. Anything public should have an example and enough explanation of how/why to use it, including an example imo.
doc/js-api/caching.rst
Outdated
remoteStorage.caching.set('/bookmarks/archive') | ||
|
||
.. autofunction:: Caching#enable | ||
:short-name: |
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.
Example would be nice.
@galfert Are we actually certain that the caching strategy options are up to date? |
@@ -0,0 +1,46 @@ | |||
Caching | |||
======= |
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 an introductory note that is initialized as remoteStorage.caching
, but only if one doesn't configure caching: false
, would be useful.
I couldn't find anything that would indicate otherwise. |
Note: we decided in the IRC meeting yesterday to merge this asap. I don't see why this couldn't live in master tbh, so one can branch off from that again for all the remaining docs issues. Removing WIP. Still needs rebase tho. |
These will be built and deployed on Read the Docs, so they don't have to clog up the repo.
This way it's easy to see the ones which still need major updates in one place.
Only show methods that are supposed to be for public consumption.
All other methods are not intended for public usage.
I've been working on considerably improving the documentation situation in recent weeks. It's now at a point, where I think other people can and should have a look at it, and any feedback or contributions would be most appreciated.
You can find all relevant information about how the new docs are written and generated in the new docs themselves: https://github.com/remotestorage/remotestorage.js/blob/docs/sphinx/doc/contributing/docs.rst
Warning
Unfortunately, one part of the puzzle is still somewhat missing: Read the Docs haven't updated their build images on all production workers yet, so the building and publishing to what is supposed to be the new public documentation website at https://remotestoragejs.readthedocs.io/ fails most of the time. (See readthedocs/readthedocs.org#3069 for details.)
refs #972, #801, #785, #748, #732, #707
closes #864