Skip to content

Math and graph integration into Docs (haXathon) #1061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

Math-s314
Copy link

⚠️ THIS PR IS STILL A DRAFT ⚠️
It won't compile : to test you have to compile make bootstrap on main before switching to this branch and use thereafter the run development frontend

🌟 Contributors: @tidann, @arkey-dev, @plouil, @Math-s314, @SamuelPerezDuarte, @Withers001
💻 Project of the Hack Days Hackathon

This proposition aims to allow students, professors, researchers and more to benefit from a straightforward implementation of basic math and chart editing features in Docs.

Main features

  • A LaTeX block implementing a design previously proposed in the Docs repo issues, with the Monaco JS code editor framework
  • A LaTeX inline component with cool features such as : triple-click and Ctrl+A handling, "Convert from Markdown" button handling, (double) dollar sign syntax
  • A Mermaid block that also implements a design proposed in the Docs repo. It works similarly to the LaTeX block.
  • A Chart block to display math functions using CortexJS and ComputeEngine

For the future

  • The export to PDF and DOCX features (to allow compilation)
  • A continuous Latex/Mermaid rendering (without displaying the errors while typing)
  • A floating Latex/Mermaid editor which signals the errors when they happen

tidann and others added 30 commits June 7, 2025 19:53
…r formatting updates in Mermaid and Latex components
…neLatex component to handle empty formulas correctly
…a handling; introduce catchFocus property in configuration
- New kind of block similar to LatexBlock (in how it works)
- `ChartBlock` plot the function given by the user in the range chosen
- Added new dependencies: @cortex-js/compute-engine, @monaco-editor/react, chart.js, and react-chartjs-2.
- Updated existing dependencies in package-lock.json and yarn.lock.
- Removed unused textAlignment property from ChartBlock configuration.
- Updated InlineLatexButton to return null if no text is selected in the editor.
- Changed icon in SlashMenuItems from "functions" to "line_axis" for better representation.
…cies

- Added support for exporting ChartBlock, LatexBlock, and MermaidBlock in PDF format.
- Introduced new mapping files: chartBlockPDF.tsx, latexBlockPDF.tsx, and mermaidBlockPDF.tsx.
- Updated package dependencies in package.json and corresponding lock files to include tex-to-svg and related packages.
- Introduced a new paste handler in BlockNoteEditor to process pasted Markdown text and update blocks accordingly.
- Updated parseMarkdownWithLatex utility to handle additional block types including bullet lists, numbered lists, and headings.
- Removed unused lastKeyRef logic in useLatexDetection for cleaner code.
- Integrated SuggestionMenuController to enhance inline LaTeX functionality.
- Updated getItems method to fetch menu items based on user input.
- Ensured consistent trigger character for LaTeX suggestions in both editor instances.
- Implemented logic to exit editing mode and clear formula when Backspace is pressed with an empty edit value.
- Enhanced user interaction by preventing default behavior in this specific case.
tidann and others added 5 commits June 7, 2025 19:53
…d Chart blocks

- Imported new mapping functions for LaTeX, Mermaid, and Chart blocks.
- Updated docxDocsSchemaMappings to include these new block types.
- Commented out inline content mapping for future implementation.
@Math-s314 Math-s314 changed the title Math and graph integration into Docs Math and graph integration into Docs (haXathon) Jun 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants