Code Monkey home page Code Monkey logo

quarto-emacs's Introduction

An emacs mode for quarto

Quarto-mode is an emacs mode for editing quarto documents.

Installing

quarto-mode is available on MELPA. From emacs,

M-x package-refresh-contents
M-x package-install
  quarto-mode

Using quarto-mode

Add this to your .emacs or ~/.emacs.d/init.el file:

;; load the library
(require 'quarto-mode)

The quarto-mode package will associate a quarto polymode to .qmd files. That means that there isn't an actual quarto-mode mode. If you want to associate other files to the quarto polymode, you should use poly-quarto-mode, such as:

;; Note that the following is not necessary to run quarto-mode in .qmd files! It's merely illustrating
;; how to associate different extensions to the mode.
(add-to-list 'auto-mode-alist '("\\.Rmd\\'" . poly-quarto-mode))

;; Or, with use-package:
(use-package quarto-mode
  :mode (("\\.Rmd" . poly-quarto-mode))
  )

Dependencies

Quarto-mode requires the following packages to be installed:

  • (polymode "0.2.2")
  • (poly-markdown "0.2.2")
  • (markdown-mode "2.3")
  • (request "0.3.2")

quarto-mode + ESS

If you have ESS, quarto-mode will use it. Otherwise, it won't. Specifically, quarto-mode does not depend on ESS (or R), which means that if you want to use those features, you have to install ESS separately.

Features

  • M-x quarto-preview. Start a quarto preview server. If the current buffer has an associated file that exists in a quarto project, the command will preview the entire project. Otherwise, it will preview the specific file.
  • Integration with poly-markdown's compilation. The default poly-markdown configuration runs plain pandoc on the document; quarto-mode uses quarto render.

Differences in behavior between quarto-mode and markdown-mode

  • C-c C-c * behavior

    quarto-mode uses features specific to quarto that make it behave differently from what markdown-mode users might expect. By default, quarto-mode uses quarto preview, which works through a custom web server, and does not produce disk output upon preview. quarto preview is significantly faster than rerendering entire files in interactive mode, so we encourage you to use it.

    However, if you wish to not use quarto preview and instead depend on the typical rendering mode of previewing, you can restore the standard markdown-mode behavior by changing the quarto-force-preview customization variable.

quarto-emacs's People

Contributors

cscheid avatar jjallaire avatar maikol-solis avatar kwstat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.