Home

Awesome

♊️ Geminispace JSDoc server

JSR

A Geminispace server for serving JSDoc documentation with the Deno 2+ TypeScript runtime.

What is Geminispace?

Geminispace is a new Web-like content platform with its own protocol and its own Markdown-like content format. It is especially suitable for browsing content from the terminal. Recommended Gemini client: amfora.

Usage

1. Create a TLS certificate and private key

TLS_CERT=./path/to/cert.pem \
TLS_CERT_KEY=./path/to/key.pem && \
openssl req -x509 -newkey rsa:2048 -keyout $TLS_CERT_KEY -out $TLS_CERT -days 365 -nodes

Certificate validity is set to one year by default, and must normally be regenerated periodically.

2. Create JSDoc JSON files from the source code

Do this each time the JSDoc in the source code changes:

deno doc --json --name=MODULENAME ./path/to/mod.mjs > ./path/to/jsdoc/MODULENAME/jsdoc.json

The server does not need a restart to serve new content.

Note that the jsdoc directory has a strict structure. It can contain:

Additional requirements:

3. Run the JSDoc server

JSDOC_DIR='./jsdoc' \
TLS_CERT='./cert/cert.pem' \
TLS_CERT_KEY='./cert/key.pem' \
CACHE_SIZE='100' \
HOSTNAME='0.0.0.0' \
PORT='1965' \
deno run --allow-env --allow-net --allow-read \
jsr:@arma/geminispace-jsdoc-server@2.0.6/main

All environment variables are optional. The command above shows their default values.

CACHE_SIZE defines the size of the in-memory cache. 1 means 10 000 bytes. 0 disables the cache.

Dependencies

This TypeScript module depends on qgeminiserver.

---
title: Dependencies
---
flowchart LR
GeminispaceJSDocServer[geminispace-jsdoc-server] --imports--> QGeminiServer[qgeminiserver]

To do

Current status:

Live servers

These Geminispace capsules are running on geminispace-jsdoc-server:

To add your capsule here, simply send a pull request.