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

Render csv codeblock as table #1436

Closed
Yukaii opened this issue Mar 2, 2020 · 4 comments · Fixed by #1506
Closed

Render csv codeblock as table #1436

Yukaii opened this issue Mar 2, 2020 · 4 comments · Fixed by #1506
Labels
feature Wants to add a new feature
Milestone

Comments

@Yukaii
Copy link
Member

Yukaii commented Mar 2, 2020

@Yukaii Yukaii added this to the Next milestone Mar 9, 2020
@a60814billy a60814billy added the feature Wants to add a new feature label Apr 5, 2020
@daniele-athome
Copy link
Contributor

Nice feature. I wonder how this will be done. I mean I will still be able to render a CSV codeblock as a CSV codeblock right?

@Yukaii
Copy link
Member Author

Yukaii commented May 1, 2020

In my imagination, users can enable CSV as table with the syntax:

```csv {editor="true"}
John,Doe,120 jefferson st.,Riverside, NJ, 08075
Jack,McGinnis,220 hobo Av.,Phila, PA,09119
"John ""Da Man""",Repici,120 Jefferson St.,Riverside, NJ,08075
Stephen,Tyler,"7452 Terrace ""At the Plaza"" road",SomeTown,SD, 91234
,Blankman,,SomeTown, SD, 00298
"Joan ""the bone"", Anne",Jet,"9th, at Terrace plc",Desert City,CO,00123
```

And in the right side (preview panel), the data could be rendered to a table with HandsonTable(interactive) or some library. Then we can listen to the table on such events as afterChange, and reflecting the changes to the document.

@Yukaii
Copy link
Member Author

Yukaii commented May 1, 2020

It seems too far for implementing an editing feature. 🤣 Or we can just render CSV as HTML table when setting the language to csvpreview

```csvpreview
John,Doe,120 jefferson st.,Riverside, NJ, 08075
Jack,McGinnis,220 hobo Av.,Phila, PA,09119
"John ""Da Man""",Repici,120 Jefferson St.,Riverside, NJ,08075
Stephen,Tyler,"7452 Terrace ""At the Plaza"" road",SomeTown,SD, 91234
,Blankman,,SomeTown, SD, 00298
"Joan ""the bone"", Anne",Jet,"9th, at Terrace plc",Desert City,CO,00123
```

And providing more parsing options:

```csvpreview {header="true" delimiter=","}
First Name,Last Name, Address 1, Address 2, State, Zip
John,Doe,120 jefferson st.,Riverside, NJ, 08075
```

@daniele-athome
Copy link
Contributor

Nice, thanks! Editing would be a nice thing to add, but we can agree that CodiMD is not Excel :-)

@Yukaii Yukaii modified the milestones: Next, 2.2.0 Jul 20, 2020
edgarogh pushed a commit to WartaPoirier-corp/codimd that referenced this issue Sep 21, 2021
…-material-7.x

chore(deps): update dependency mkdocs-material to v7.1.10 (master)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Wants to add a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants