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

feature: Create MDBOOK documentation for Signal K server. #1583

Merged
merged 44 commits into from
Sep 27, 2023
Merged

Conversation

panaaj
Copy link
Member

@panaaj panaaj commented Jul 19, 2023

Create configuration and source documents for Signal K server documentation that is available as part of the a running server and will be available at https://demo.signalk.org/.

Initial document source is the migration of existing .md documents into the src folder.
An index has been created and the existing document content re-factored to fit the index structure.

This inital structure will serve as the basis for future refinement, and editing as required.

The HTML documentation is generated by running npm run build:docs and the resulting files are at docs/built/ mounted at /documentation/. The documentation is accessed via the Admin UI Documentation.

Note: the documentation generation requires that docker be available.

@panaaj panaaj added the doc label Jul 19, 2023
@panaaj panaaj changed the title Create MDBOOK documentation for Signal K server. feature: Create MDBOOK documentation for Signal K server. Aug 2, 2023
@panaaj panaaj requested a review from tkurki August 2, 2023 05:47
@tkurki
Copy link
Member

tkurki commented Sep 6, 2023

Wow you've created a lot of new content here!

Now that I've looked into this: I think we have different kinds of documentation:

  1. "Server User Manuel" - explaining how the server works and how it is configured
  2. "Developer Documentation" - plugins, webapps, providers
  3. Release notes/changelogs, v2 documentation
  4. "Use cases / Features / How tos" - practical use cases, like using the server as 0183 multiplexer and converter, explaining what the use case is and then step by step guides on how to configure it, like the pdf here

This PR puts 1 & 2 & 3 together, into standalone manual format. I am starting to think that developer docs should be separate, as they add clutter & confusion for the end users. Having developer documentation embedded in the admin ui is way less important than having it easily discoverable on the github site / from the readme.

How tos are also a bit separate, but closer to user manual.

While mdbook is a tidy format having it totally outside the server admin UI strikes me as a bit confusing. We could also embed some documentation, like changelogs and How tos, directly in the admin UI. We used to have changelog rendered with react-markdown, when it was committed into the repo.

Thoughts?

@panaaj
Copy link
Member Author

panaaj commented Sep 6, 2023

I don't disagree that the different types of documentation could / should be hosted in different places but that said part of the motivation behind this PR was the number of queries and support requests where the answer was documented and it wasn't obvious where that was.

I believe there is value in having a central place where all the docs can be found. This is the initial aggregation.

Is there a case for having all the information available as part of the installation, more a reference than a manual?

What ever the answer I do think there is value in one set of documentation.

@tkurki
Copy link
Member

tkurki commented Sep 10, 2023

@mpvader I converted the anchoralarm feature howto to .md and included it in the Server Guide in this PR. You can have a look with docker run --rm -p 3000:3000 signalk/signalk-server:documentation:

image

@panaaj already added Freeboard as one more way to use anchor alarms.

image

@mpvader
Copy link
Contributor

mpvader commented Sep 10, 2023

Nice, I’ll have a look in coming few days

@mpvader
Copy link
Contributor

mpvader commented Sep 12, 2023

Hey @tkurki and @panaaj, I finally had a good look, and this is really nice and promising!

My comments:

  • for a large section like the anchor alarm, it would be nice if there is some sort of in-page navigation? Or, even better, make the content such that mdbooks (?? I'm sorry, didn't look into the used tooling at all, will do soon) recognises all the sections on the anchor-alarm document, enumerates them in the index on the left, hides that part normally and only unfolds it once entering the page? Anyway: probably best if mdbooks supports something like that, anything, and lets then go with that rather than customising too far.
  • rereading that anchor page content, I'd see various things that I'd like to change; which I'll do myself.
  • perhaps find a better word for Server Guide ? Actually, if we keep it like this: all documentation only shows up if you navigate away from the admin ui, then lets move that Open API link also into the server guide. And then clicking the Documentation link just takes the user straight into this new docs section.
  • what is the plan with duplicate content with the readme? Such as the commandline options.
  • the menu is a bit strange, for example in the installation section there is lots of interesting content which, if you go by the navigation menu on the left, you'll never find. Also the navigation section says "Installation", but in the content I can't find that chapter name anywhere.
  • Clicking help and support on the left makes the screen move a bit, the term "Installation" disappears. Compare first to second screenshot:

First screenshot:

image

Second screenshot:

image

@mpvader
Copy link
Contributor

mpvader commented Sep 12, 2023

This issue at mdBook seems to describe what I’m looking for wrt in page navigation, as well as offer a few solutions:

rust-lang/mdBook#1523

@panaaj
Copy link
Member Author

panaaj commented Sep 12, 2023

  • for a large section like the anchor alarm, it would be nice if there is some sort of in-page navigation? Or, even better, make the content such that mdbooks (?? I'm sorry, didn't look into the used tooling at all, will do soon) recognises all the sections on the anchor-alarm document, enumerates them in the index on the left, hides that part normally and only unfolds it once entering the page? Anyway: probably best if mdbooks supports something like that, anything, and lets then go with that rather than customising too far.

Unfortunately it appears that MDBOOKS does not support links to page sections from the SUMMARY.md (left menu), adding entries withlinks to page sections fails the build process.

For now I have manually added a Contents section to the beginning of the Anchor Alarm page with links to the major sections.

@panaaj
Copy link
Member Author

panaaj commented Sep 12, 2023

  • Clicking help and support on the left makes the screen move a bit, the term "Installation" disappears. Compare first to second screenshot:

The MDBOOK behaviour seems to be "move the selected entry in the left menu to the center".

I assume that is what you are referring to as the navigation to the content is correct.

@panaaj
Copy link
Member Author

panaaj commented Sep 12, 2023

  • perhaps find a better word for Server Guide ? Actually, if we keep it like this: all documentation only shows up if you navigate away from the admin ui, then lets move that Open API link also into the server guide. And then clicking the Documentation link just takes the user straight into this new docs section.
  • what is the plan with duplicate content with the readme? Such as the commandline options.

From my perspective this will depend on how we treat this documentation.

Initially the intent was to have one place to go for Signal K server documentation, not necessarily a "Help" document for the server. Exisiting documentation is "scattered around" and it was clear from the questions asked in the Slack channel and discussions that the exisiting information that answered their question was not easily found or people didn't know where to look.

The content included in the MDBOOK covers a broad range of topics and could easily serve different puposes, so there are options about how it is managed and published, which no doubt there will be discussions about.

As for the README... I feel that is related to the repository contents rather than "operating the product" (in this case Signal K server). There will certainly be overlapping content but this should link to the relevant documentation in the MDBOOK to avoid duplication.

Clearly there is still a journey to travel here because there are options, all of which will have merit.

@mpvader
Copy link
Contributor

mpvader commented Sep 13, 2023

Initially the intent was to have one place to go for Signal K server documentation,

The content included in the MDBOOK covers a broad range of topics and could easily serve different puposes

understood; and having it all together is a major improvement. In my opinion the term used for the menu entry, “Documentation”, is great and covers it all.

README

agreed. So content will need to be removed there.

In page navigation

I noticed your added TOC on the anchor page; nice and simple solution!

@tkurki
Copy link
Member

tkurki commented Sep 13, 2023

A sidenote maybe, but we should look into gwnerating plugin api documenation off the ts files/embed the documentation there and use https://www.npmjs.com/package/typedoc-plugin-markdown to generate md to be embedded here

@tkurki
Copy link
Member

tkurki commented Sep 17, 2023

Now deployed at https://docs-signalk-io.fly.dev/

@tkurki
Copy link
Member

tkurki commented Sep 17, 2023

I looked into generating server API docs with typedoc markdown plugin: the problem with that is that mdbook does not generate html for .md files that are not in SUMMARY.md so the subpages that typedoc links to are not there. Including all of them in SUMMARY.md is not feasible, so this would need more than trivial tweaking.

However I think we should move towards api docs off the .ts files in one way or another, but that need not be part of this PR.

@tkurki
Copy link
Member

tkurki commented Sep 17, 2023

Now that the mdbook links back to the admin UI I think we should move towards getting this thing out the door: not creating & tweaking content, but resolving the issues that relate to coherence: how does the new documentation format work together with the README and previous documentation addresses?

  • replace duplicate sections in repo root README with links to either deployed documentation at demo.signalk.org (or create docs.signalk.org, but then also the spec docs should be accessible there?) or the md files in their new locations
  • add placeholder files that point to the new location for the most prominent files, like SERVERPLUGINS.md and raspberry installation so that they don't simply disappear
  • decide on the navigation in the sidebar: What if we pull OpenApi from under Documentation to the top level and link Documentation to the mdbook?

What else?

@panaaj
Copy link
Member Author

panaaj commented Sep 17, 2023

What should we do with SEATALK (GPIO).md and other outliers?

@mpvader
Copy link
Contributor

mpvader commented Sep 18, 2023

Nice! I’d stick with demo.signalk.org.

@panaaj
Copy link
Member Author

panaaj commented Sep 18, 2023

I agree that demo.signalk.org is a better choice for the reason that the docs in question are related to the server.

I would expect to find the spec documents at docs.signalk.org.

The other option is to have something like docs.server.signalk.org.

@tkurki
Copy link
Member

tkurki commented Sep 18, 2023

Seatalk goes under Configuration, 3.1 Seatalk I think. The logic being that there could or should be docs there for the different connection types, nobody's just written them yet, and for discoverability.

What else are we missing?

@tkurki
Copy link
Member

tkurki commented Sep 19, 2023

Reorganised sidebar like so
image

@mpvader
Copy link
Contributor

mpvader commented Sep 19, 2023

What is so important in that OpenAPI link? Can’t that be linked from one of the dev docs? Maybe a page that explains what it is?

as a user, I clicked it a few times, and then was surprised to be taken away from admin ui to some internet page

@tkurki
Copy link
Member

tkurki commented Sep 19, 2023

Yeah, I know the switch to another UI is jarring. Maybe I am too stuck on the idea is that I don't want the API descriptions to be buried under clicks and scrolls.

Just for the record: it is not an internet page, but served by the server. Swagger UI is a component that renders the UI that you see: it takes an OpenApi API description of a REST/HTTP API, lists the methods and the structure of their parameters and return values. See for example https://demo.signalk.io/doc/openapi/?urls.primaryName=course

The problem it solves is that now for example the way anchorwatch works is not very well documented: what HTTP path to use, what parameters to use, what to expect in return, how to retrieve anchor data. SK v1 created a universal data model, but there is no clear way to document a specific use case. The idea going forward is that we can create these modular, smallish APIs that you can use for the different use cases, instead of figuring out by trial and monitoring how something is done by a specific plugin, like anchor watch.

@mpvader
Copy link
Contributor

mpvader commented Sep 19, 2023

ok yes, I see it now, its not some page somewhere on the internet. Fooled me. I see the value for a developer, but not for the average user of the admin ui.

In the end, where that link goes (or if it stays where it is now I mean) doesn't matter much, such average user might click it once, maybe twice, and then never again.

@tkurki
Copy link
Member

tkurki commented Sep 21, 2023

Sidebar navigation opens blank on my ios chrome, probably related to the sk navigation as it works on stock mdbook rust docs.

@panaaj
Copy link
Member Author

panaaj commented Sep 21, 2023

See a similar issue on my Android phone.

Copy link
Member

@tkurki tkurki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased on master and hopefully did not mess up anything resolving the conflicts.

I think this is good enougn to merge, we can tweak the content later and add further improvements like generating and not writing the api docs by hand etc. Also in-repo md:s that may need fixing are easily done off master.

@panaaj
Copy link
Member Author

panaaj commented Sep 26, 2023

I rebased on master and hopefully did not mess up anything resolving the conflicts.

I had a scan and fixed a truncated sentence as well as a few stray punctuation marks.
It is good to go.

Copy link
Member

@tkurki tkurki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good here, but I really want to start producing apidocs off the source files after this is merged.

@tkurki tkurki merged commit fc9e64d into master Sep 27, 2023
4 checks passed
@tkurki tkurki deleted the documentation branch September 27, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants