Markdown syntax ignored when importing an .md file

Hello everyone!

Since S3 supports import of markdown, I was curious to see what I could possibly get out of it. :slight_smile:

So far I’m seeing two issues, which might not be actual issues, but simply my not seeing correct settings:

  1. While md is basically a plaintext, for some reason font face/size formatting is assigned to it upon import, and it’s not the defaults set in Scrivener for new files. I wonder where this comes from, since md doesn’t have any such formatting of its own. I was able to fix it with selecting all documents in the binder, then Documents > Convert > Text to default formatting, but I’m still curious.

  2. Markdown syntax is not processed upon import (# for headers, * for italics, ** for bold etc. are imported as just symbols and do not result in correct formatting).

Basically, markdown is imported as plaintext, and you get only downsides from that. :slight_smile:

It’s no big deal when the goal is using S3 as an easy compiler for a bunch of md files into one file (compiling as md to odt works fine). But I wonder if that’s how it is supposed to be? At least syntax should be processed, no? Am I not seeing something?

If somebody could clarify, I would be grateful. :slight_smile:

Have a look at Tools > Sharing > Plain Text. There’s a setting for the font to be used for plain text imports.

I could well be wrong, but AIUI importing the text doesn’t do any syntax translation. Instead, the translation is expected to take place when you compile the document — I imagine (but don’t know) the idea is that you will continue to work on the text using markdown syntax within Scrivener. Many people do work that way – as you say, as an organising and compiling tool for markdown files. (They often combine it with the External Folder Sync feature, which allows you to continue working on / creating markdown files in a proper editor like Vim or Emacs :wink: .

If you want to import the document with the syntax already converted to RTF then I think you may have to convert it first (using Pandoc, for example).

Thanks for your response. :slight_smile:

If by Tools you mean Options, then there’s no setting for formatting of imported plaintext, only encoding. Imo, it would be logical to import plaintext with default formatting, not something absolutely random like Segoe UI at 9pt, which renders basically unreadable tiny text.

I can absolutely see why markdown syntax would not be processed by default. However, I wondered if maybe there was a setting to process it, a checkbox or something. Otherwise it very well could have been available for import back in S1, since it’s imported as plaintext anyway. :slight_smile:

In my particular case I’m dealing with 40+ separate md files, which I will need to convert to odt and merge together into a single file. Yes, Pandoc can do it via cli, but I wanted to see what Scrivener could do and if I could maybe finish my current writing project in it.

Like I said, might not be an issue, per se. :slight_smile: Thanks again!

1 Like

Sorry, I don’t have access to the Windows version at the moment. Yes, I meant Options…

The setup of the Windows Options / Mac Preferences is mostly identical, so if there is a setting for something on the Mac version (in this case Preferences > Sharing > Plain Text), then that’s normally where it will be on Windows. It’s definitely there on the Mac, so if you can’t find it there, then it’s likely the setting hasn’t been added to the Windows version yet. I imagine it will be in due course.

BTW, it sounds like the External Folder sync feature may be useful for you if you want to continue working on the project. There are a few wrinkles to it, but it can be very helpful if you like writing in markdown in another editor while still having Scrivener’s organisational features to hand.

Sorry for any confusion!

1 Like

On the matter of importing text, that’s a silly bug that is potentially a side-effect of there being a missing setting. There should be a checkbox and font selection control in the Sharing: Import options tab which allows one to have recognised plain-text file formats imported using an alternate font from the defaults. All other aspects of one’s default formatting settings would be used. So it’s currently acting like that option is set, but since there is actually no font selector, it seems to fall back to some system level font. It’s a nice setting if you want a fancier font for rich text, but generally import source code or other stuff that would benefit from a fixed-width font, as plain-text.

As you note, you can just select the batch of imported files and hit Ctrl+0 to reset the formatting, so the issue at least has an efficient workaround, and one that is commonly used after a batch import anyway, no matter the workflow.

Well, if you’re not actually intending to use Scrivener to write Markdown, then you shouldn’t be importing Markdown files. I’m a little confused at this point though, since you mentioned wanting to test the new Markdown features in v3. If you get rid of all the Markdown, what are you testing?

At any rate—to provide advice for what you’re trying to do specifically: just use MultiMarkdown or Pandoc to convert your Markdown files to .odt or .docx respectively. Nothing is going to convert Markdown to high quality formatted text better than these tools. We do have some very (I stress very) basic conversion via the File ▸ Import ▸ Import and Split... menu command, but that command is more interesting for how it can convert Markdown heading structure to outline hierarchy, in my opinion.

And in case you are wondering, that’s not something you would lose by using Pandoc to make .docx files, of course, since it will be building an outline into the heading stylesheet, which can also be parsed into outline structure in v3 via this same command.

In my particular case I’m dealing with 40+ separate md files, which I will need to convert to odt and merge together into a single file. Yes, Pandoc can do it via cli, but I wanted to see what Scrivener could do and if I could maybe finish my current writing project in it.

Yeah, so it sounds to me like overall the confusion is that Scrivener’s Markdown support is designed for actual Markdown users, those who want to write with it from start to finish, who don’t consider any of the aspects of plain-text to be downsides, and want to use the high quality conversion options provided by these tools upon compilation.

There are shades of grey in here though, and you can read a bit about them in the user manual, under §21.4, Markdown and Scrivener. On the other end of the spectrum, one can in some cases produce and use Markdown conversion without knowing a thing about Markdown. I.e. your styles and some simple formatting can be converted to Markdown.

1 Like

I did not say I was going to test something. :slight_smile: I just wanted to see what it could do. Because I happen to have access to a Windows machine for the next two weeks, so why not. I used to write in S1 about 10 years ago and I liked it a lot. The new version seems to be even better, and I have a writing project about to be finished. :slight_smile:

Thing is, my main setup is Fedora + Android tablet (+ Android phone sometimes when inspiration strikes), so I’m not a Scrivener target audience, sorry. :frowning: I’m using markdown text editors because it is the only solid cross platform solution. There are no OpenDocument editors for Android, and neither there are rtf editors. Besides, I’m not sure you could edit Scrivener’s rtfs directly without breaking anything. So. What else.

But brookter has mentioned an interesting tool. I’ll have a look into it. I don’t think there was something like this in S1. Organisational features is what I miss the most, tbh.

Okay, we might be saying something similar with different words. Checking to see what a thing can do is what I meant by test, just in a less formal way! :sunglasses:

For your purposes, I do agree the external folder sync feature is probably best, and if you do go with Markdown from start to finish, it’s of course extremely portable and you don’t have to worry about any formatting getting lost during sync, as you would with a rich text workflow in Scrivener and plain-text syncing. But the latter approach does work as well, and does its best to avoid widespread formatting loss—only modifying the paragraphs you edit and so forth. You just have to be more aware of where your images are and other such special elements, and make sure not to edit them out completely, on accident.

There are no OpenDocument editors for Android, and neither there are rtf editors. Besides, I’m not sure you could edit Scrivener’s rtfs directly without breaking anything. So. What else.

That seems crazy to me! Not even Google Docs (not that I’m a huge fan of using Google for anything, but hey, not everyone is like me)?

Well if you ever did find something that can, the folder sync feature can be set to use RTF, and obviously that will be the best approach if you do have an external editor that can handle it. Definitely do not advise editing the .scriv bundle files themselves.

I hate Google and I’m not trusting them with my writing. :slight_smile: I’ve heard people claim that Google has blocked access to their own files on several occasions, which implies that they scan the content. Don’t know if it’s true or not, but wouldn’t put something like that past them. Besides, access to internet is required for any cloud activities.

Other than that, there are not much cross platform solutions for Linux+Android (+maybe occasional Windows, but that’s rare). So I’m sure there will be no Scrivener for Android in the foreseeable future, because you will need to write an rtf editor for that. :slight_smile:

P.S.: Now, maybe MS Word for Android can handle rtf, I’m not sure. But then again, if Scrivener files cannot be edited directly, why even bother.

Oh sure, I expect Google to scan anything and everything you do at every level, on every page you visit even if it isn’t their page, no matter how private you may think it should be (remember when they were scanning personal emails to help generate ads? Maybe they still do, who knows). Whether the scans are logged or recorded anywhere is another matter, but as they have a history of not being fully transparent about even that, who knows. For me it’s not worth bothering, there are plenty of good alternatives.

Besides, access to internet is required for any cloud activities.

Okay, I was thinking that they would have something on Android like they do with Chromebooks, where stuff can be made available offline—but I suppose it is an academic point.

So I’m sure there will be no Scrivener for Android in the foreseeable future, because you will need to write an rtf editor for that.

Well the cool thing here is that we already have. :slight_smile: Scrivener for Windows is written in Qt, which runs on Android, and does have a basic RTF editor that they have spent a lot of time making better. From what I understand the biggest challenge will be the user interface, much of the internal stuff is already there.

1 Like

That’s great news! Mobile devices these days seem to be an important market, so to have such tool on a tablet would be great, even if with limited functions compared to the desktop version. I hope L&L succeeds. :slight_smile: