Packages of the Serlo Editor - serlo/documentation GitHub Wiki
Packages
packages/
βββ plugins/
βββ private/
βββ public/
On the first level, the repository separates plugins from everything else, e.g. shared type definitions or the store logic. Due to circular dependencies, some type definitions are first defined in the private directory and then imported into the public directory, for instance the public/default-document-editor imports from the private/document-editor/.
βββ plugins/
β βββ anchor/
β βββ blockquote/
β βββ files/
β βββ geogebra/
β βββ highlight/
β βββ image/
β βββ input-exercise/
β βββ multimedia-explanation/
β βββ rows/
β βββ sc-mc-exercise/
β βββ serlo-injection/
β βββ spoiler/
β βββ table/
β βββ text/
β βββ video/
Letβs step through the different plugins available:
anchorallows the user to jump to a specific section of the documentblockquoteis an outdated plugin to create a block quotefilesis an outdated plugin developed to share files in the schulcloudgeogebraembeds a geogebra applet in the documenthighlightallows the user to write code snippets for different programming languagesimagelets the user upload or use an online image and insert itinput-exercisecreates the solution to an input exercise (linking to task description is done by separate plugin)multimedia-explanationallows the user to illustrate content using multimedia and textrowsaggregates different plugins and adds a menu where you can e.g. set the document description visible for search enginessc-mc-exercisecreates the solution to a single-choice-multiple-choice exercise (linking to task description is done by separate plugin)serlo-injectionembeds a different document via its id into the current documentspoilercreates a box which folds out to suggest further courses to the usertableis an outdated plugin to create a tabletextconfigures rich-text editing using SlateJS (link to introduction/Slate)videolets the user embed a video in the document
βββ private/
β βββ bundle-size/
β βββ demo/
β βββ dev-expression/
β βββ document-editor/
β βββ fixtures/
β βββ plugin/
β βββ plugin-state/
β βββ plugin-toolbar/
bundle-sizeis a package that can be run to determine the bundle size of the editordemois the package that creates and configures the storybook to test out the editor locally (link to introduction/storybook)dev-expressionis used to display warning messagesdocument-editorcontains the type definitions for the editor container (->public/default-document-editororpublic/document-editor)fixturesexports list of plugins used in the storybookplugincontains the shared type definitions for the plugins (-> public/plugin)plugin-statecontains the type definitions for the different state types (-> public/plugin)plugin-toolbarcontains the type definitions for the plugin toolbar (-> public/plugin-toolbar)
βββ public/
β βββ core/
β βββ default-document-editor/
β βββ default-plugin-toolbar/
β βββ document-editor/
β βββ editor-ui/
β βββ math/
β βββ plugin/
β βββ plugin-toolbar/
β βββ renderer/
β βββ renderer-ssr/
β βββ renderer-ui/
β βββ store/
β βββ store-devtools/
β βββ ui/
coreinstantiates the editor with respective context. There are two variants for that: either one editor component or an editor provider with multiple documents where each document has a clear scope (see core concepts)default-document-editorrenders the default toolbar and the default editor container for the pluginsdefault-plugin-toolbarimplements the interface from public/plugin-toolbar to provide the default plugin toolbardocument-editorimports the types fromprivate/document-editoreditor-uicovers configuration of buttons, checkboxes and the bottom toolbar on the editor levelmathis a package that covers the editing and rendering of math formulaspluginimports generic type definitions from private/plugin-state and implements state types (scalar, list etc.)plugin-toolbarimports the types from private/plugin-toolbarrendereris responsible for the rendering of the editorrenderer-ssrsets the styles of the rendererrenderer-uiincludes feedback on exercises or submit buttons, particular for the render viewstorecontains the redux store logic, including sagas, actions and reducersstore-devtoolssets up redux dev tools to trace redux actions (for set-up go to the introduction)uisets the editor theme