Docmaps-Project / docmaps

Extensible protocol for document history metadata exchange, to enable trustworthy, rapid, open science, by and for preprint science communities.
MIT License
15 stars 1 forks source link

Add basic documentation generation #34

Closed ships closed 1 year ago

ships commented 1 year ago

0. Entrypoint simple app for routing to the different packages' pages

To avoid making a huge fuss over a whole website, and keep using mostly autogenerated html from typedoc, the problem arises of how to host what amounts to multiple Github pages from one repo. To my surprise this is not automatically handled in any sense, and there is no support for sub-path-based routing on GH Pages- you just upload a TAR. (All this is just issue #65 .

Yet locally in development, the different packages' docs files are not reasonably located near to each other without uploading the whole repository -- and the upload has to happen after npm install, so there is cleanup involved.

Instead, I created a /docs directory at the top level which has symlinks to the various static sites that each package wants to own. In this directory is also a very simple HTML page with inline styling that has hrefs to these symlink files. At deploy time, the github action replaces the symlink with a deep copy of the directory each one points to. This directory including copies constitute the GH pages tarball.

See this entrypoint hosted now at https://docmaps-project.github.io/docmaps/ .

1. Add developer documentation for the ts-sdk

Check out the new packages/ts-sdk/docs directory for the latest generated docs. You can also see them by clicking link above and going to docmaps-sdk.

That contains generated Typedoc docs. The docs as generated automatically are not that useful for types so I have included examples for all the types. this is a bit of a pain due to the needing to update a type in two places.

If we can convert from typedoc to doc-ts, the examples will have a compilation check. However, docs-ts is not currently compatible with declared ES modules., so it's too big a lift for now.

Resolves #20 .