quarto-dev / quarto-dev/quarto-cli

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

Abierto
#3,955 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

enhancement extensions needs-design
Lenguaje dominante
JavaScript
Estrellas
6k
Forks
458
Merge medio
1 d 9 h
PR fusionados (30 d)
41

Descripción

> 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)

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript
Área
cli
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.