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

CLI should allow building collection #205

Closed
ronaldtse opened this issue Jan 4, 2021 · 10 comments
Closed

CLI should allow building collection #205

ronaldtse opened this issue Jan 4, 2021 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@ronaldtse
Copy link
Contributor

In the CLI implementation today we cannot build a metanorma collection.

This is how we do it now:

bundle exec metanorma site generate . -o published -c collection.yml
bundle exec metanorma collection si-brochure-bilingual.yml -x xml,html,presentation,pdf -w bilingual-brochure -c collection_cover.html

The second line builds a metanorma collection using the config file si-brochure-bilingual.yml.

I believe we can integrate this command into the configuration file for site generate. We might even want to clarify the roles of the commands: compile, collection and site so they have different functions.

Ping @abunashir and @CAMOBAP for thoughts.

@ronaldtse ronaldtse added the enhancement New feature or request label Jan 4, 2021
@opoudjis
Copy link
Contributor

Agreed. I would further add that the collection YAML (si-brochure-bilingual.yml) and the site YAML (collection.yml) MUST be kept separate: it would be a mistake to bind them tightly. The file name of the collection YAML should be one of the entries in the site YAML.

@ronaldtse
Copy link
Contributor Author

ronaldtse commented Mar 11, 2021

Here's an example from bipm-si-brochure. In si-brochure-bilingual.yml, you can see a number of options have been moved from the command line into an option in this YAML.

https://github.com/metanorma/bipm-si-brochure/blob/87446b21470e0edc3625e89bcc01d93fe389263f/metanorma.yml#L57-L61

---
metanorma:
  source:
    files:
...
    - sources/si-brochure-en.adoc
    - sources/si-brochure-fr.adoc

    # The Collection
    - sources/si-brochure-bilingual.yml

  collection:
    organization: "BIPM - Bureau International des Poids et Mesures"
    name: "SI Brochure edition 9, semantic encoded version"

https://github.com/metanorma/bipm-si-brochure/blob/b2c8a441e2b8e77abf8026f194f256b535e5494a/sources/si-brochure-bilingual.yml#L1-L60

directives:
  - documents-inline

bibdata:
  title:
    - language: en
      content: The International System of Units (SI)
    - language: fr
      content: Le Système international d’unités (SI)
  type: collection
  docid:
    type: bipm
    id: sibrochure
  edition: 9
  date:
    - type: updated
      value: 2019-05-20
  copyright:
    owner:
      name: Bureau International des Poids et Mesures
      abbreviation: BIPM
    from: 2019

# TODO, was CLI option, not yet supported
output_dir: bilingual-brochure

# TODO, was CLI option, not yet supported
formats:
  - xml
  - html
  - presentation
  - pdf

manifest:
  level: brochure
  title: Brochure/Brochure

  # TODO, not yet supported
  # Option 1, specify built files
  # Option 2, specify source if not built
  documents:  # was `docref`
    - source: si-brochure-fr.adoc
      identifier: si-brochure-fr

      # was `fileref`
      rendered: site/documents/si-brochure-fr.xml

    - identifier: si-brochure-en
      source: si-brochure-en.adoc
      rendered: site/documents/si-brochure-en.xml

# TODO, was CLI option, not yet supported
cover: collection_cover.html

prefatory-content:
|


final-content:
|

Desired compile command:

  • metanorma site generate to generate all documents + collection (since the yaml is specified in path)
  • metanorma si-brochure-bilingual.yml

@ronaldtse
Copy link
Contributor Author

Here's the relevant PR metanorma/bipm-si-brochure#86 that we want to make working.

@ronaldtse ronaldtse moved this to Triage in Metanorma Nov 25, 2021
@ronaldtse ronaldtse moved this from Triage to Urgent in Metanorma Nov 25, 2021
@abunashir
Copy link
Member

@ronaldtse: I think this was resolved by #260, can we close this one or is there anything else?

@abunashir abunashir changed the title CLI should allow building collection ? May 14, 2022
@abunashir abunashir changed the title ? CLI should allow building collection May 14, 2022
@abunashir
Copy link
Member

ping @ronaldtse, @opoudjis ⬆️

@ronaldtse
Copy link
Contributor Author

@abunashir have you updated metanorma/bipm-si-brochure#86 to use the new functionality?

@abunashir
Copy link
Member

Yes, I've updated the supported attributes here - metanorma/bipm-si-brochure@5b6d657, so it's there from the cli side.

For the changes on the core attributes we still need to do that to the metnorma itself. I can do that, but is there any concern renaming those attributes in metanorma @opoudjis?

@ronaldtse
Copy link
Contributor Author

Thank you @abunashir ! We want to implement the changes to the inclusion attributes too:
https://github.com/metanorma/bipm-si-brochure/blob/5b6d6578a88022010769721e9178167054e7ce61/sources/si-brochure-bilingual.yml#L43-L67

Can you please help implement them in metanorma-cli? Thanks!

@ronaldtse
Copy link
Contributor Author

@abunashir I've tried this locally and there are several problems. I will list out the problems individually.

@ronaldtse
Copy link
Contributor Author

ronaldtse commented Sep 7, 2022

Let's close this issue, the remaining bugs are #283 and #284, and #282 for the enhancement of automatically building linked dependencies.

Repository owner moved this from 🌋 Urgent to ✅ Done in Metanorma Sep 7, 2022
@ronaldtse ronaldtse removed this from Metanorma Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants