Bug 94978 (Markdown) - [Request] Save as Markdown
Summary: [Request] Save as Markdown
Status: NEW
Alias: Markdown
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: lowest enhancement
Assignee: Not Assigned
URL: https://ask.libreoffice.org/t/markdow...
Whiteboard:
Keywords:
: 129413 (view as bug list)
Depends on:
Blocks: Format-Filters
  Show dependency treegraph
 
Reported: 2015-10-12 10:13 UTC by Robert Orzanna
Modified: 2024-04-19 13:37 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Orzanna 2015-10-12 10:13:20 UTC
Dear all, 

Markdown is gaining popularity for its good balance between simplicity, readability and feature-richness.

What is your opinion on a built-in support for Markdown exports in Calc?

One way I could imagine such a support is by export tables created in Calc to Markdown syntax. 

Calc could make use of the library "csvtomd" [1]. It takes a csv file as an input and converts it to Markdown syntax. 

I could imagine this conversion to run in the background when the user selects "Save as Markdown". It would take the table, convert it to csv first and then use "csvtomd" to export it to a plain text file containing the Markdown syntax. 

Looking forward to a conversation on this. 

Warmly,

Robert

[1] https://github.com/mplewis/csvtomd
Comment 1 Adolfo Jayme Barrientos 2015-10-13 13:19:08 UTC
Looks like a cool enhancement, thanks for sharing your idea!

I think this does not need to be necessarily an integrated part of Calc, however. I imagine that creating an extension would suffice. Besides, one can already export as CSV from Calc and input that file to csvtomd, and I don’t believe that LibreOffice wants to compete with dedicated Markdown-editing software – thus, lowering this ticket’s importance (not blocking or discouraging anybody from working on this, should they please someday).

For the record, we like Markdown as well: one of our hackers has created a tool to create presentations from .md [1], but note it’s not part of LibreOffice proper.

[1]: https://github.com/thorstenb/odpdown
Comment 2 Robert Orzanna 2015-10-15 05:45:50 UTC
(In reply to Adolfo Jayme from comment #1)
> Besides, one
> can already export as CSV from Calc and input that file to csvtomd, and I
> don’t believe that LibreOffice wants to compete with dedicated
> Markdown-editing software – thus, lowering this ticket’s importance (not
> blocking or discouraging anybody from working on this, should they please
> someday).

That's a valid point. My reasoning was that by integrating the library into the core of LO, it would be more likely to have it maintained over the long-term. 

 
> For the record, we like Markdown as well: one of our hackers has created a
> tool to create presentations from .md [1], but note it’s not part of
> LibreOffice proper.
> 
> [1]: https://github.com/thorstenb/odpdown

That's cool. Thanks for sharing!

~ Robert
Comment 3 Roman Kuznetsov 2019-12-15 16:58:09 UTC
*** Bug 129413 has been marked as a duplicate of this bug. ***
Comment 4 Vadim vadcx 2023-04-22 10:26:32 UTC
I'd like to explain why Calc -> CSV -> Markdown is not the same and there's added value in creating a direct Markdown output.

First, CSV is a plain text format. Literal plain text, without formatting. By contrast, Markdown does support basic formatting like bold, italic, links etc.
Second, the content of table cells can be aligned left/center/right in Github-flavored Markdown.
Both these features are lost when dealing with CSV exports.

Third, Markdown can (and should be!) viewed as a document format. CSV is only good for single tables, however Markdown allows to create semantic sections thus allowing to export all/multiple sheets of a single Calc document.

For example, if the document contains "Sheet1", "Sheet2", an example Markdown output could look like this (unless the user selected a heading-less single sheet export):

----

# Sheet1

// table contents here

# Sheet2

// table contents here 2

----

What's the current behaviour with CSV? To only export the current sheet (acceptable) and to show a warning message:

"Warning saving the document table:
Only the active sheet was saved."

----

The advocates of "Commonmark" will tirelessly argue, that Markdown does not support tables... well their limited subset of the Markdown-family does not. Most (popular) applications support the tables and it is reasonable for users to expect them.

Because the tables are so hard to edit in text in Markdown, the "proper tool for the job" is a spreadsheet program like Calc. The only missing step is an easy export, to complete the workflow for an increased productivity.

Finally, there are Markdown extensions that even support "merged cells" but I would consider such functionality niche and to not be required to fulfill the needs of >95% of users.

Reference links:
Github: https://github.github.com/gfm/#tables-extension-
Reddit: https://www.reddit.com/wiki/markdown/#wiki_tables
Stackoverflow (based on Github): https://stackoverflow.com/markdown#link-tables