quarto-dev / quarto-dev/quarto-cli

Rendering to a non declared custom format silently renders to quarto default format

Ouverte
#3,955 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

enhancement extensions needs-design
Langage dominant
JavaScript
Étoiles
6k
Forks
458
Merge moyen
1 j 9 h
PR mergées (30 j)
41

Description

> quarto use template quarto-journals/acs

Quarto templates may execute code when documents are rendered. If you do not
trust the authors of the template, we recommend that you do not install or
use the template.
 ? Do you trust the authors of this template (Y/n) » Yes
 ? Directory name: » test-quarto-acs
[>] Downloading
[>] Unzipping
    Found 1 extension.
[>] Copying files...

Files created:
 - bibliography.bib
 - placeholder.png
 - style-guide
 - test-quarto-acs.qmd
 - _extensions

> cd .\test-quarto-acs\

Then rendering to acs-html does "work" as no warning or error is thrown but

  • html is not defined in the _extensions.yml
  • document is rendered to HTML without using the common information defined in _extensions.yml (like the CSL file)

So it seems if the format is not explicitly defined, it will just pass through to main one, here HTML

Details of the render
> quarto render .\test-quarto-acs.qmd --to acs-html
pandoc
  to: html
  output-file: test-quarto-acs.html
  standalone: true
  section-divs: true
  html-math-method: mathjax
  wrap: none
  default-image-extension: png

metadata
  document-css: false
  link-citations: true
  date-format: long
  lang: en
  author:
    - name: Andrew N. Other
      note: A shared note
    - name: Fred T. Secondauthor
      affiliations:
        - name: Current address
          city: Some other place
          country: Germany
    - name: I. Ken Groupleader
      email: i.k.groupleader@unknown.uu
      phone: +123 (0)123 4445556
      fax: +123 (0)123 4445557
      affiliations:
        - id: unknown1
          name: Unknown University
          department: Department of Chemistry
          town: Unknown Town
        - id: second-uni
          name: Second University
          department: Department of Chemistry
          town: Nearby Town
      note: A shared note
    - name: Susanne K. Laborator
      email: s.k.laborator@bigpharma.co
      affiliations:
        - name: BigPharma
          town: Big Town
          country: USA
    - name: Kay T. Finally
      affiliations:
        - ref: second-uni
        - ref: unknown1
  title: 'A demonstration of the _achemso_ {{< latex >}} class^[A footnote for the title]'
  title-short: An _achemso_ demo
  keywords: 'American Chemical Society, LaTeX'
  abstract: |
    This is an example document for the _achemso_ documentclass, intended for submissions to the American Chemical Society for publication. The class is based on the standard LaTeXe _report_ file, and does not seek to reproduce the appearanceof a published paper.
    This is an abstract for the _achemso_ document class demonstration document.  An abstract is only allowed for certain manuscript types.  The selection of `journal` and `manuscript` will determine if an abstract is valid.  If not, the class will issue an appropriate error.This is the abstract.
  bibliography:
    - bibliography.bib

Output created: test-quarto-acs.html

I believe it should error if we expect to have explicitly a defined format in the extensions i.e at least adding html: default

YAML would be
title: ACS Journal Format
author: Charles Teague
version: 0.9.1
contributes:
  formats:
    common:
      csl: american-chemical-society.csl
      shortcodes:
        - fancy-text
      filters:
        - latex-environment
      environments:
        - scheme
        - chart
        - graph
        - tocentry
        - acknowledgement
        - suppinfo
      commands:
        - ce
    pdf:
      cite-method: natbib
      biblio-config: false
      format-resources:
        - achemso.bst
      template-partials:
        - "doc-class.tex"
        - "title.tex"
        - "_affiliation.tex"
    html: default

Or we should at least use the common information in format as someone passing explicitly a custom format e.g acs-html would expect that (I was)

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Reproduce the behavior with the shown quarto use template setup and quarto render .\test-quarto-acs.qmd --to acs-html command. Inspect how _extensions.yml format declarations are resolved, especially the fallback to HTML and handling of common; done means an undeclared custom format errors or applies the declared common configuration.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript
Domaine
cli
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.