unfoldingWord / findr

Open Components for Find and Replace
https://findrjs.netlify.app/
MIT License
0 stars 0 forks source link

Introduce API Reference Docs To Repo #8

Open theNerd247 opened 1 year ago

theNerd247 commented 1 year ago

I think formal reference documentation is needed. I'm not familiar with the ecosystem involved with this repo. @abelpz do you have any recommendations on how to generate API documentation from the source code?

abelpz commented 1 year ago

Sure, would you prefer a markdown file for this or a docsite or both?

theNerd247 commented 1 year ago

I would add this to the current docusaurus docsite. I'm currently playing around with using typedoc as a method for generating the docs.

theNerd247 commented 1 year ago

After reviewing the tutorial and seeing the need to produce API docs here's what I would recommend:

  1. use typedoc instead of docusaurus for all documentation
  2. write the tutorials as comments in the code. The larger the textual distance between code and its documentation the more likely the documentation will be error prone. Furthermore placing tutorials right next to code gives developers an instant roadmap to navigating the source code and, simultaneously, gives them a deeper understanding of what the code does and how it's intended to be consumed.
  3. Remove the demo fnr-pg or replace the code in the walkthrough with that. This does 2 things:
    • it dogfoods your API which will makes it easier to find bugs and improvements
    • it gives a developer a more practical idea of how to consume your library - the current walkthrough makes your API appear as a only a wrapper around regex and not a set of GUI utils that work ontop of regex.
theNerd247 commented 1 year ago

see #20 for other work that was done here.