Welcome to Scrivener!
Before getting too far into your query, there are a few resources I like to point new Scriv+Markdown users to:
- A primer on getting started with Markdown in Scrivener. Note this links to another post at the top, that I consider a close companion that goes over a situation much like your own, where you’ve imported Markdown into the project and want to make use of it without any adjustments.
- As an Obsidian user, you might also be interested in this way of working, along with this post that goes over precise settings for Scrivener and Obsidian.
All right, so to get into what you’re looking at, post-import, and how you can make that work for you, there are four key things to note:
- The double-bracket notation you’ve been using isn’t standard Markdown. It’s a convention some multi-file programs use, like Obsidian, but none of the conversion engines Scrivener uses (MultiMarkdown and Pandoc) will do anything useful with it.
- That isn’t a huge problem though, because single bracket notation is a Markdown standard used by these engines. You will find this approach used extensively in our user manuals (you can download the Scrivener manual as a .zip). At its simplest,
[Name of Section]will become a cross reference to## Name of Section(the number of hashes is irrelevant). - When you imported your .md files, their filenames would have come into the binder using the same name you used in the [[Link Text]]. That is self-evident, but what you might not know yet is that the compiler can generate headings based on your draft outline, giving you those hashes you need from the above point.
So in a sense, you may already be set up with one small tweak: adding a compile replacement rule to convert double brackets to single:
Replacement setup...
-
Open
File ▸ Compile.... -
Switch the Compile for option, at the very top, MultiMarkdown to HTML for a simple test. If you have Pandoc installed, you might want to try DOCX instead.
-
In the left sidebar, select either “Basic MultiMarkdown” or “Basic Pandoc”, depending on which conversion engine you intend to use.
-
For the purposes of this test, click the
Assign Section Layoutsbutton and for each entry in the left sidebar, assign it to the “Text Section with Heading” Layout, in the right column. You don’t have to worry about heading hash levels, the compiler will sort that out for you based on outline structure. -
Now click on the Replacements tab on the right (it looks like “ab → ac”), click the
+button, and add the following:Replace:
[[$@]]
With:[$@].The
$@token is, as you might expect, a wildcard. So we’ll be replacing the text found within double-brackets with single bracets. -
Click the
Compilebutton, and open the result in your word processor, browser, depending on what type of format you went with.
You should find all of your bracketed text are now proper links between sections in the output file.
Now you could, if you wanted, use the Project Replace feature to fix them all at once instead of using a Replacement. That won’t turn them into clickable links in Scrivener itself, but there is a nice feature there that might make doing this for everything a bit redundant. If you select the text between the brackets and right-click, it will look for a binder item that matches the title and offer it as a navigation option toward the top of the contextual menu. Linking without linking, basically, and maybe that will be good enough for all of these “legacy” links.
Going forward, you’ll note that in the user manual projects I very often do have hyperlinks inside the brackets. They don’t do anything when compiling, which is fine by me, it gives me control over when I want a link for myself vs a link for readers. If it is for the latter, then I type [[[Name of Binder Item]]]. Scrivener strips out two on each side, leaving the single-bracket behind which makes it a proper Markdown cross-reference link. You’ll also note that Markdown links have an alternate form that can be useful in many situations, [where this is the text visible to the reader][Binder Item Title].
You could maybe use a macro to fix all of the existing links, I bet AutoHotKey could make quick work of that since the bracket detection is all typing based. The macro would just need to find a [[, delete it, type it, look for the next ]] delete it, type it, and poof, now you have a link (or maybe have it type three like I suggested, so it stays a link readers see too).
On the other hand you could just make links inside the brackets whenever you come across one and want to jump to it. Distribute the work over years instead of doing it all at once, and only as needed.