mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-26 13:08:28 +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 { docs } from '../doc.json';
|
||||||
import { MiniRepl } from './MiniRepl';
|
import { MiniRepl } from './MiniRepl';
|
||||||
|
|
||||||
|
const visible = window.location.href.includes('?api=true');
|
||||||
|
|
||||||
function ApiDoc() {
|
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);
|
// console.log('docJson', docs);
|
||||||
return (
|
return (
|
||||||
<div>
|
<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
|
{docs
|
||||||
.filter((item) => !item.name?.startsWith('_') && item.kind !== 'package')
|
.filter((item) => !item.name?.startsWith('_') && item.kind !== 'package')
|
||||||
.map((item, i) => (
|
.map((item, i) => (
|
||||||
|
|||||||
@ -701,6 +701,4 @@ import ApiDoc from './ApiDoc';
|
|||||||
|
|
||||||
# API Docs
|
# API Docs
|
||||||
|
|
||||||
The following Chapter is the technical API documentation. It is autogenerated from the jsdoc comments in the source files.
|
|
||||||
|
|
||||||
<ApiDoc />
|
<ApiDoc />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user