Help with imported markdown documents

Wo
Woowoo
Posts: 27
Joined: Tue Oct 04, 2016 8:05 pm
Platform: Mac + iOS

Thu Jul 18, 2019 4:46 pm Post

Hello.

I imported some markdown documents and none retained the formatting. (The markup is still there, of course.) Is there a way to tell Scrivener to format markdown lists as Scrivener/RTF lists? Headers as Titles? Etc.? Or will I have to change them all manually?

Thanks!

User avatar
AmberV
Posts: 23255
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Thu Jul 18, 2019 5:27 pm Post

If you want to destroy the Markdown syntax and turn it into a word processing file, then you need to use the File ▸ Import ▸ Import and Split tool, and check the appropriate option in the dialogue box. I do believe the file will need an “.md” type extension.

This isn’t super comprehensive though. In most cases you would be better off using an engine dedicated to turning Markdown into different formats, like Pandoc or MultiMarkdown, and then importing the product of that. We make no claims of competing with anything of that calibre.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

Wo
Woowoo
Posts: 27
Joined: Tue Oct 04, 2016 8:05 pm
Platform: Mac + iOS

Thu Jul 18, 2019 6:01 pm Post

AmberV wrote:If you want to destroy the Markdown syntax and turn it into a word processing file, then you need to use the File ▸ Import ▸ Import and Split tool, and check the appropriate option in the dialogue box. I do believe the file will need an “.md” type extension.

This isn’t super comprehensive though. In most cases you would be better off using an engine dedicated to turning Markdown into different formats, like Pandoc or MultiMarkdown, and then importing the product of that. We make no claims of competing with anything of that calibre.


This formats just fine for my needs. I take it there's no way to do this in bulk?

User avatar
AmberV
Posts: 23255
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Thu Jul 18, 2019 7:43 pm Post

Not really with the GUI, outside of combining the files together and then splitting them back apart with the Documents ▸ Split ▸  features. The automatic split function doesn’t work with conversion on account of how it works internally.

A problem like that is easily solved with something like this on the command-line:

Code: Select all

find . -name "*.md" -exec pandoc -t docx -o {}.docx {}\;


That presumes you launch it in the folder with the .md files (with that extension). It will produce one .docx file per .md file, in the same folder.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles