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:
anchor
allows the user to jump to a specific section of the documentblockquote
is an outdated plugin to create a block quotefiles
is an outdated plugin developed to share files in the schulcloudgeogebra
embeds a geogebra applet in the documenthighlight
allows the user to write code snippets for different programming languagesimage
lets the user upload or use an online image and insert itinput-exercise
creates the solution to an input exercise (linking to task description is done by separate plugin)multimedia-explanation
allows the user to illustrate content using multimedia and textrows
aggregates different plugins and adds a menu where you can e.g. set the document description visible for search enginessc-mc-exercise
creates the solution to a single-choice-multiple-choice exercise (linking to task description is done by separate plugin)serlo-injection
embeds a different document via its id into the current documentspoiler
creates a box which folds out to suggest further courses to the usertable
is an outdated plugin to create a tabletext
configures rich-text editing using SlateJS (link to introduction/Slate)video
lets the user embed a video in the document
βββ private/
β βββ bundle-size/
β βββ demo/
β βββ dev-expression/
β βββ document-editor/
β βββ fixtures/
β βββ plugin/
β βββ plugin-state/
β βββ plugin-toolbar/
bundle-size
is a package that can be run to determine the bundle size of the editordemo
is the package that creates and configures the storybook to test out the editor locally (link to introduction/storybook)dev-expression
is used to display warning messagesdocument-editor
contains the type definitions for the editor container (->public/default-document-editor
orpublic/document-editor
)fixtures
exports list of plugins used in the storybookplugin
contains the shared type definitions for the plugins (-> public/plugin)plugin-state
contains the type definitions for the different state types (-> public/plugin)plugin-toolbar
contains 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/
core
instantiates 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-editor
renders the default toolbar and the default editor container for the pluginsdefault-plugin-toolbar
implements the interface from public/plugin-toolbar to provide the default plugin toolbardocument-editor
imports the types fromprivate/document-editor
editor-ui
covers configuration of buttons, checkboxes and the bottom toolbar on the editor levelmath
is a package that covers the editing and rendering of math formulasplugin
imports generic type definitions from private/plugin-state and implements state types (scalar, list etc.)plugin-toolbar
imports the types from private/plugin-toolbarrenderer
is responsible for the rendering of the editorrenderer-ssr
sets the styles of the rendererrenderer-ui
includes feedback on exercises or submit buttons, particular for the render viewstore
contains the redux store logic, including sagas, actions and reducersstore-devtools
sets up redux dev tools to trace redux actions (for set-up go to the introduction)ui
sets the editor theme