Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The composer toolbar currently only supports standard Markdown formatting. As the first step toward LaTeX math support, users need a way to access a LaTeX editor from the composer. This PR adds the button that will eventually open a split-pane LaTeX editor modal (input on the left, preview on the right). Related issue: #9
Description
Added a "LaTeX" button to the composer formatting bar, positioned after the file upload buttons. The button is styled with a serif font to visually represent the LaTeX brand. On click, it fires an action:composer.latex-editor.open hook that will be connected to the editor modal in a follow-up PR.
Changes are made to node_modules plugins and persisted using patch-package:
Changes
patches/nodebb-plugin-composer-default+10.3.1.patch
Modifies static/templates/partials/composer-formatting.tpl to add a
patches/nodebb-plugin-markdown+13.2.3.patch
Modifies public/js/markdown.js to register a latex entry in the formatting dispatch table via formatting.addButtonDispatch(), following the same pattern as bold, italic, and other handlers
Modifies public/scss/default.scss to add .formatting-bar .latex-logo CSS styling with a serif font stack
Note: since package.json is gitignored, after pulling this branch and running npm install you might need to apply the patches manually by npx patch-package.