bcdavasconcelos / ScrivQ

🚀 ScrivQ (Scrivener + Quarto) is a template that adapts the Scrivener writing environment to easily export multiple files, handle bibliographies and cross-references, and build a complex YAML front-matter (with hundreds of built-in parameters) for outputting Quarto Books in PDF, HTML, DOCX.
17 stars 2 forks source link

Convert markup for file splitting #5

Closed bcdavasconcelos closed 1 year ago

bcdavasconcelos commented 1 year ago

To split the files properly, we must:

From:

Lorem ipsum dolor sit amet[^fn1], ...

[^fn1]: Lorem...

To:

Lorem ipsum dolor sit amet^[Lorem...], ...

From:

![Caption][Ulysses1]

[Ulysses1]: Ulysses1.jpg {#fig-scriv154 .column-page width=486 height=402}

To:

![Caption](Ulysses1.jpg){#fig-scriv154 .column-page width=486 height=402}
bcdavasconcelos commented 1 year ago

I toiled away all day on this and got a preliminary version working. I have no idea if the strategy adopted is the best but it seems to work. https://github.com/bcdavasconcelos/ScrivQ/blob/d00a87fe934c6550173539f65db6c6e1d560dd88/compile_script.rb#L126-L151