-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing a SecondaryFormat for external rendering #379
Conversation
…wn2tex` to `JMarkdown2PDF`
thanks @JonasIsensee , and sorry for I did a duplicated work. I found you added new |
Actually I don't think too much of this is duplicate. You currently have a type for e.g. md2pdf that is a duplicate of md2tex only that in the end it also calls latex. And you do the same thing for pandoc. I implemented a wrapper instead. (or whatever the types are called now) In my PR I implemented these secondary formats that delegate all the rendering to the primary format and then call the external process. In my opinion that is more elegant because we don't have define e.g. So maybe, if you agree, we could combine this idea with your work |
I see your idea, thanks for explaining in detail. |
I agree, I am also not fully comfortable with the additional layer of complexity of the wrapper. A simpler solution would be to split the feature into a separate function altogether and have something like.
Another way of splitting this while keeping it in one function would be to do
|
Okay, thanks. Let's go adding this layer (i.e. the approach of this PR). I think defining something like your @JonasIsensee , would you mind re-crafting a PR against the current master, please ??
I don't mind if you rename |
Will do as soon as I find the time! |
Opened the new version of this PR at #380 . |
Hi,
as speculated in my previous PR I implemented an idea to
make external rendering such as
md2pdf
orpandoc2pdf
etc.work just as a regular
WeaveFormat
.A
SecondaryFormat
wraps a primaryWeaveFormat
that does the hard work.In the very end of the
weave
function there is now a little callpostprocessing(doc, out_path)
that does nothing if the format is one of the normal formats but dispatches to the
external rendering if a
LatexPDF,
PandocPDF, or
PandocHTML` has been passed.@aviatesk
You seem to have been working on these files at the same time but I decided to create PR instead of first trying to fix the merge requests.
The current implementation already works quite well so maybe you could have a look at it to see if it is worth cleaning up.