mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-13 14:48:36 +00:00
hide api doc by default
This commit is contained in:
parent
1b8a12dd2a
commit
2680eed681
@ -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) => (
|
||||
|
||||
@ -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 />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user