quarto-dev / quarto-emacs Goto Github PK
View Code? Open in Web Editor NEWAn emacs mode for quarto: https://quarto.org
License: GNU General Public License v3.0
An emacs mode for quarto: https://quarto.org
License: GNU General Public License v3.0
I am using an iPadPro to access a remote-server running emacs. I am trying to to edit and develop quarto files. quarto-preview
attempts to launch a local server, which fails. Instead I would like to specify the remote-server so I can access it instead. I have tried modifyingquarto-preview-display-buffer
, but that fails. Is there another way to do this?
Thanks in advance for any suggestions or advice.
Hello, is there a feature to allow folding tripe backtick fenced blocks?
When writing a paper I can fold all the structure elements, but not the code blocks. Is that something that will be in quarto-mode or something we need to get from another package?
Running M-x quarto-preview
on a .qmd
file previews as expected, but does not refresh when the document is changed and saved. The expected behaviour can be seen when running quarto preview file.qmd
in a shell.
Hi!
If I understood correctly, these lines (https://github.com/quarto-dev/quarto-emacs/blob/main/quarto-mode.el#L54-L66) define a new polymode, inheriting all their properties and keybindings from poly-markdown+r-mode
. According to this, if I have ESS
and poly-R
installed all the keymaps should be inherited
However, running a test file, I can't make the keybind M-n
work, which is the access point for the other polymode functions
In the describe-mode
buffer I have this
Please let me know if you need to debug something from my side to find the issue.
Best.
PS: Just as a side note, why to use (eval '(define-polymode...
instead of directly (define-polymode...
?
Hi,
I think M-x refresh-package-contents
should be M-x package-refresh-contents
Cheers,
Mads
(Fantastic project!)
https://github.com/quarto-dev/quarto-emacs/blob/main/quarto-mode.el#L154
I think what you want here is the locate-dominating-file
function. I only had a short glance at the code, please disregard if I got it wrong.
I just wanted to try Quarto in Emacs, but when I run quarto-preview
I get the following error:
funcall-interactively: Symbol’s value as variable is void: project-directory
When I run quarto render
from shell on the same file, it works fine.
By the way, Quarto looks really, really promising. I'm looking forward to using it and hoping it will bring about some unification for the R vs Python and .ipynb
vs .md
communities :)
Hi!
I'm trying to use quarto-emacs with python blocks, but it's not working well.
For example, if I have this chunk
```{python}
import matplotlib.pyplot as plt
import numpy as np
```
and use the command poly-eval-region-or-chunk
, I get this error
error("Undefined `polymode-eval-region-function' in buffe..." #<buffer my_file.qmd[python]>)
polymode-eval-chunk(4113)
polymode-eval-region-or-chunk()
funcall-interactively(polymode-eval-region-or-chunk)
command-execute(polymode-eval-region-or-chunk)
I don't know if the problem is from polymode or quarto-emacs directly. I can help to debug this further if you like.
Best.
I am pretty new to emacs. I just walked through install of melpa and then installed as instructed in the README here. After install I get a lot of warnings. These warnings also show when opening a new .qmd
.
⛔ Warning (comp): quarto-mode.el:56:22: Warning: ‘make-variable-buffer-local’ not called at toplevel
⛔ Warning (comp): quarto-mode.el:62:20: Warning: ‘make-variable-buffer-local’ not called at toplevel
⛔ Warning (comp): quarto-mode.el:82:2: Warning: custom-declare-variable `quarto-poly-markdown-exporter' docstring wider than 80 characters
⛔ Warning (comp): quarto-mode.el:109:2: Warning: custom-declare-variable `quarto-force-preview' docstring wider than 80 characters
⛔ Warning (comp): quarto-mode.el:154:2: Warning: docstring wider than 80 characters
⛔ Warning (comp): quarto-mode.el:171:2: Warning: docstring wider than 80 characters
⛔ Warning (comp): quarto-mode.el:214:11: Warning: Unused lexical variable `browser-path'
⛔ Warning (comp): quarto-mode.el:236:9: Warning: reference to free variable ‘poly-quarto-mode-map’
⛔ Warning (comp): quarto-mode.el:245:11: Warning: Unused lexical variable `data'
⛔ Warning (comp): quarto-mode.el:245:25: Warning: Unused lexical variable `symbol-status'
⛔ Warning (comp): quarto-mode.el:245:39: Warning: Unused lexical variable `error-thrown'
⛔ Warning (comp): quarto-mode.el:252:2: Warning: docstring wider than 80 characters
⛔ Warning (comp): quarto-mode.el:255:13: Warning: Unused lexical variable `this-project-directory'
⛔ Warning (comp): quarto-mode.el:281:2: Warning: docstring wider than 80 characters
I can figure out how to hide these if they are not a major concern but also it looks like #17 is a draft fix for this, correct?
How can I help push that forward?
quatro-mode
doesn't currently appear to be available on MELPA.
I have a very interesting problem in qmd
files. After the cursor enters any R code (Python doesn't do that), either in a block or inline, the LSP process starts and enables all the IDE functionality when the cursor is in code. Code editing works great. However, something insane starts to happen outside the code, when I try to add any text: the cursor jumps around and renders the whole buffer unusable unless it finds itself within R code. The only way to get back to writing markdown is to kill and reopen the buffer, and by all means avoid accidentally touching code.
Here is the file that I am working with right now. It's a part of a project, so there is no header. I indented the code block to escape from the GitHub interpreter.
# Inventory data
I have access to two field inventory datasets with overlapping UAV ALS and multispectral measurements.
```{r}
#| label: setup
#| include: false
library(sf)
library(DBI)
library(tmap)
connection <- dbConnect(
drv = RPostgres::Postgres(),
host = "localhost",
dbname = "trees"
)
trees1 <- read_sf(connection, Id(schema = "stands", table = "trees1"))
trees2 <- read_sf(connection, Id(schema = "stands", table = "trees2"))
```
## First polygon
It has total `r nrow(trees1)` trees.
After the cursor has touched code, it seems to jump to the beginning of the last line of the document after every keystroke in insert mode. If it's already at the end, the text is being inverted like this !?gnineppah si kceh eht tahW
. When on the line with inline code, sometimes instead of jumping to the end of the buffer, it jumps to the end of the inline code, before the closing backtick. Typing the backtick does something that I don't even know how to describe, everything moves and the current line partly consumes the line above. Sometimes it randomly stops doing all that for the part of the file below the code block, but any action above it moves the cursor to the first line of the block.
I am very new to Emacs, and I don't even know where to start looking to debug and fix this. I use Doom Emacs, so there might be some configuration clash that I can't think of yet. I would appreciate any guidance greatly!
Is there any reason to use make-process
over start-process-shell-command
in the quarto-preview
defun? For some reason I am unable to get quarto-preview
to work for me as it does not recognise my Jupyter Kernel, however when I open shell
and run quarto preview
manually it works as expected. I suspect this is because make-process
is not reading some of my environment variables related to virtualenv correctly (the problem may be similar to #16).
I am able to get it work with start-process-shell-command
in my own config, but I wonder if it is something worth considering to implement in the package? Happy to submit a PR, but I just wanted to check this point before I attempt it as I'm not sure on the differences between the two process related commands.
When loading qmd
files I get the following error:
File mode specification error: (void-function poly-quarto-mode)
poly-quarto-mode
.Rmd
files work just fine and quarto mode also works just fine after I manually evaluate quarto-mode.el
.load-path
Hello and congratulations for your work
When I try to run quarto-preview
I get the error ModuleNotFoundError: No module named 'nbclient'
. But when I use the python mode, I can manage to do use the module without any problem.
Could you help me?
Regards
Hugo
I guess this package is not yet supporting windows? For example, when I load the package I find that the value of quarto-command
is nil
.
Are there any instructions for installing Quarto mode (and any required dependencies that are not part of stock Emacs) without relying on MELPA or other online services, which are not available in air-gapped environments?
Thanks!
Hi, I've just set up quarto-mode in my Doom Emacs config by including (package! quarto-mode)
and the other dependencies in my packages.el
, and then (use-package! quarto-mode)
in my config.el
, as I believe is usual for Doom packages.
It seems to have somewhat worked, as polymode seems to recognize different languages when I move my cursor into the YAML header, or into a code block (since the Major mode in the bottom corner changes accordingly), but I'm having a hard time actually getting anything done. When I do M-x quarto-preview
, I get a quarto preview buffer but nothing shows up:
It becomes difficult to troubleshoot because I'm not even sure how this is supposed to look. I tried running M-x quarto-menu
to see if I got any more options but that just gives me the message command-execute: quarto-menu must be bound to an event with parameters
.
My next problem is that, when I try and send code blocks to be evaluated using C-c C-c
, it works just fine with R/ESS, but with python code, the entire buffer gets sent to the Inferior Python process, where the document header immediately causes a syntax error.
Is there anything wrong with how I've set this up? Do I need to add any use-package!
lines for the dependencies in my config.el
? I'm new to Emacs so I really appreciate the help. Thank you!
I think this project is basically unmaintained but this is worth a shot.
I work on a cluster editing a .qmd
file via tramp (let's say C-x C-f /ssh:dev_node:testingr/explore_tracks.qmd
).
1.- If I try to do quarto-preview I get a blank buffer with nothing showing.
2.- Inspecting the variable quarto-command
I see that its value is nil. This is because emacs is looking for quarto in my local machine instead of dev_node
and I do not have installed it.
3.- If I install quarto in my local machine and try M-x quarto-preview
again, I get:
ERROR: /ssh:dev_node:/home/aramirezreyes/testingr/explore_tracks.qmd not found
Error: /ssh:dev_node:/home/aramirezreyes/testingr/explore_tracks.qmd not found
at Command.fn (file:///Applications/quarto/bin/quarto.js:103602:15)
at async Command.execute (file:///Applications/quarto/bin/quarto.js:8437:13)
at async quarto (file:///Applications/quarto/bin/quarto.js:127545:5)
at async file:///Applications/quarto/bin/quarto.js:127563:9
Process quarto-preview-/ssh:dev_node:/home/aramirezreyes/testingr/explore_tracks.qmd exited abnormally with code 1
This is because my local quarto cannot find the remote file.
How could I get this setup to work? Any pointers to implement it if it is currently not working?
As an additional data point. The quarto extension for vscode works just fine over ssh so I guess it could be done.
Thank you!
I installed this package via the interactive method
M-x package-install
quarto-mode
I restarted emacs, but when I type M-x
I can't find quarto-mode
as an available mode, even when I open a .qmd document.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.