Skip to content

inspect - provide information about output files from input files #12809

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

Open
wants to merge 44 commits into
base: main
Choose a base branch
from

Conversation

cscheid
Copy link
Collaborator

@cscheid cscheid commented May 22, 2025

Closes #12805

(@cderv, I had to fix that projectContext safeClone bug in this PR, for the same reason. Just FYI!)

@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented May 22, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

Copy link
Collaborator

@cderv cderv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly, the cleanup test is failing... 😓

./run-tests.sh ./smoke/inspect/inspect-cleanup.test.ts

I'll merge the other PR we discussed yesterday, and you can rebase on main to see if this change something

@cderv
Copy link
Collaborator

cderv commented May 26, 2025

So it seems the problem that this PR causes is that now fileInformation is getting absolute path instead of relative path before

  • Previously
  "fileInformation": {
    "tests/docs/websites/issue-9253/index.qmd": {
      "includeMap": [
        {
          "source": "tests/docs/websites/issue-9253/index.qmd",
          "target": "_include.qmd"
        },
  "fileInformation": {
    "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
      "includeMap": [
        {
          "source": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd",
          "target": "_include.qmd"
        },

Is this new behavior expected? I'll find the change that did that.

I think regarding those paths, we have a question. Using an absolute path means we'll have a different quarto inspect output on Windows and on Linux, because of how it starts with an absolute path.

We can deal with the \\ vs / difference, but we will still have the drive letter, e.g., C:

Using a relative path for this output of inspect seems ok - also changing that will break any tools that already use inspect (like our tests are breaking)

Copy link
Collaborator

@cderv cderv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are the details for the difference

This is for

quarto inspect tests/docs/websites/issue-9253/index.qmd tests/docs/websites/issue-9253/index.json

With main we add this index.json

previously

{
  "quarto": {
    "version": "99.9.9"
  },
  "engines": [
    "jupyter"
  ],
  "formats": {
    "html": {
      "identifier": {
        "display-name": "HTML",
        "target-format": "html",
        "base-format": "html"
      },
      "execute": {
        "fig-width": 7,
        "fig-height": 5,
        "fig-format": "retina",
        "fig-dpi": 96,
        "df-print": "default",
        "error": false,
        "eval": true,
        "cache": null,
        "freeze": false,
        "echo": true,
        "output": true,
        "warning": true,
        "include": true,
        "keep-md": false,
        "keep-ipynb": false,
        "ipynb": null,
        "enabled": null,
        "daemon": null,
        "daemon-restart": false,
        "debug": false,
        "ipynb-filters": [],
        "ipynb-shell-interactivity": null,
        "plotly-connected": true,
        "engine": "jupyter"
      },
      "render": {
        "keep-tex": false,
        "keep-typ": false,
        "keep-source": false,
        "keep-hidden": false,
        "prefer-html": false,
        "output-divs": true,
        "output-ext": "html",
        "fig-align": "default",
        "fig-pos": null,
        "fig-env": null,
        "code-fold": "none",
        "code-overflow": "scroll",
        "code-link": false,
        "code-line-numbers": false,
        "code-tools": false,
        "tbl-colwidths": "auto",
        "merge-includes": true,
        "inline-includes": false,
        "preserve-yaml": false,
        "latex-auto-mk": true,
        "latex-auto-install": true,
        "latex-clean": true,
        "latex-min-runs": 1,
        "latex-max-runs": 10,
        "latex-makeindex": "makeindex",
        "latex-makeindex-opts": [],
        "latex-tlmgr-opts": [],
        "latex-input-paths": [],
        "latex-output-dir": null,
        "link-external-icon": false,
        "link-external-newwindow": false,
        "self-contained-math": false,
        "format-resources": [],
        "notebook-links": true
      },
      "pandoc": {
        "standalone": true,
        "wrap": "none",
        "default-image-extension": "png",
        "to": "html",
        "css": [
          "styles.css"
        ],
        "toc": true,
        "output-file": "index.html"
      },
      "language": {
        "toc-title-document": "Table of contents",
        "toc-title-website": "On this page",
        "related-formats-title": "Other Formats",
        "related-notebooks-title": "Notebooks",
        "source-notebooks-prefix": "Source",
        "other-links-title": "Other Links",
        "code-links-title": "Code Links",
        "launch-dev-container-title": "Launch Dev Container",
        "launch-binder-title": "Launch Binder",
        "article-notebook-label": "Article Notebook",
        "notebook-preview-download": "Download Notebook",
        "notebook-preview-download-src": "Download Source",
        "notebook-preview-back": "Back to Article",
        "manuscript-meca-bundle": "MECA Bundle",
        "section-title-abstract": "Abstract",
        "section-title-appendices": "Appendices",
        "section-title-footnotes": "Footnotes",
        "section-title-references": "References",
        "section-title-reuse": "Reuse",
        "section-title-copyright": "Copyright",
        "section-title-citation": "Citation",
        "appendix-attribution-cite-as": "For attribution, please cite this work as:",
        "appendix-attribution-bibtex": "BibTeX citation:",
        "appendix-view-license": "View License",
        "title-block-author-single": "Author",
        "title-block-author-plural": "Authors",
        "title-block-affiliation-single": "Affiliation",
        "title-block-affiliation-plural": "Affiliations",
        "title-block-published": "Published",
        "title-block-modified": "Modified",
        "title-block-keywords": "Keywords",
        "callout-tip-title": "Tip",
        "callout-note-title": "Note",
        "callout-warning-title": "Warning",
        "callout-important-title": "Important",
        "callout-caution-title": "Caution",
        "code-summary": "Code",
        "code-tools-menu-caption": "Code",
        "code-tools-show-all-code": "Show All Code",
        "code-tools-hide-all-code": "Hide All Code",
        "code-tools-view-source": "View Source",
        "code-tools-source-code": "Source Code",
        "tools-share": "Share",
        "tools-download": "Download",
        "code-line": "Line",
        "code-lines": "Lines",
        "copy-button-tooltip": "Copy to Clipboard",
        "copy-button-tooltip-success": "Copied!",
        "repo-action-links-edit": "Edit this page",
        "repo-action-links-source": "View source",
        "repo-action-links-issue": "Report an issue",
        "back-to-top": "Back to top",
        "search-no-results-text": "No results",
        "search-matching-documents-text": "matching documents",
        "search-copy-link-title": "Copy link to search",
        "search-hide-matches-text": "Hide additional matches",
        "search-more-match-text": "more match in this document",
        "search-more-matches-text": "more matches in this document",
        "search-clear-button-title": "Clear",
        "search-text-placeholder": "",
        "search-detached-cancel-button-title": "Cancel",
        "search-submit-button-title": "Submit",
        "search-label": "Search",
        "toggle-section": "Toggle section",
        "toggle-sidebar": "Toggle sidebar navigation",
        "toggle-dark-mode": "Toggle dark mode",
        "toggle-reader-mode": "Toggle reader mode",
        "toggle-navigation": "Toggle navigation",
        "crossref-fig-title": "Figure",
        "crossref-tbl-title": "Table",
        "crossref-lst-title": "Listing",
        "crossref-thm-title": "Theorem",
        "crossref-lem-title": "Lemma",
        "crossref-cor-title": "Corollary",
        "crossref-prp-title": "Proposition",
        "crossref-cnj-title": "Conjecture",
        "crossref-def-title": "Definition",
        "crossref-exm-title": "Example",
        "crossref-exr-title": "Exercise",
        "crossref-ch-prefix": "Chapter",
        "crossref-apx-prefix": "Appendix",
        "crossref-sec-prefix": "Section",
        "crossref-eq-prefix": "Equation",
        "crossref-lof-title": "List of Figures",
        "crossref-lot-title": "List of Tables",
        "crossref-lol-title": "List of Listings",
        "environment-proof-title": "Proof",
        "environment-remark-title": "Remark",
        "environment-solution-title": "Solution",
        "listing-page-order-by": "Order By",
        "listing-page-order-by-default": "Default",
        "listing-page-order-by-date-asc": "Oldest",
        "listing-page-order-by-date-desc": "Newest",
        "listing-page-order-by-number-desc": "High to Low",
        "listing-page-order-by-number-asc": "Low to High",
        "listing-page-field-date": "Date",
        "listing-page-field-title": "Title",
        "listing-page-field-description": "Description",
        "listing-page-field-author": "Author",
        "listing-page-field-filename": "File Name",
        "listing-page-field-filemodified": "Modified",
        "listing-page-field-subtitle": "Subtitle",
        "listing-page-field-readingtime": "Reading Time",
        "listing-page-field-wordcount": "Word Count",
        "listing-page-field-categories": "Categories",
        "listing-page-minutes-compact": "{0} min",
        "listing-page-category-all": "All",
        "listing-page-no-matches": "No matching items",
        "listing-page-words": "{0} words",
        "listing-page-filter": "Filter",
        "draft": "Draft"
      },
      "metadata": {
        "lang": "en",
        "fig-responsive": true,
        "quarto-version": "99.9.9",
        "theme": "cosmo",
        "title": "Issue-9253"
      },
      "extensions": {
        "book": {
          "multiFile": true
        }
      }
    }
  },
  "resources": [
    "styles.css"
  ],
  "fileInformation": {
    "docs/websites/issue-9253/index.qmd": {
      "includeMap": [
        {
          "source": "docs/websites/issue-9253/index.qmd",
          "target": "_include.qmd"
        },
        {
          "source": "_include.qmd",
          "target": "_include2.qmd"
        },
        {
          "source": "docs/websites/issue-9253/index.qmd",
          "target": "_include.qmd"
        },
        {
          "source": "_include.qmd",
          "target": "_include2.qmd"
        }
      ],
      "codeCells": [
        {
          "start": 2,
          "end": 4,
          "file": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_include2.qmd",
          "source": "print(\"hello, world\")\n",
          "language": "python",
          "metadata": {}
        },
        {
          "start": 2,
          "end": 4,
          "file": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_include2.qmd",
          "source": "print(\"hello, world\")\n",
          "language": "python",
          "metadata": {}
        }
      ],
      "metadata": {
        "title": "Issue-9253"
      }
    }
  },
  "project": {
    "quarto": {
      "version": "99.9.9"
    },
    "dir": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253",
    "engines": [
      "markdown",
      "jupyter"
    ],
    "config": {
      "project": {
        "type": "website",
        "lib-dir": "site_libs",
        "output-dir": "_site"
      },
      "website": {
        "title": "Issue-9253",
        "navbar": {
          "left": [
            {
              "href": "index.qmd",
              "text": "Home"
            },
            "about.qmd"
          ]
        }
      },
      "format": {
        "html": {
          "theme": "cosmo",
          "css": "styles.css",
          "toc": true
        }
      },
      "language": {}
    },
    "files": {
      "input": [
        "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\about.qmd",
        "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd"
      ],
      "resources": [],
      "config": [
        "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_quarto.yml"
      ],
      "configResources": [
        "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\styles.css"
      ]
    },
    "fileInformation": {
      "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\about.qmd": {
        "includeMap": [],
        "codeCells": [],
        "metadata": {
          "title": "About"
        }
      },
      "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
        "includeMap": [
          {
            "source": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd",
            "target": "_include.qmd"
          },
          {
            "source": "_include.qmd",
            "target": "_include2.qmd"
          },
          {
            "source": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd",
            "target": "_include.qmd"
          },
          {
            "source": "_include.qmd",
            "target": "_include2.qmd"
          }
        ],
        "codeCells": [
          {
            "start": 2,
            "end": 4,
            "file": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_include2.qmd",
            "source": "print(\"hello, world\")\n",
            "language": "python",
            "metadata": {}
          },
          {
            "start": 2,
            "end": 4,
            "file": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_include2.qmd",
            "source": "print(\"hello, world\")\n",
            "language": "python",
            "metadata": {}
          }
        ],
        "metadata": {
          "title": "Issue-9253"
        }
      }
    },
    "extensions": []
  }
}

New one with this PR index.json

Now

{
  "quarto": {
    "version": "99.9.9"
  },
  "engines": [
    "jupyter"
  ],
  "formats": {
    "html": {
      "identifier": {
        "display-name": "HTML",
        "target-format": "html",
        "base-format": "html"
      },
      "execute": {
        "fig-width": 7,
        "fig-height": 5,
        "fig-format": "retina",
        "fig-dpi": 96,
        "df-print": "default",
        "error": false,
        "eval": true,
        "cache": null,
        "freeze": false,
        "echo": true,
        "output": true,
        "warning": true,
        "include": true,
        "keep-md": false,
        "keep-ipynb": false,
        "ipynb": null,
        "enabled": null,
        "daemon": null,
        "daemon-restart": false,
        "debug": false,
        "ipynb-filters": [],
        "ipynb-shell-interactivity": null,
        "plotly-connected": true,
        "engine": "jupyter"
      },
      "render": {
        "keep-tex": false,
        "keep-typ": false,
        "keep-source": false,
        "keep-hidden": false,
        "prefer-html": false,
        "output-divs": true,
        "output-ext": "html",
        "fig-align": "default",
        "fig-pos": null,
        "fig-env": null,
        "code-fold": "none",
        "code-overflow": "scroll",
        "code-link": false,
        "code-line-numbers": false,
        "code-tools": false,
        "tbl-colwidths": "auto",
        "merge-includes": true,
        "inline-includes": false,
        "preserve-yaml": false,
        "latex-auto-mk": true,
        "latex-auto-install": true,
        "latex-clean": true,
        "latex-min-runs": 1,
        "latex-max-runs": 10,
        "latex-makeindex": "makeindex",
        "latex-makeindex-opts": [],
        "latex-tlmgr-opts": [],
        "latex-input-paths": [],
        "latex-output-dir": null,
        "link-external-icon": false,
        "link-external-newwindow": false,
        "self-contained-math": false,
        "format-resources": [],
        "notebook-links": true
      },
      "pandoc": {
        "standalone": true,
        "wrap": "none",
        "default-image-extension": "png",
        "to": "html",
        "css": [
          "styles.css"
        ],
        "toc": true,
        "output-file": "index.html"
      },
      "language": {
        "toc-title-document": "Table of contents",
        "toc-title-website": "On this page",
        "related-formats-title": "Other Formats",
        "related-notebooks-title": "Notebooks",
        "source-notebooks-prefix": "Source",
        "other-links-title": "Other Links",
        "code-links-title": "Code Links",
        "launch-dev-container-title": "Launch Dev Container",
        "launch-binder-title": "Launch Binder",
        "article-notebook-label": "Article Notebook",
        "notebook-preview-download": "Download Notebook",
        "notebook-preview-download-src": "Download Source",
        "notebook-preview-back": "Back to Article",
        "manuscript-meca-bundle": "MECA Bundle",
        "section-title-abstract": "Abstract",
        "section-title-appendices": "Appendices",
        "section-title-footnotes": "Footnotes",
        "section-title-references": "References",
        "section-title-reuse": "Reuse",
        "section-title-copyright": "Copyright",
        "section-title-citation": "Citation",
        "appendix-attribution-cite-as": "For attribution, please cite this work as:",
        "appendix-attribution-bibtex": "BibTeX citation:",
        "appendix-view-license": "View License",
        "title-block-author-single": "Author",
        "title-block-author-plural": "Authors",
        "title-block-affiliation-single": "Affiliation",
        "title-block-affiliation-plural": "Affiliations",
        "title-block-published": "Published",
        "title-block-modified": "Modified",
        "title-block-keywords": "Keywords",
        "callout-tip-title": "Tip",
        "callout-note-title": "Note",
        "callout-warning-title": "Warning",
        "callout-important-title": "Important",
        "callout-caution-title": "Caution",
        "code-summary": "Code",
        "code-tools-menu-caption": "Code",
        "code-tools-show-all-code": "Show All Code",
        "code-tools-hide-all-code": "Hide All Code",
        "code-tools-view-source": "View Source",
        "code-tools-source-code": "Source Code",
        "tools-share": "Share",
        "tools-download": "Download",
        "code-line": "Line",
        "code-lines": "Lines",
        "copy-button-tooltip": "Copy to Clipboard",
        "copy-button-tooltip-success": "Copied!",
        "repo-action-links-edit": "Edit this page",
        "repo-action-links-source": "View source",
        "repo-action-links-issue": "Report an issue",
        "back-to-top": "Back to top",
        "search-no-results-text": "No results",
        "search-matching-documents-text": "matching documents",
        "search-copy-link-title": "Copy link to search",
        "search-hide-matches-text": "Hide additional matches",
        "search-more-match-text": "more match in this document",
        "search-more-matches-text": "more matches in this document",
        "search-clear-button-title": "Clear",
        "search-text-placeholder": "",
        "search-detached-cancel-button-title": "Cancel",
        "search-submit-button-title": "Submit",
        "search-label": "Search",
        "toggle-section": "Toggle section",
        "toggle-sidebar": "Toggle sidebar navigation",
        "toggle-dark-mode": "Toggle dark mode",
        "toggle-reader-mode": "Toggle reader mode",
        "toggle-navigation": "Toggle navigation",
        "crossref-fig-title": "Figure",
        "crossref-tbl-title": "Table",
        "crossref-lst-title": "Listing",
        "crossref-thm-title": "Theorem",
        "crossref-lem-title": "Lemma",
        "crossref-cor-title": "Corollary",
        "crossref-prp-title": "Proposition",
        "crossref-cnj-title": "Conjecture",
        "crossref-def-title": "Definition",
        "crossref-exm-title": "Example",
        "crossref-exr-title": "Exercise",
        "crossref-ch-prefix": "Chapter",
        "crossref-apx-prefix": "Appendix",
        "crossref-sec-prefix": "Section",
        "crossref-eq-prefix": "Equation",
        "crossref-lof-title": "List of Figures",
        "crossref-lot-title": "List of Tables",
        "crossref-lol-title": "List of Listings",
        "environment-proof-title": "Proof",
        "environment-remark-title": "Remark",
        "environment-solution-title": "Solution",
        "listing-page-order-by": "Order By",
        "listing-page-order-by-default": "Default",
        "listing-page-order-by-date-asc": "Oldest",
        "listing-page-order-by-date-desc": "Newest",
        "listing-page-order-by-number-desc": "High to Low",
        "listing-page-order-by-number-asc": "Low to High",
        "listing-page-field-date": "Date",
        "listing-page-field-title": "Title",
        "listing-page-field-description": "Description",
        "listing-page-field-author": "Author",
        "listing-page-field-filename": "File Name",
        "listing-page-field-filemodified": "Modified",
        "listing-page-field-subtitle": "Subtitle",
        "listing-page-field-readingtime": "Reading Time",
        "listing-page-field-wordcount": "Word Count",
        "listing-page-field-categories": "Categories",
        "listing-page-minutes-compact": "{0} min",
        "listing-page-category-all": "All",
        "listing-page-no-matches": "No matching items",
        "listing-page-words": "{0} words",
        "listing-page-filter": "Filter",
        "draft": "Draft"
      },
      "metadata": {
        "lang": "en",
        "fig-responsive": true,
        "quarto-version": "99.9.9",
        "theme": "cosmo",
        "title": "Issue-9253"
      },
      "extensions": {
        "book": {
          "multiFile": true
        }
      }
    }
  },
  "resources": [
    "styles.css"
  ],
  "fileInformation": {
    "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
      "includeMap": [
        {
          "source": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd",
          "target": "_include.qmd"
        },
        {
          "source": "_include.qmd",
          "target": "_include2.qmd"
        },
        {
          "source": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd",
          "target": "_include.qmd"
        },
        {
          "source": "_include.qmd",
          "target": "_include2.qmd"
        }
      ],
      "codeCells": [
        {
          "start": 2,
          "end": 4,
          "file": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_include2.qmd",
          "source": "print(\"hello, world\")\n",
          "language": "python",
          "metadata": {}
        },
        {
          "start": 2,
          "end": 4,
          "file": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_include2.qmd",
          "source": "print(\"hello, world\")\n",
          "language": "python",
          "metadata": {}
        }
      ],
      "metadata": {
        "title": "Issue-9253"
      },
      "outputFiles": {
        "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
          "display-name": "HTML",
          "target-format": "html",
          "base-format": "html"
        }
      }
    }
  },
  "project": {
    "quarto": {
      "version": "99.9.9"
    },
    "dir": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253",
    "engines": [
      "markdown",
      "jupyter"
    ],
    "config": {
      "project": {
        "type": "website",
        "lib-dir": "site_libs",
        "output-dir": "_site"
      },
      "website": {
        "title": "Issue-9253",
        "navbar": {
          "left": [
            {
              "href": "index.qmd",
              "text": "Home"
            },
            "about.qmd"
          ]
        }
      },
      "format": {
        "html": {
          "theme": "cosmo",
          "css": "styles.css",
          "toc": true
        }
      },
      "language": {}
    },
    "files": {
      "input": [
        "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\about.qmd",
        "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd"
      ],
      "resources": [],
      "config": [
        "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_quarto.yml"
      ],
      "configResources": [
        "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\styles.css"
      ]
    },
    "fileInformation": {
      "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\about.qmd": {
        "includeMap": [],
        "codeCells": [],
        "metadata": {
          "title": "About"
        },
        "outputFiles": {
          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\about.html": {
            "display-name": "HTML",
            "target-format": "html",
            "base-format": "html"
          }
        }
      },
      "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
        "includeMap": [
          {
            "source": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd",
            "target": "_include.qmd"
          },
          {
            "source": "_include.qmd",
            "target": "_include2.qmd"
          },
          {
            "source": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd",
            "target": "_include.qmd"
          },
          {
            "source": "_include.qmd",
            "target": "_include2.qmd"
          }
        ],
        "codeCells": [
          {
            "start": 2,
            "end": 4,
            "file": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_include2.qmd",
            "source": "print(\"hello, world\")\n",
            "language": "python",
            "metadata": {}
          },
          {
            "start": 2,
            "end": 4,
            "file": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_include2.qmd",
            "source": "print(\"hello, world\")\n",
            "language": "python",
            "metadata": {}
          }
        ],
        "metadata": {
          "title": "Issue-9253"
        },
        "outputFiles": {
          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
            "display-name": "HTML",
            "target-format": "html",
            "base-format": "html"
          }
        }
      }
    },
    "extensions": []
  }
}

The diff shows that previously we add a mix of relative and absolute
Here are the changes where we see the outputFiles addition, but also the fileInformation key changes

❯ git diff tests\docs\websites\issue-9253\index.json
warning: in the working copy of 'tests/docs/websites/issue-9253/index.json', LF will be replaced by CRLF the next time Git touches it
diff --git a/tests/docs/websites/issue-9253/index.json b/tests/docs/websites/issue-9253/index.json
index 36c65306f..29a298fc0 100644
--- a/tests/docs/websites/issue-9253/index.json
+++ b/tests/docs/websites/issue-9253/index.json
@@ -216,10 +216,10 @@
     "styles.css"
   ],
   "fileInformation": {
-    "docs/websites/issue-9253/index.qmd": {
+    "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
       "includeMap": [
         {
-          "source": "docs/websites/issue-9253/index.qmd",
+          "source": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd",
           "target": "_include.qmd"
         },
         {
@@ -227,7 +227,7 @@
           "target": "_include2.qmd"
         },
         {
-          "source": "docs/websites/issue-9253/index.qmd",
+          "source": "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd",
           "target": "_include.qmd"
         },
         {
@@ -255,6 +255,13 @@
       ],
       "metadata": {
         "title": "Issue-9253"
+      },
+      "outputFiles": {
+        "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
+          "display-name": "HTML",
+          "target-format": "html",
+          "base-format": "html"
+        }
       }
     }
   },
@@ -313,6 +320,13 @@
         "codeCells": [],
         "metadata": {
           "title": "About"
+        },
+        "outputFiles": {
+          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\about.html": {
+            "display-name": "HTML",
+            "target-format": "html",
+            "base-format": "html"
+          }
         }
       },
       "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
@@ -354,6 +368,13 @@
         ],
         "metadata": {
           "title": "Issue-9253"
+        },
+        "outputFiles": {
+          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
+            "display-name": "HTML",
+            "target-format": "html",
+            "base-format": "html"
+          }
         }
       }
     },
(END)
+            "base-format": "html"
+          }
         }
       },
       "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
@@ -354,6 +368,13 @@
         ],
         "metadata": {
           "title": "Issue-9253"
+        },
+        "outputFiles": {
+          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
+            "display-name": "HTML",
+            "target-format": "html",
+            "base-format": "html"
+          }
         }
       }
     },
~
~
~
~
(END)
+            "base-format": "html"
+          }
         }
       },
       "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
@@ -354,6 +368,13 @@
         ],
         "metadata": {
           "title": "Issue-9253"
+        },
+        "outputFiles": {
+          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
+            "display-name": "HTML",
+            "target-format": "html",
+            "base-format": "html"
+          }
         }
       }
     },
~
~
~
~
~
~
~
(END)
+            "base-format": "html"
+          }
         }
       },
       "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
@@ -354,6 +368,13 @@
         ],
         "metadata": {
           "title": "Issue-9253"
+        },
+        "outputFiles": {
+          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
+            "display-name": "HTML",
+            "target-format": "html",
+            "base-format": "html"
+          }
         }
       }
     },
~
~
~
~
~
~
~
~
~
~
(END)
+            "base-format": "html"
+          }
         }
       },
       "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
@@ -354,6 +368,13 @@
         ],
         "metadata": {
           "title": "Issue-9253"
+        },
+        "outputFiles": {
+          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
+            "display-name": "HTML",
+            "target-format": "html",
+            "base-format": "html"
+          }
         }
       }
     },
~
~
~
~
~
~
~
~
~
~
~
(END)
+            "base-format": "html"
+          }
         }
       },
       "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
@@ -354,6 +368,13 @@
         ],
         "metadata": {
           "title": "Issue-9253"
+        },
+        "outputFiles": {
+          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
+            "display-name": "HTML",
+            "target-format": "html",
+            "base-format": "html"
+          }
         }
       }
     },
~
~
~
~
~
~
~
~
~
~
~
~
~
(END)
+            "base-format": "html"
+          }
         }
       },
       "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
@@ -354,6 +368,13 @@
         ],
         "metadata": {
           "title": "Issue-9253"
+        },
+        "outputFiles": {
+          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
+            "display-name": "HTML",
+            "target-format": "html",
+            "base-format": "html"
+          }
         }
       }
     },
~
~
~
~
~
~
~
~
~
~
~
~
~
~
(END)
+            "base-format": "html"
+          }
         }
       },
       "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
@@ -354,6 +368,13 @@
         ],
         "metadata": {
           "title": "Issue-9253"
+        },
+        "outputFiles": {
+          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
+            "display-name": "HTML",
+            "target-format": "html",
+            "base-format": "html"
+          }
         }
       }
     },
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
(END)
+            "base-format": "html"
+          }
         }
       },
       "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
@@ -354,6 +368,13 @@
         ],
         "metadata": {
           "title": "Issue-9253"
+        },
+        "outputFiles": {
+          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
+            "display-name": "HTML",
+            "target-format": "html",
+            "base-format": "html"
+          }
         }
       }
     },
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
(END)
+            "base-format": "html"
+          }
         }
       },
       "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
@@ -354,6 +368,13 @@
         ],
         "metadata": {
           "title": "Issue-9253"
+        },
+        "outputFiles": {
+          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
+            "display-name": "HTML",
+            "target-format": "html",
+            "base-format": "html"
+          }
         }
       }
     },
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
(END)
+            "base-format": "html"
+          }
         }
       },
       "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\index.qmd": {
@@ -354,6 +368,13 @@
         ],
         "metadata": {
           "title": "Issue-9253"
+        },
+        "outputFiles": {
+          "C:\\Users\\chris\\Documents\\DEV_R\\quarto-cli\\tests\\docs\\websites\\issue-9253\\_site\\index.html": {
+            "display-name": "HTML",
+            "target-format": "html",
+            "base-format": "html"
+          }
         }
       }
     },

@@ -213,9 +216,11 @@ const inspectDocumentConfig = async (path: string) => {
);
}

path = normalizePath(path);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the normalization that creates the absolute path. As it was added explicitly, I guess you are thinking we should use absolute path in inspect output ?

This will change the content and so the filtering to apply like in our test

const json = JSON.parse(Deno.readTextFileSync(output));
const info = json.fileInformation["docs/websites/issue-9253/index.qmd"];

I guess other tools are doing that too...

I really wonder if this is a good idea that an inspect output from Windows and from Linux / Mac will differ totally. It seems like other tools that will use it will need to handle this.

But this could be discussed because those tools will also run on the OS, and generating an absolute path should give the same result.

I guess using relative paths seems more generic. We could have a first field in inspect for the project path (project.dir today), and then only use a relative path to this project path. An absolute path could then be recreated by joining the two. IDK 🤷

Anyhow, breaking change to handle if we keep this normalization

  • Tests to adapt
  • External tools to warn (like Connect or target - the two I know of)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added that because I wanted the output of quarto inspect to be independent of the directory from which it is invoked, and equivalent between single-file calls and project-wide calls. If we're going to use the JSON information to make inferences about the files, it seems that it would be more useful to not have to know which directory the call came from.

Consider a project like this:

find . -type f | sort
./_quarto.yml
./about.qmd
./dir1/index.qmd
./dir2/index.qmd
./index.qmd
./styles.css

Now consider this:

$ cd dir1
$ quarto inspect index.qmd | jq .fileInformation
{
  "index.qmd": {
    "includeMap": [],
    "codeCells": [],
    "metadata": {}
  }
}
$ quarto inspect index.qmd | jq .project.fileInformation
{
  "/Users/cscheid/Desktop/daily-log/2025/06/13/test-dirs/dir2/index.qmd": {
    "includeMap": [],
    "codeCells": [],
    "metadata": {}
  },
  "/Users/cscheid/Desktop/daily-log/2025/06/13/test-dirs/index.qmd": {
    "includeMap": [],
    "codeCells": [],
    "metadata": {
      "title": "test-dirs"
    }
  },
  "/Users/cscheid/Desktop/daily-log/2025/06/13/test-dirs/about.qmd": {
    "includeMap": [],
    "codeCells": [],
    "metadata": {
      "title": "About"
    }
  },
  "/Users/cscheid/Desktop/daily-log/2025/06/13/test-dirs/dir1/index.qmd": {
    "includeMap": [],
    "codeCells": [],
    "metadata": {}
  }
}

Notice two things:

  1. We don't know which of the two dir1/index.qmd or dir2/index.qmd that first pipeline refers to.
  2. The project information is already built with absolute paths.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's another ugly related issue on main which we will need to fix:

$ cd quarto-cli/tests/docs/websites/issue-9253
$  quarto inspect | jq '.fileInformation["/Users/cscheid/repos/github/quarto-dev/quarto-cli/tests/docs/websites/issue-9253/index.qmd"].includeMap[].source'
"/Users/cscheid/repos/github/quarto-dev/quarto-cli/tests/docs/websites/issue-9253/index.qmd"
"_include.qmd"
"/Users/cscheid/repos/github/quarto-dev/quarto-cli/tests/docs/websites/issue-9253/index.qmd"
"_include.qmd"

@cderv
Copy link
Collaborator

cderv commented May 26, 2025

I had to fix that projectContext safeClone bug in this PR, for the same reason

I made this change in a separate PR to check that our tests pass, which is the case, so I merged.

cderv and others added 21 commits June 13, 2025 09:18
the function has been deprecated from IPython 7.14 and has been removed in IPython 9.0
This way the cell content is correctly detected and moved into the head
In this case, plotly.py will embed the full plotly.js library so we need to dectect this code cell and put it in the html head to not have a non figure div in the output
fixes #12797

this introduces two brand schemas, "single" and "unified"
brand.light and brand.dark can only take single
brand takes unified and then splits it
if there are no dark customizations then the unified brand has no dark mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inspect - show output-file path
8 participants