olivierkes / manuskript

A open-source tool for writers
http://www.theologeek.ch/manuskript
GNU General Public License v3.0
1.78k stars 236 forks source link

Compiling is awkward; achieving specific output formats #491

Open worstje opened 5 years ago

worstje commented 5 years ago

If the title sounds lame, that is because it is. I have a lot of thoughts regarding this function and why it doesn't seem to quite suit my needs, and I don't want to flood the issues with tons of 'compile' related things that aren't quite bugs, but rather my newbieness, shortcomings, unintuitive UI and me trying to achieve perhaps unconventional stuff.

I primarily write fanfiction. This includes my primary project I have designated as my Manuskript guinea pig. I have two primary release formats that I am focusing on at present, neither of which strictly fall under the categories offered by the internal or Pandoc defaults. It should not come as a surprise that maining these two separately is a huge pain in the ass.

One is AO3 (Archive of Our Own), which supports a strict subset of html and a particular CSS structure.

The other is FF (Fanfiction) which only supports a really Markdown-esque format.

Problem #1: There does not appear to be such a thing as a 'compile profile'. I would love to be able to say 'export to X', and it remembers all the settings I need in order to properly export to X. Unfortunately, settings like transformations meant for 'exporting to Y' just get dragged over when one would never apply to the other.

The reason I use transformations is for some custom markup that does not distract from the actual text I am writing. On AO3, I have put in some effort to mark every distinct voice with its own colour using CSS, so that markup is converted with a transformation to the intended markup. On FF, I want the markup to silently disappear.

Problem #2: A lack of control over my output format, which is made worse by my levels / outline format.

Since I am an unstructured writer who is trying to squeeze in an existing origins work, the levels and text I have decided upon are currently of the format [YEAR] -> [DATE, TITLE]. This allows me to build up a natural in-story timeline for easy referencing. (I have no intentions of jumping back and forth in time, so the ordering limitation this implies is no big deal to me.) The years aren't too bad of a 'volume' indicator, either.

Regardless of the settings I mess with, I can't change the output nearly enough to look remotely what I need it to look like. And this brings me to my next realization:

Problem #3: Compiling doesn't mean exporting; I really need a way to output solitary chapters.

At this point I realize there is the Compile checkbox I missed in the Editor pane, and some Filter options that are said not to completely work.. and it is only a minor help. In addition there is the standalone textbox for Pandora... okay, leaving the compile screen and unchecking all the texts I don't need means I'm a bit closer to my desired output, but not quite close enough. It was way too awkward for my liking, but that is another hurdle taken.

It ought to come as no surprise that I am likely going to end up going down the Pandoc rabbit hole to try and adjust it to fit my needs. Between things like custom writers, YAML properties, special syntaxes and half the things I stumble across that aren't quite applicable to the formats I am exporting to, I am considerably out of my depth, and most of it isn't quite applicable to Manuskript, so I'm going to ignore those details where I can.

Problem #4: Exposing POV character property to Pandoc.

Before I dive into this one, allow me to share my desired AO3 output which is similar to this:

\<div class="perspective mark"> \

\<span class="tommy">"Hey dude!!"\</span> I hear a yell from afar: as always it is Tommy calling me with his eternally sunny disposition.\</p> \</div>

I can give every character a 'css' property with the relevant class used to make things look nice. I guess that YAML property syntax at the top of a text could manually define it (I haven't looked into this) but since this data is already being tracked, this would seem like a really awkward way to go about it.

If nothing else, it would be really nice to see some examples of how Pandoc and Manuskript play together.

Problem #5: Pandoc templates? Custom writers?

I don't know how I am going to produce my desired outputs, but I have a feeling I am going to need one or both of these Pandoc features to accomplish them. But the Manuskript 'manage exporters' screen is little more than a list of things in version 0.8.0, and I see absolutely zero features to try and support non-default Pandoc exporter formats. (Maybe it autodetects the relevant files in the Pandoc data dir, but I haven't quite gotten that far and am unable to spot it... in which case you can ignore this particular subject.)

I also can't help but take notice of the fact a number of Manuskript and Pandoc features (Transformations, smart quotes stuff, etc) seem to somewhat overlap. Pandoc seems to target the entire 'convert to a different format' functionality, so it makes me wonder whether I should just focus on purely automating pandoc... but with the current state of accessibility to pandoc features, that means essentially cutting out all of the Compile function.

Apologies for the length, and if anyone can give me any pointers to accomplish the things I am trying to accomplish, I would appreciate it. :-)

kakaroto commented 5 years ago

Just to answer your problem 5, I've talked about it in my issue #477 but basically yes, look at your data directory and add your reference document or template (reference.docx/.odt or templates/default.format) Note that the span/div can be done with pandoc's fenced divs and bracketed spans, see : https://pandoc.org/MANUAL.html#divs-and-spans It took me a bit to figure out the transformations to use, and how to set the reference document but now the compiled output matches exactly what I want.

I do agree though with having the ability to have different separations and transformations based on the output format, or having different export profiles, that would be a great feature to have. Being able to have a different reference/template file per export profile would be good too (export to standard manuscript format or export to the fancy document format you personally prefer, for example, without having to enable/disable transforms and manually change the reference document/template).