Skip to content
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

Add Markdown table support #114

Closed
skjiisa opened this issue Jun 27, 2019 · 39 comments · Fixed by #2235
Closed

Add Markdown table support #114

skjiisa opened this issue Jun 27, 2019 · 39 comments · Fixed by #2235
Assignees
Labels
1. to develop enhancement New feature or request feature: formatting Features related to text formatting and node types
Milestone

Comments

@skjiisa
Copy link

skjiisa commented Jun 27, 2019

Is your feature request related to a problem? Please describe.
Yes. Documents with Markdown tables do not have their tables rendered.

Describe the solution you'd like
Standard Markdown table rendering.

Describe alternatives you've considered
As developing a UI for making tables could be difficult, simply using the standard Markdown to HTML table conversion would be enough.

@skjiisa skjiisa added the enhancement New feature or request label Jun 27, 2019
@juliusknorr
Copy link
Member

Yes, we should look into implementing support for https://github.github.com/gfm/#tables-extension-

@juliusknorr juliusknorr added this to the 3.0 📝 milestone Jun 28, 2019
@jancborchardt
Copy link
Member

@isvvc is this something you would like to help contribute? 😊 The Text app is of course at the first version, and any contribution is welcome – we’ll help you get set up if you need anything.

@skjiisa
Copy link
Author

skjiisa commented Jun 28, 2019

@jancborchardt I could definitely make an attempt but am not sure exactly where to start. I have experience with text manipulation but none with Nextcloud apps or Vue.js.

@jancborchardt
Copy link
Member

@isvvc cool! Maybe @juliushaertl or someone from @nextcloud/vue has some pointers to help. :)

@juliusknorr juliusknorr added the feature: formatting Features related to text formatting and node types label Jul 1, 2019
@ChristophWurst
Copy link
Member

For Vue I suggest to read the Vue docs and then some code from Nextcloud apps. This will make you understand how we use it here.


someone from @nextcloud/vue has some pointers to help. :)

I would kindly ask to not abuse the team for stuff like this. This just floods everyone's notifications. The maintainers of this app should be able to help.

Unsubscribed. Please @mention me directly if you need any specific help.

@juliusknorr
Copy link
Member

juliusknorr commented Jul 1, 2019

Regarding the integration tables, I would recommend to first have a look at the tiptap table nodes to see what they support and how/if we can represent that in github flavored markdown. Since most likely not all will be supported, we need to create our own table nodes or inherit from the tiptap ones and add them to https://github.com/nextcloud/text/blob/master/src/EditorFactory.js#L45-L59

Here are some rough steps with code hints:

@stale stale bot added the wontfix label Aug 22, 2019
@nextcloud nextcloud deleted a comment from stale bot Aug 22, 2019
@elpraga
Copy link

elpraga commented Sep 15, 2019

Is there a roadmap as approximately when this functionality could be implemented?

@juliusknorr
Copy link
Member

No, there is no estimation that we can give. Of course contributions are always welcome.

@elpraga
Copy link

elpraga commented Sep 22, 2019

@juliushaertl I wish i were able to contribute with the code. I'm an English teacher, not a coder. Even though I did have a look at tiptap tables (they work great BTW), I was not able to make them work locally.

I'm grateful that nextcloud exists and gives us the freedom to host files at home instead of having to rely on a big corporation. I do file bug reports and try to contribute with suggestions, but, unfortunately, I cannot contribute with code.

Thank you for your work, and if tables in the text app could be implemented, it would be much appreciated.

@juliusknorr
Copy link
Member

@elpraga Thank you very much the kind words. Keep your contributions coming 😉

@jonathandeclan

This comment has been minimized.

@guddl

This comment has been minimized.

@juliusknorr
Copy link
Member

@jonathandeclan @guddl Please read #114 (comment) and use Github Reactions feature instead of commenting that also need a specific feature. That way we can see your support without notifying all users subscribed to a given issue without adding anything new to the discussion.

TLDR: As tiptap doesn't have markdown support out of the box, additional implementation work is required. Contributions are always welcome.

@jakobroehrl
Copy link

It would be awesome if the tables could be sorted and are filterable :)

@juliusknorr juliusknorr modified the milestones: 3.0 📝, 19.0.0 Jan 16, 2020
@marbx
Copy link

marbx commented Jan 27, 2020

I happily used markdown tables and assumed there were a standard feature of Nextcloud.

After an upgrade from Nextcloud 16 to 17, my markdown tables are no longer rendered as html table.

Can someone confirm that Nextcloud 16 renders markdown tables?

I resolved my markdown table support need via the Pico CMS app.

Therefore I no longer require this enhancement.

@davidbe
Copy link

davidbe commented Mar 24, 2020

It would be nice to hav an implementation like this: https://blog.documentnode.io/when-markdown-meets-tables

@fajabird
Copy link

What about an option to switch to raw markdown editing so any formatting supported by the rendering engine can be used even when not supported by the text-editing UI. This of course would require the support of extended markdown syntax by the engine.

I think as this editor used markdown in the backend there should always be an option to switch to RAW mode and supported elements should be rendered as expected. E.g. when I copy paste an markdown file to my nextcloud foldert and open it with Text it should display all elements correctly, not only those that are supported by the UI. For the time beeing those not supported by the UI could be marked so its obvious that those can only be edited from the RAW mode.

@juliusknorr
Copy link
Member

@fajabird See #123

@max-nextcloud
Copy link
Collaborator

I had a brief look at tiptap tables, markdown table syntax (gfm). Gfm tables are really lightweight. They do not allow for other nodes inside the tables - so no lists or even multiple paragraphs in the table cells. This will make tables somewhat less powerful but also easier to implement.

I think a meaningful first step would be rendering existing tables in Markdown, showing them in the editor and allowing to change the content. This would require:

  • Adding a table extension to markdownit to parse the tables in markdown to html
  • Adding a table extension to tiptap and limiting it to only allow the table structures markdown permits:
    • only one (optional) table header on top
    • no nested nodes inside table cells (content: marks or so for the table cell node?)
    • Add a toMarkdown function to the different nodes that make up a table.

If we add all that we would be able to:

  • display existing tables in markdown
  • handle copy and paste of html tables (removing all nested marks)
  • allow editing of table content (it's simply another kind of node in tiptap)
  • allow removing entire tables etc.

It would not include menu bar items to create a table, add / delete rows and columns, change alignment etc.
I think this would significantly reduce the need for UI discussions around creating / editing table structures.

@juliusknorr
Copy link
Member

Sounds good, we can look into the table inserting and adding/removing columns in a second step.

@mejo-
Copy link
Member

mejo- commented Feb 16, 2022

Thanks for looking into this @max-nextcloud, sounds really promising 👍

I also think that keeping tables simple makes sense. There's no way to represent tables with multiline cells or other complex formatting inside the cells in markdown anyway, so it makes sense to me to restrict this to single-line tables and only marks (no futher nodes) allowed inside them.

We definitely need menu bar tools for creating/modifiying tables in my opinion, but that certainly can happen in a second step.

@juliusknorr juliusknorr moved this from Todo to In Progress in 📝 Office team Mar 9, 2022
@ajoana
Copy link

ajoana commented Mar 13, 2022

Multi-editor solution could come in a second time. I think the main needs are for an editor :

  1. that don't break the code (tables and yaml)
  2. that can edit table (and yaml) in raw mode and preview it
  3. that work on table in wysiwyg mode in single-user mode
  4. that work on multi-user mode
  5. that make the coffee and have a tour outside with the pet.

As a normal user, what could I do to stimulate progress on this issue? Could I sponser someone to get it done quickly? To me, the limitations of the default text app is a MAIN show stopper to better use and recommend NC.
I love collectives (text app mandatory) and wish to publish parts of the collectives using pico cms or other online md publishing tools.

  1. this would be an urgent request (see pico cms and other issues)
  2. could be a second step after 1.
  3. this is an urgent request seeing this open here more than 1,5 years.
  4. could be a second step after 3 - I don't see this important for our group as focus is on collectives

@max-nextcloud
Copy link
Collaborator

Hi y'all.

Thanks for your input on this issue. I'm working on it right now. My implementation aims to follow what text does in general. First of all because of consistency, second also because it's easier. So i am aiming at:

  1. collaborative edititing
  2. rendering the tables in the editor and editing them rather than the source code
  3. preserving the meaning of markdown - but not necessarily the exact code.

With respect to 2. I hope to look into a markdown view at some point but that would be for all of text - not just for tables.

Regarding 3. I am investigating ways to minimize the diff when editing markdown files in text. For now we read the entire file, convert it to html, load it into tiptap, fetch the html from tiptap and then store that as markdown. We'll have to keep track of the initial markdown or at least some of its properties to preserve it. This is best discussed in #593.

vinicius73 pushed a commit that referenced this issue Mar 14, 2022
Signed-off-by: Vinicius Reis <[email protected]>
max-nextcloud pushed a commit that referenced this issue Mar 15, 2022
Signed-off-by: Vinicius Reis <[email protected]>
max-nextcloud pushed a commit that referenced this issue Mar 16, 2022
Signed-off-by: Vinicius Reis <[email protected]>
max-nextcloud pushed a commit that referenced this issue Mar 17, 2022
Signed-off-by: Vinicius Reis <[email protected]>
max-nextcloud pushed a commit that referenced this issue Mar 17, 2022
Signed-off-by: Vinicius Reis <[email protected]>
max-nextcloud pushed a commit that referenced this issue Mar 21, 2022
Signed-off-by: Vinicius Reis <[email protected]>
max-nextcloud pushed a commit that referenced this issue Mar 23, 2022
Signed-off-by: Vinicius Reis <[email protected]>
max-nextcloud pushed a commit that referenced this issue Mar 23, 2022
Signed-off-by: Vinicius Reis <[email protected]>
@juliusknorr juliusknorr added this to the Nextcloud 24 milestone Mar 24, 2022
vinicius73 pushed a commit that referenced this issue Mar 30, 2022
nextcloud-command pushed a commit that referenced this issue Mar 30, 2022
Signed-off-by: Vinicius Reis <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
max-nextcloud pushed a commit that referenced this issue Mar 31, 2022
Signed-off-by: Vinicius Reis <[email protected]>
max-nextcloud pushed a commit that referenced this issue Mar 31, 2022
Signed-off-by: Vinicius Reis <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
max-nextcloud pushed a commit that referenced this issue Mar 31, 2022
Signed-off-by: Vinicius Reis <[email protected]>
max-nextcloud pushed a commit that referenced this issue Mar 31, 2022
Signed-off-by: Vinicius Reis <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
Repository owner moved this from 🏗️ In progress to ☑️ Done in 📝 Office team Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop enhancement New feature or request feature: formatting Features related to text formatting and node types
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.