-
Notifications
You must be signed in to change notification settings - Fork 93
Draft: Preliminary work on JSON-RPC docs #600
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
Conversation
| --- | ||
|
|
||
| # JSON-RPC interface | ||
|
|
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.
As I assume this page will grow in time (and is already quite extensive), you may want to add a table of contents.
| {:.no_toc} | |
| This manual documents the JSON-RPC-based protocol by which you can control the Jamulus client and server. | |
| <details markdown="1"> | |
| <summary>Table of contents</summary> | |
| * TOC | |
| {:toc} | |
| </details> |
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.
@gilgongo I am thinking about whether we need an extensive documentation for JSON-RPC at all…
My concern is that this would double the work required to make changes to the JSON-RPC interface. First you would need to make changes in jamulus project, and then you would need to document the method here in jamuluswebsite.
I think that adds substantial maintenance burden. I want to avoid having to make changes to 2 repositories and filing 2 PRs. So, upon second thought, I am thinking of doing either of these:
-
Point the reader to read
clientrpc.cppandserverrpc.cpp. Since the code is quite self-documenting already, it may be a redundant to have an English documentation at all. -
Add some code comments directly in
clientrpc.cppandserverrpc.cppand create a Python script to generate a Markdown documentation based on these comments (e.g.tools/generate_rpc_docs.py). The documentation would live directly in jamulus repository, e.g.RPC.md, and jamuluswebsite would just link there. Maybe some GitHub Actions could be created to ensure that this documentation is up-to-date. This would also lets reader view the documentation of a specific release.The comment might look like this:
/* For notifications */ /// @rpc_notification jamulusclient/clientListReceived /// @brief Emitted when the client list is received. /// @param {array} params.clients - The client list. /// @param {number} params.clients[*].id - The channel ID. /// @param {string} params.clients[*].name - The musician’s name. /// @param {string} params.clients[*].skillLevel - The musician’s skill level (beginner, intermediate, expert, or null). /// @param {number} params.clients[*].countryId - The musician’s country ID (see QLocale). /// @param {string} params.clients[*].city - The musician’s city. /// @param {number} params.clients[*].instrumentId - The musician’s instrument ID (see CInstPictures::GetTable). /* For methods */ /// @rpc_method jamulusclient/setSkillLevel /// @brief Sets your skill level. /// @param {string} params.skillLevel - The new skill level (beginner, intermediate, expert, or null). /// @result {string} result - Always "ok".
Suggestions or opinions?
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'm not qualified to say, but if it's self-documenting, then less work is always better/safer.
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.
Could we add a more extensive documentation to the file (md table like here and then link the comment from here)? I don’t think people should be forced to read the code. But they can of course read comments - although that’s not optimal (consistency, style) but ok for an experimental feature.
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.
We should also consider the audience of this documentation: It will be developers (not necessarily Jamulus developers or C++ developers). They should already be familiar with reading code or at least comments in the code. I like the idea of having a single place to handle both the code and the directly related docs.
I think we should still keep the first part in the "wiki" (everything including the Example paragraph?), put the method documentation right next to the code and link from the wiki page to the code.
|
Are we going to translate this? It's very technical, and I'd assume anyone using it would be familiar with the terminology in English, but I'll go with the consensus. If we're not, it should go in |
|
I was assuming we would (I'd actually checked the box on behalf of @dtinth), but if not then the adopted convention is that we'd not put it not on the website but in an .md file in the main repo I think? I didn't know about |
|
The reason I raise the issue of translation is that it contains a lot of vocabulary that is very technical and specific, which I'm not entirely sure has translations that are commonly used in different languages. I'm not a programmer, but as English is effectively the lingua franca for programming, translations heavy in technical terms may even be harder to understand than the original. Yes, |
|
OK in that case we can just put it in |
|
It should be moved there before merging though, otherwise it's going to create a bunch of unwanted .po files. Tagging @dtinth If other @jamulussoftware/translators want to chime in though that would be great. |
|
Oh BTW OT but just seen this line in
Is there a reason (Also notice that the |
|
I suppose |
I totally agree... I will move this to |
|
Suggestion:
|
|
See my comment on jamulussoftware/jamulus#1975 (comment) - I'm note sure I underand how this PR relates to that one. |
|
@ann0see @gilgongo @hoffie My original plan was to put the documentation in |
Yes, I think the "rule of thumb" is that if the information is aimed at developers messing with "code", then it goes into the repo (like you say, as COMPILING.md is). If it's to do with the "end usage" of Jamulus (so in this case what the effect of turning on the RPC option is, and some basic info on how to use it), then it's on the website (AKA "the wiki", although I'm not sure why we call it that). |
|
Yes, sounds good to me. End-user-relevant things (CLI option, pointer to deeper docs) here in |
|
Ok. So next steps:
|
|
Closing |
Work in progress
Corresponding Jamulus PR: jamulussoftware/jamulus#1975
Does this need translation?
Changes