From 2680eed681e5e9f0e088f7bc8df766a3b6a31e5e Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Sun, 22 May 2022 21:57:04 +0200 Subject: [PATCH] hide api doc by default --- tutorial/ApiDoc.jsx | 13 +++++++++++++ tutorial/tutorial.mdx | 2 -- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tutorial/ApiDoc.jsx b/tutorial/ApiDoc.jsx index c3ef7e96..fa752818 100644 --- a/tutorial/ApiDoc.jsx +++ b/tutorial/ApiDoc.jsx @@ -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 ( +

+ The API Docs are a work in progress, but you can preview it by clicking here +

+ ); + } // console.log('docJson', docs); return (
+

+ The following Chapter is the technical API documentation. It is autogenerated from the jsdoc comments in the + source files. hide +

{docs .filter((item) => !item.name?.startsWith('_') && item.kind !== 'package') .map((item, i) => ( diff --git a/tutorial/tutorial.mdx b/tutorial/tutorial.mdx index fc01f03a..87ade218 100644 --- a/tutorial/tutorial.mdx +++ b/tutorial/tutorial.mdx @@ -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. -