To do this, I created a Scrivener compile format which set up chapter headings correctly with a link target above them as recommended. Then I wrote some scripts to process the output from Scrivener compile to make AsciiDoc in the flavor that O’Reilly wanted.
I have released my Scrivener compile settings and scripts so that others can use them should they want to produce asciidoc from Scrivener. They are open source under an Apache license at https://github.com/jorhett/scrivener-asciidoc.You can read the original article at http://www.netconsonance.com/2014/07/scrivener-compile-to-asciidoc/. Comments are welcome here or there as you please.