Support for AsciiDoc

I want to use AsciiDoc instead of MMD with Scrivener. AsciiDoc is more expressive for technical documentation. It provides a wider range of output formats than Markdown. Out of the box, we can type Asciidoc markup in Scrivener’s editor and compile a text file that can be processed by any AsciiDoc toolchain. This allows use of many features that Scrivener has which programming editor’s lack. Scrivener has no peer for organizing research and outlines, but it’s editor isn’t quite the ultimate Swiss Army knife for single sourcing. So I’m looking for features found in a programmer’s editor, or the means to use an editor (Sublime for example) with Scrivener.

Simplified markup languages offer killer benefits. In the case of AsciiDoc, markup is converted to DocBook XML, and then transformed into any output format imaginable. The learning curve is minimal compared to authoring in DITA, Tex, or DocBook. Plus, the content itself is not so encoded it can’t be adapted to future tools that don’t exist yet. In my humble opinion, lightweight markup is the way forward, and AsciiDoc is currently the best lightweight syntax.

Is there any possibility that Scrivener could provide AsciiDoc syntax highlighting, or integration with the a2x, asciidoc, and (ideally) AsciiDoctor toolchains? Or that it could provide real-time preview while I type?

But rather than support a new batch of compile options, perhaps Scrivener could provide a means to open a text in an alternate editor, while watching for changes to the file. Something like “Open in External Editor”). If Scrivener could be configured to pass text to an editor such as Sublime (for highlighting, builds, preview, etc.), and if Latte magic grabbed up any edits made automatically, Scrivener would instantly become the most flexible writing tool in the world. Literally any type of coding or markup could be performed. How’s that for an enhancement request ? Thank you for listening. And thank you for Scrivener!

I am embarrassed to admit, Scrivener for OS/X already supports the external editor integration that I asked for in my post. I didn’t know about the File > Sync > with External Folder mechanism until I read the article “How to sync Scrivener with any text editor (and go mobile too)” at iainbroome.com/scrivener-mobile-sync.

Once I create the sync folder, I can open any file in my editor (Sublime), which performs the syntax highlighting and toolchain transforms. This is the best of both worlds, because it allows me to organize my research and thoughts in Scrivener, while using any markup format and the features of a programmer’s editor for markup-specific tasks.

A document opened for editing can be easily transformed by setting up a “Build” in Sublime. In my case, I customized the editor to generate HTML using the Asciidoctor toolchain.

Graphics were easy. I placed an images folder inside the Draft folder created by Scrivener. To transform all files, I compiled a text file (with extension .asciidoc) to the Draft folder, opened that in Sublime, and told Sublime to build. It took .8 second to convert a 224K file to HTML.

This is impressive. Thank you so much! Scrivener is the most flexible writing tool in the world. I can’t wait to use this technique on my next writing project.

– civilin

Glad you found that way of working! Scrivener’s MMD support is not so much an editor feature, but a collection of conveniences while compiling. It can generate some syntax for you using MMD conventions, and then handle the trickier business of what would otherwise require manual setup and shell scripting. There is quite a bit that can be done with Compile configuration though. the -Formatting pane offers a lot of power once you dig into it, especially with the prefix/suffix system when applied to type/level outlining. Replacements are RegEx capable, which offers a huge amount of automation for those comfortable with the syntax.

And another alternative to all of that is back to MMD itself. With its XSL compatibility, you can generate just about format you need. Even complicated output like LaTeX and ePub are possible with it. So it would not be impossible to start with MMD and end up with something more precise, especially when you toss RegEx replacements into the mix. Take a look at the Scapple documentation project available on our support page. I do a lot of raw LaTeX injection with replacements to overcome basic abstraction limitations in the MMD format.