metanorma / bipm-si-brochure

SI Brochure edition 9, semantic encoded version (WARNING: DRAFT)
3 stars 0 forks source link

Site generate for collection generates component PDFs twice #209

Open ronaldtse opened 2 years ago

ronaldtse commented 2 years ago

The si-brochure-en.pdf and si-brochure-fr.pdf files are compiled twice when using metanorma site generate, once under site/documents and once under site/brochure.

This needs to be fixed. (cc @abunashir)

Originally posted by @ronaldtse in https://github.com/metanorma/bipm-si-brochure/issues/186#issuecomment-1305199238

ronaldtse commented 2 years ago

Here's the full log. You can clearly see the duplicated commands:

[info]: Compiling /Users/me/src/mn/bipm-si-brochure/sources/si-brochure-en.adoc ...
...
java -Xss5m -Xmx2048m -Dapple.awt.UIElement=true -jar /Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/mn2pdf-1.50/lib/../bin/mn2pdf.jar --xml-file "/Users/me/src/mn/bipm-si-brochure/site/documents/si-brochure-en.presentation.xml" --xsl-file "/Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/metanorma-bipm-7a70de29bfeb/lib/isodoc/bipm/bipm.brochure.xsl" --pdf-file "/Users/me/src/mn/bipm-si-brochure/site/documents/si-brochure-en.pdf" --param baseassetpath="/Users/me/src/mn/bipm-si-brochure/sources" --syntax-highlight  --font-manifest "/var/folders/2t/xmdrn2sd2lv2w49dv0zw9_q00000gp/T/fontist_locations20221107-22882-33x4gf.yml"
...

[info]: Compiling /Users/me/src/mn/bipm-si-brochure/sources/si-brochure-fr.adoc ...
...
java -Xss5m -Xmx2048m -Dapple.awt.UIElement=true -jar /Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/mn2pdf-1.50/lib/../bin/mn2pdf.jar --xml-file "/Users/me/src/mn/bipm-si-brochure/site/documents/si-brochure-fr.presentation.xml" --xsl-file "/Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/metanorma-bipm-7a70de29bfeb/lib/isodoc/bipm/bipm.brochure.xsl" --pdf-file "/Users/me/src/mn/bipm-si-brochure/site/documents/si-brochure-fr.pdf" --param baseassetpath="/Users/me/src/mn/bipm-si-brochure/sources" --syntax-highlight  --font-manifest "/var/folders/2t/xmdrn2sd2lv2w49dv0zw9_q00000gp/T/fontist_locations20221107-22882-zzzr08.yml"
[info]: Building collection file: /Users/me/src/mn/bipm-si-brochure/site/documents.xml ...
[info]: Generating html site in /Users/me/src/mn/bipm-si-brochure/site ...
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
...

Render Init: 15:35:05
...
Render Files: 15:35:07
...
Internal Refs: 15:35:07
...

Process si-brochure-fr.html: 15:35:07
java -Xss5m -Xmx2048m -Dapple.awt.UIElement=true -jar /Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/mn2pdf-1.50/lib/../bin/mn2pdf.jar --xml-file "/Users/me/src/mn/bipm-si-brochure/site/brochure/si-brochure-fr.presentation.xml" --xsl-file "/Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/metanorma-bipm-7a70de29bfeb/lib/isodoc/bipm/bipm.brochure.xsl" --pdf-file "/Users/me/src/mn/bipm-si-brochure/site/brochure/si-brochure-fr.pdf" --syntax-highlight  --font-manifest "/var/folders/2t/xmdrn2sd2lv2w49dv0zw9_q00000gp/T/fontist_locations20221107-22882-sitrum.yml"
...

Process si-brochure-en.html: 15:35:58
java -Xss5m -Xmx2048m -Dapple.awt.UIElement=true -jar /Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/mn2pdf-1.50/lib/../bin/mn2pdf.jar --xml-file "/Users/me/src/mn/bipm-si-brochure/site/brochure/si-brochure-en.presentation.xml" --xsl-file "/Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/metanorma-bipm-7a70de29bfeb/lib/isodoc/bipm/bipm.brochure.xsl" --pdf-file "/Users/me/src/mn/bipm-si-brochure/site/brochure/si-brochure-en.pdf" --syntax-highlight  --font-manifest "/var/folders/2t/xmdrn2sd2lv2w49dv0zw9_q00000gp/T/fontist_locations20221107-22882-lm3p5x.yml"
...

Concatenate: 15:36:49
java -Xss5m -Xmx2048m -Dapple.awt.UIElement=true -jar /Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/mn2pdf-1.50/lib/../bin/mn2pdf.jar --xml-file "/Users/me/src/mn/bipm-si-brochure/site/brochure/collection.presentation.xml" --xsl-file "/Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/metanorma-bipm-7a70de29bfeb/lib/isodoc/bipm/bipm.brochure.xsl" --pdf-file "/Users/me/src/mn/bipm-si-brochure/site/brochure/collection.pdf" --syntax-highlight  --split-by-language  --font-manifest "/var/folders/2t/xmdrn2sd2lv2w49dv0zw9_q00000gp/T/fontist_locations20221107-22882-baqyuv.yml"
...

Coverpage: 15:39:15
...

Done: 15:39:15
Site has been generated at /Users/me/src/mn/bipm-si-brochure/site

Duplicated commands: English

[info]: Compiling /Users/me/src/mn/bipm-si-brochure/sources/si-brochure-en.adoc ...
...
java -Xss5m -Xmx2048m -Dapple.awt.UIElement=true -jar /Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/mn2pdf-1.50/lib/../bin/mn2pdf.jar --xml-file "/Users/me/src/mn/bipm-si-brochure/site/documents/si-brochure-en.presentation.xml" --xsl-file "/Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/metanorma-bipm-7a70de29bfeb/lib/isodoc/bipm/bipm.brochure.xsl" --pdf-file "/Users/me/src/mn/bipm-si-brochure/site/documents/si-brochure-en.pdf" --param baseassetpath="/Users/me/src/mn/bipm-si-brochure/sources" --syntax-highlight  --font-manifest "/var/folders/2t/xmdrn2sd2lv2w49dv0zw9_q00000gp/T/fontist_locations20221107-22882-33x4gf.yml"
...
Process si-brochure-en.html: 15:35:58
java -Xss5m -Xmx2048m -Dapple.awt.UIElement=true -jar /Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/mn2pdf-1.50/lib/../bin/mn2pdf.jar --xml-file "/Users/me/src/mn/bipm-si-brochure/site/brochure/si-brochure-en.presentation.xml" --xsl-file "/Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/metanorma-bipm-7a70de29bfeb/lib/isodoc/bipm/bipm.brochure.xsl" --pdf-file "/Users/me/src/mn/bipm-si-brochure/site/brochure/si-brochure-en.pdf" --syntax-highlight  --font-manifest "/var/folders/2t/xmdrn2sd2lv2w49dv0zw9_q00000gp/T/fontist_locations20221107-22882-lm3p5x.yml"

Duplicated commands: French

[info]: Compiling /Users/me/src/mn/bipm-si-brochure/sources/si-brochure-fr.adoc ...
...
java -Xss5m -Xmx2048m -Dapple.awt.UIElement=true -jar /Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/mn2pdf-1.50/lib/../bin/mn2pdf.jar --xml-file "/Users/me/src/mn/bipm-si-brochure/site/documents/si-brochure-fr.presentation.xml" --xsl-file "/Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/metanorma-bipm-7a70de29bfeb/lib/isodoc/bipm/bipm.brochure.xsl" --pdf-file "/Users/me/src/mn/bipm-si-brochure/site/documents/si-brochure-fr.pdf" --param baseassetpath="/Users/me/src/mn/bipm-si-brochure/sources" --syntax-highlight  --font-manifest "/var/folders/2t/xmdrn2sd2lv2w49dv0zw9_q00000gp/T/fontist_locations20221107-22882-zzzr08.yml"
...
Process si-brochure-fr.html: 15:35:07
java -Xss5m -Xmx2048m -Dapple.awt.UIElement=true -jar /Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/mn2pdf-1.50/lib/../bin/mn2pdf.jar --xml-file "/Users/me/src/mn/bipm-si-brochure/site/brochure/si-brochure-fr.presentation.xml" --xsl-file "/Users/me/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/bundler/gems/metanorma-bipm-7a70de29bfeb/lib/isodoc/bipm/bipm.brochure.xsl" --pdf-file "/Users/me/src/mn/bipm-si-brochure/site/brochure/si-brochure-fr.pdf" --syntax-highlight  --font-manifest "/var/folders/2t/xmdrn2sd2lv2w49dv0zw9_q00000gp/T/fontist_locations20221107-22882-sitrum.yml"
abunashir commented 2 years ago

Hi @ronaldtse, I was trying to look into it but I'm not sure if I understand it correctly. So, we are basically explicitly specifying the files once in metanorma.yml, where the file is specifying that the compiler should output pdf along with others.

And we are also specifying to generate pdf files in collection.yml file reference files, which is triggering the second pdf file generation for dependent files from here

What's the expected behaviour here? do we need to adjust the output extension we are expecting in each of those file, or generate one over another?

abunashir commented 1 year ago

@ronaldtse - When you have sometime could you please have a look on the last comment ⬆️