quarto-dev / quarto-dev/quarto-cli

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

オープン
#3,955 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement extensions needs-design
主要言語
JavaScript
スター
6k
フォーク
458
平均マージ
1日 9時間
マージ済み PR(30日)
41

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
cli
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。