From b3029e3fd38c70776a1b95b56ed43c780f191e08 Mon Sep 17 00:00:00 2001 From: Lu Wilson Date: Sat, 24 Jun 2023 09:23:02 +0100 Subject: [PATCH] [docs] Add table of contents to Editor page (#1642) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR adds a table of contents to the Editor docs page. The Editor page is quite long, with different sections. I think that some contents at the top will make it slightly more approachable & usable for now. ### Change Type - [x] `documentation` — Changes to the documentation only[^2] [^1]: publishes a `patch` release, for devDependencies use `internal` [^2]: will not publish a new version ### Release Notes - Documentation: Added a table of contents to the Editor page. --------- Co-authored-by: Steve Ruiz --- docs/docs/editor.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/docs/editor.mdx b/docs/docs/editor.mdx index c555c7628..5988f6257 100644 --- a/docs/docs/editor.mdx +++ b/docs/docs/editor.mdx @@ -12,6 +12,16 @@ keywords: - select --- +##### Table of Contents + +- [Introduction](#introduction) +- [State](#state) +- [Events and Tools](#events-and-tools) +- [Inputs](#inputs) +- [Common things to do with the editor](#common-things-to-do-with-the-editor) + +## Introduction + The `Editor` class is the main way of controlling tldraw's editor. You can use it to manage the editor's internal state, make changes to the document, or respond to changes that have occurred. By design, the `Editor`'s surface area is [very large](/gen/editor/Editor-class). Almost everything is available through it. Need to create some shapes? Use `editor.createShapes()`. Need to delete them? Use `editor.deleteShapes()`. Need a sorted array of every shape on the current page? Use `editor.sortedShapesArray`.