MISC: Improve tutorial, documentation and discoverability of NS API documentation (#1697)

This commit is contained in:
catloversg
2024-10-21 10:37:42 +07:00
committed by GitHub
parent a3e1b297ca
commit 6d8084f40e
6 changed files with 47 additions and 13 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ function Root(props: IProps): React.ReactElement {
}
const cleanCode = currentScript.code.replace(/\s/g, "");
const ns1 = "while(true){hack('n00dles');}";
const ns2 = `exportasyncfunctionmain(ns){while(true){awaitns.hack('n00dles');}}`;
const ns2 = `/**@param{NS}ns*/exportasyncfunctionmain(ns){while(true){awaitns.hack("n00dles");}}`;
if (!cleanCode.includes(ns1) && !cleanCode.includes(ns2)) {
dialogBoxCreate("Please copy and paste the code from the tutorial!");
return;
+2 -5
View File
@@ -3,7 +3,6 @@ import * as monaco from "monaco-editor";
import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
import Link from "@mui/material/Link";
import Table from "@mui/material/Table";
import TableCell from "@mui/material/TableCell";
import TableRow from "@mui/material/TableRow";
@@ -22,7 +21,7 @@ import { useBoolean } from "../../ui/React/hooks";
import { Settings } from "../../Settings/Settings";
import { OptionsModal, OptionsModalProps } from "./OptionsModal";
import { useScriptEditorContext } from "./ScriptEditorContext";
import { getNsApiDocumentationUrl } from "../../utils/StringHelperFunctions";
import { NsApiDocumentationLink } from "../../ui/React/NsApiDocumentationLink";
type IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;
@@ -71,9 +70,7 @@ export function Toolbar({ editor, onSave }: IProps) {
Terminal (Ctrl/Cmd + b)
</Button>
<Typography>
<Link target="_blank" href={getNsApiDocumentationUrl()} fontSize="1.2rem">
NS API documentation
</Link>
<NsApiDocumentationLink />
</Typography>
</Box>
<OptionsModal