adding new doc page

This commit is contained in:
2023-10-22 23:53:57 +02:00
parent aaffacb265
commit 70b44cbd29
5 changed files with 20 additions and 1 deletions

View File

@ -164,6 +164,7 @@
<div class="space-y-2"> <div class="space-y-2">
<h2 class="font-semibold lg:text-xl text-gray-400">More</h2> <h2 class="font-semibold lg:text-xl text-gray-400">More</h2>
<div class="flex flex-col"> <div class="flex flex-col">
<a rel="noopener noreferrer" id="docs_oscilloscope" class="pl-2 pr-2 lg:text-xl text-sm hover:bg-neutral-800 py-1 my-1 rounded-lg">Oscilloscope</a>
<a rel="noopener noreferrer" id="docs_bonus" class="pl-2 pr-2 lg:text-xl text-sm hover:bg-neutral-800 py-1 my-1 rounded-lg">Bonus/Trivia</a> <a rel="noopener noreferrer" id="docs_bonus" class="pl-2 pr-2 lg:text-xl text-sm hover:bg-neutral-800 py-1 my-1 rounded-lg">Bonus/Trivia</a>
<a rel="noopener noreferrer" id="docs_about" class="pl-2 pr-2 lg:text-xl text-sm hover:bg-neutral-800 py-1 my-1 rounded-lg">About Topos</a> <a rel="noopener noreferrer" id="docs_about" class="pl-2 pr-2 lg:text-xl text-sm hover:bg-neutral-800 py-1 my-1 rounded-lg">About Topos</a>
</div> </div>

View File

@ -1976,11 +1976,18 @@ export class UserAPI {
// ============================================================= // =============================================================
// Oscilloscope Configuration // Oscilloscope Configuration
// ============================================================= // =============================================================
public scope = (config: OscilloscopeConfig): void => { public scope = (config: OscilloscopeConfig): void => {
/** /**
* Configures the oscilloscope. * Configures the oscilloscope.
* @param config - The configuration object * @param config - The configuration object
*/ */
this.app.osc = config; // Dispatch the config to the old object so that missing options
// are still specified
this.app.osc = {
...this.app.osc,
...config,
};
}; };
} }

View File

@ -1,5 +1,6 @@
import { type Editor } from "./main"; import { type Editor } from "./main";
import { introduction } from "./documentation/introduction"; import { introduction } from "./documentation/introduction";
import { oscilloscope } from "./documentation/oscilloscope";
import { samples } from "./documentation/samples"; import { samples } from "./documentation/samples";
import { chaining } from "./documentation/chaining"; import { chaining } from "./documentation/chaining";
import { software_interface } from "./documentation/interface"; import { software_interface } from "./documentation/interface";
@ -85,6 +86,7 @@ export const documentation_factory = (application: Editor) => {
functions: functions(application), functions: functions(application),
reference: reference(), reference: reference(),
shortcuts: shortcuts(), shortcuts: shortcuts(),
oscilloscope: oscilloscope(application),
bonus: bonus(application), bonus: bonus(application),
about: about(), about: about(),
}; };

View File

@ -451,6 +451,7 @@ export const installInterfaceLogic = (app: Editor) => {
"shortcuts", "shortcuts",
"about", "about",
"bonus", "bonus",
"oscilloscope",
].forEach((e) => { ].forEach((e) => {
let name = `docs_` + e; let name = `docs_` + e;
document.getElementById(name)!.addEventListener("click", async () => { document.getElementById(name)!.addEventListener("click", async () => {

View File

@ -0,0 +1,8 @@
import { type Editor } from "../main";
import { makeExampleFactory } from "../Documentation";
export const oscilloscope = (application: Editor): string => {
const makeExample = makeExampleFactory(application);
return `# Oscilloscope
`;
};