Skip to content
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

When extensions are explicitly given, DO NOT generate all formats #155

Open
ronaldtse opened this issue Jul 3, 2020 · 7 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@ronaldtse
Copy link
Contributor

e.g. document contains:

:mn-output-extensions: xml,html,doc,pdf,rxl

Then only these extensions should be generated. Right now, it's generating even STS output.

@ronaldtse ronaldtse added the bug Something isn't working label Jul 3, 2020
@ronaldtse
Copy link
Contributor Author

@andrew2net a bit urgent on this one. Can you help? Thanks!

@andrew2net
Copy link
Contributor

@ronaldtse is there any sample files?
I've tried to convert spec/fixtures/sample-file.adoc file. It contains :mn-output-extensions: xml,html. And I got 3 files:

spec/fixtures/sample-file.html
spec/fixtures/sample-file.presentation.xml
spec/fixtures/sample-file.xml

@ronaldtse
Copy link
Contributor Author

Can you try a file in mn-samples-iso? Thanks.

@andrew2net
Copy link
Contributor

andrew2net commented Jul 3, 2020

@ronaldtse I tried sources/amendment/rice-amd.awi.adoc from mn-sample-iso with :mn-output-extensions: xml,html,doc,html_alt,pdf,rxl and got next files:

sources/amendment/rice-amd.awi.alt.html
sources/amendment/rice-amd.awi.doc
sources/amendment/rice-amd.awi.html
sources/amendment/rice-amd.awi.presentation.xml
sources/amendment/rice-amd.awi.rxl
sources/amendment/rice-amd.awi.xml

@ronaldtse
Copy link
Contributor Author

ronaldtse commented Jul 3, 2020

@andrew2net that's very strange. In https://github.com/metanorma/iso-10303-2 I see:

:mn-output-extensions: xml,html,doc,pdf,rxl
iso-10303-2.alt.html
iso-10303-2.doc
iso-10303-2.html
iso-10303-2.pdf
iso-10303-2.presentation.xml
iso-10303-2.rxl
iso-10303-2.sts.xml
iso-10303-2.xml

(using latest gems)

@andrew2net
Copy link
Contributor

andrew2net commented Jul 4, 2020

@ronaldtse I think the issue is in the Makefile. It builds iso-10303-2.xml from iso-10303-2.adoc first. Then it builds all other formats from the XML file. I suppose because the XML file doesn't contain any output extensions the metanorma builds files in all possible formats.
I don't know why the Makefile is done that way. Do you agree we should build documents from the ADOC file, not from XML?

UPD on another side mn-samples-iec has similar Makefile and doesn't produce all formats. Will investigate why.

@ronaldtse
Copy link
Contributor Author

@andrew2net you are right!! I forgot that.

I don't know why the Makefile is done that way. Do you agree we should build documents from the ADOC file, not from XML?

It was done that way to separate the Adoc->XML generation (the canonical format is XML, as "encoding") and XML->others ("rendering).

In this case I guess the correct solution is not to generate "ALL" output... Let's hold this for now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants