Comments (4)
I'm working on a markedjs web component here (still WIP -- need to add code highlighting): #667. This component renders the nested list without requiring four spaces.
Looks like there is a way to use mermaid with markedjs: https://mermaid.js.org/config/usage.html#example-of-a-marked-renderer
So you could copy that web component and modify it to include mermaid.
Then you can copy mel.chat (if you haven't already) and modify it to use the markedjs web component instead of me.markdown.
I haven't tested out the performance of the markedjs web component yet (and what else it's missing). But I think it's definitely possible to support mermaid (mermaid is great!).
Markedjs also has some in progress support for Github flavored markdown, but it does not look like it's ready yet: markedjs/marked#1202
from mesop.
For the example markdown web component (#667), I added mermaidjs support.
Example:
![Screenshot 2024-07-26 at 5 02 12 PM](https://private-user-images.githubusercontent.com/539889/352685942-b3e2ff70-bee6-44ee-ae66-0404c9d0252c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxMTIwMjgsIm5iZiI6MTcyMjExMTcyOCwicGF0aCI6Ii81Mzk4ODkvMzUyNjg1OTQyLWIzZTJmZjcwLWJlZTYtNDRlZS1hZTY2LTA0MDRjOWQwMjUyYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzI3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyN1QyMDIyMDhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iMjZlZDFkYjQyYzYxNWU1OTgxNGY1ZmU3Y2QxMGU1ZTRkMTE2ZTYyNTBhYjRkOWRhNjBhMWJiMzA5NzdhYzZhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Oue0kme5PXZkhzvsSLNr6DEQed7lkn6NyyOQpwxwtjM)
from mesop.
Yup, the output and components are really good, but the problem is that I can't predict le LLM output 😅
... so the pattern would to parse the LLM ouput and decide how to inject it into mesop ?
from mesop.
I see, so the LLM output isn't just markdown? I was assuming the LLM just outputted markdown only (in that case you can just render it using the markdown web component). It's trickier if the format is not markdown. But if you could get your LLM to output markdown, then that would probably be easiest.
from mesop.
Related Issues (20)
- Mesop doesn't support async HOT 2
- Provide a better error message for unhandled state serialization
- Allow Flask Configuration HOT 2
- Add Autocomplete Component from Angular Components
- Not able to iframe a localhost site from a localhost site (or http site)
- Add the CSS `place-items` property in the `me.Style` object
- FileNotFoundError gpc.json HOT 7
- Weird error message when trying to create webcomponent for Mesop HOT 1
- Create a comparison guide with Streamlit / Gradio / Reflex
- How to pronounce "Mesop"? HOT 1
- Prevent accidental usage of mutable classes in @me.stateclass
- Add Tab Component HOT 1
- Create a concurrency test to ensure session isolation
- Style.__init__() got an unexpected keyword argument min_height HOT 4
- Nested lists of lists of Dataclasses does not de-serializing correctly in state
- Better default markdown support HOT 4
- Support theming to different colors
- Make UploadedFile json serializable HOT 1
- Using web components in a Mesop app requires a lot of repeated configuration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mesop.