hide api doc by default

This commit is contained in:
Felix Roos 2022-05-22 21:57:04 +02:00
parent 1b8a12dd2a
commit 2680eed681
2 changed files with 13 additions and 2 deletions

View File

@ -2,10 +2,23 @@ import React, { Fragment } from 'react';
import { docs } from '../doc.json';
import { MiniRepl } from './MiniRepl';
const visible = window.location.href.includes('?api=true');
function ApiDoc() {
if (!visible) {
return (
<p>
The API Docs are a work in progress, but you can preview it by clicking <a href="?api=true#api-docs">here</a>
</p>
);
}
// console.log('docJson', docs);
return (
<div>
<p>
The following Chapter is the technical API documentation. It is autogenerated from the jsdoc comments in the
source files. <a href="?#api-docs">hide</a>
</p>
{docs
.filter((item) => !item.name?.startsWith('_') && item.kind !== 'package')
.map((item, i) => (

View File

@ -701,6 +701,4 @@ import ApiDoc from './ApiDoc';
# API Docs
The following Chapter is the technical API documentation. It is autogenerated from the jsdoc comments in the source files.
<ApiDoc />