My team @ FAANG is using a prose mirror based text editor (TipTap) to implement a new product. We love all the features this editor provides OOB. Even for features / capabilities not provided via TipTap API, ProseMirror provides excellent support to manually implement them. Thanks for keeping this library awesome!
One feature that both ProseMirror and TipTap (by consequence) lacks is the ability to show line numbers on the document.
We would love to implement this on a similar way to what Quip web currently does. This is, adjust the gap in between line numbers dynamically depending on the content per line. (e.g. if we have a headline 1, then there will be a bigger gap w.r.t paragraphs, if we insert an image, we will have a gap as big as the image is, the same for code blocks etc.)
I know this question has been asked multiple times with Prose Mirror core maintainers answering that this feature is out of scope for PM. However, here is my long shot:
- At high level: What would it take to implement this feature considering our north star?
- Is this nearly impossible to implement with a Prose Mirror based editor? If so, any alternatives that could help us achieving our goal? (e.g. rich text editor that provides most common capabilities this is: headings, tables, formatting, etc. That also supports line numbers.)
- If above north star is somewhat doable, any code pointers, recommendations, high-level approach to solve this? I can even ask my company if there is a way so that we can collaborate for this work-stream with this awesome open source community. I bet there is a bunch of people interested on onboarding this feature as part of their PM instances.
- Note: Our thinking is that only if ProseMirror would allow us to get the content line by line, explore it’s content, then we might have solved 75% of the problem via this algorithm. I know PM has a tree structure rather than a line structure though, so that’s why we’re asking for high level approaches here.