Skip to content

Configure location of intermediate md files generated from qmd #9299

Open

Description

@nichtich

I want to manage quarto source files with .md extension to allow arbitrary Markdown tools to detect and process these files. In the end .qmd is Markdown but with additional elements. As discussed at #3715 (reply in thread)_ quarto

  • complains when fed with .md files containing computable elememts
  • transforms .qmd to .md containing results of evaluation

This is why you may have issue about already exist error if you have .md with same name as .qmd.

Can the transformed result be put in a custom (keep-md: true) or temporary (keep-md: false) directory to not clash with an existing .md file of same name?

Activity

  1. mcanouil commented on Apr 8, 2024

    @mcanouil
    Collaborator

    That's not the goal of keep-*. It's for debugging.
    If you want to output markdown, then set the format to a markdown based format such as gfm.
    From there, you have output-dir thant you can change.

  2. added
    support
    on Apr 8, 2024
  3. nichtich commented on Apr 8, 2024

    @nichtich
    Author

    I don't want markdown output but Markdown input files with file extension .md. By now quarto disallows this just because it would overwrite file foo.md when processing file foo.qmd. Configuration of location where foo.md is created would solve this problem.

  4. mcanouil commented on Apr 8, 2024

    @mcanouil
    Collaborator

    Sorry, but why do you want the intermediate markdown file for exactly?
    And why format: markdown is not what you want?

    The context might help.

    transforms .qmd to .md containing results of evaluation

    That's exactly the purpose of format: markdown.
    While keep-* purpose is not to output markdown.

  5. cscheid commented on Apr 8, 2024

    @cscheid
    Member

    @nichtich What version of Quarto are you using? We've kept the intermediate files in different extensions for a good long while now.

  6. nichtich commented on Apr 8, 2024

    @nichtich
    Author

    Thanks for asking back. I made sure to use latest quarto version and created a minimal example:

    file index.md:

    ```{dot}
    graph { a -- b; }
    ```

    file _quarto.yml:

    project:
      type: manuscript
      output-dir: docs
    manuscript:
      article: index.md

    quarto render quits with ERROR: You must use the .qmd extension for documents with executable code..

    Tried workaround with additional file index.qmd, keeping index.md to work with Markdown software unaware of .qmd extension:

    ln -s index.md index.qmd

    change _quarto.yml to:

    project:
      type: manuscript
      output-dir: docs
      render:
        - "!*.md"
    manuscript:
      article: index.md   

    Now quarto render does conversion but quits with

    ERROR: AlreadyExists: File exists (os error 17): symlink 'index.md' -> '/home/user/docs/index.qmd'

    I want quarto not to generate index.md in the current directory but in /tmp or another location to not try to override existing index.md.

  7. mcanouil commented on Apr 8, 2024

    @mcanouil
    Collaborator

    I am still missing some pieces to get the whole picture. Why ln -s index.md index.qmd and not mv index.md index.qmd (or rename)? Why do you have markdown that uses ```{language} syntax while in Markdown the correct syntax is ```language?

  8. cscheid commented on Apr 8, 2024

    @cscheid
    Member

    Why do you have markdown that uses ```{language} syntax while in Markdown the correct syntax is ```language?

    I can answer this one: dot cells are resolved independently of the engine, and so can exist in Markdown documents.

    manuscript:
      article: index.md   

    I think this is the cause of your problem. You want both your input and output to be the same file? That's not going to work in general.

  9. nichtich commented on Apr 8, 2024

    @nichtich
    Author

    You want both your input and output to be the same file? That's not going to work in general.

    I want index.md processed with executable code (e.g. dot) output to index.html in output-dir. Quarto internally creates another intermediate index.md which I did not ask for. This intermediate file seems to be the reason why I am forced to use .qmd as source extension instead of .md (therefore the symlink to make the file available as index.qmd as well). If quarto allowed to configure the location of intermediate file (with temp directory as default), there was no need to overwrite the existing index.md.

  10. added
    enhancement
    and removed
    support
    on Apr 8, 2024
  11. added this to the Future milestone on Apr 8, 2024
  12. cscheid commented on Apr 8, 2024

    @cscheid
    Member

    If quarto allowed to configure the location of intermediate file (with temp directory as default), there was no need to overwrite the existing index.md.

    This is much, much easier said than done. A number of tools we do not fully control operate on the file system and assume particular things about the path. I understand your request, but that's not going to happen in the near or medium-term future.

  13. nichtich commented on Apr 11, 2024

    @nichtich
    Author

    Thanks for feedback. I understand that requirement to use .qmd as file extension is based in technical internal details not easy to change.

  14. added
    files
    on Jul 14, 2025
  15. Enopheron commented on Dec 4, 2025

    @Enopheron

    I’ve encountered this problem and can add some details.

    I have many .qmd notes that belong to my knowledge base, and I use Quarto to build them into a website.

    The issue is that I haven’t found a quarto language server #239, so I’m forced to use the markdown language server. If I enable it for .qmd file format, I lose the «jump to heading» function and «backlinks» i my editor.

    Because of this, my files (and there are more than 200 of them) need to be in .md format, but the code blocks inside these .md files don’t execute, and Quarto requires the .qmd format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfiles

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions