metanorma / iso-10303-templates

Annotated EXPRESS rendering templates for ISO 10303
0 stars 0 forks source link

Update resource templates such that attachments are not inserted in the bibliography #42

Open ronaldtse opened 1 month ago

ronaldtse commented 1 month ago

If an attachment is in collection.yml with an identifier, it is no longer needed to add them to the bibliography, as per:

manuelfuenmayor commented 1 month ago

On my side, if I do what is told in the description, the listing cross-references get damaged:

From part 44: Screenshot 2024-10-09 155125

I'm using metanorma-2.0.5.

To replicate the issue

I've uploaded a test branch to build part 44 only: mf-listing-test.

Execute:

  1. git remote update
  2. git checkout mf-listing-test
  3. bundle exec suma build metanorma-srl.yml
opoudjis commented 1 month ago

If an attachment is in collection.yml with an identifier, it is no longer needed to add them to the bibliography, as per:

https://github.com/metanorma/metanorma/issues/410

Other way around @ronaldtse :

https://github.com/metanorma/metanorma/issues/410#issuecomment-2380615913

After discussion: while we can proceed with that,

[specifying attachments only in manifest and not in bibliography]

we will instead work on having attachments specific to documents within the collection,

[specifying attachments only in bibliography and not in manifest]

as that is all that is needed. I will need to debug ensuring that such attachments are generated only once, and travel with the rest of the document to the target directory. (Recall that attachments are always extracted to a predictable {filename}_attachments directory.)

That is where that ticket ended up.

ronaldtse commented 1 month ago

@opoudjis this is proven to work in:

manuelfuenmayor commented 1 month ago

@opoudjis this is proven to work in:

@ronaldtse, in https://github.com/metanorma/iso-10303/issues/369, I did use Nick's approach.

Notice how in part 44, the document is using the template to generate the syntax: * [[[myanchor,attachment:(...)]]], in the bibliography (I put it directly instead of using an include:: directive), and the path to the attachments in collection.yml are gone.

In other words, I've done the opposite of what this ticket is telling me. And this was according to Nick's instructions.

manuelfuenmayor commented 1 month ago

Please confirm if this is the correct approach. If so, I'll have to remove the - level: attachments branch from the manifest (collection.yml) of all resource documents and make a small update in the templates. (Note that the attachments will be inserted in the bibliography, but will not be present in the manifest.)