-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
org-indent-initialize-agent error when importing rmarkdown document #8
Comments
Off the bat, I have no idea, and I can't say I hope to reproduce this. Is this occuring with a particular file? |
@xxmissingnoxx you're going to have to give me something to work with :P |
I apologize for going dark there. I've been trying to create a minimal example which triggers the behavior. I've seen this behavior on 3 out of 3 files which are actual analyses so far. I tend to use the same format for my r notebook analyses that may not be too surprising if it has something to do with the content of the file. I created a small example: Testing
This yields:
=n{r head} head(mtcars)= This does not trigger the error but similar behavior seems to appear in the more complicated files. The appearance of the letter "n" happens regularly. You should probably look at this post in the raw form as Github is rendering the rmd content. This is how it looks in the editor: I used the command "org-pandoc-import-rmarkdown-as-org". |
Thanks 😃. By the way, what version of Org are you running? |
I realized I could try this without the named code blocks. I got different results. Assuming the code blocks have no name, should babel code blocks be the expected result or the example blocks generated below? I'm not sure if this is another clue or intended. It looks like Org 9.5 when I use the org-version command. I'm still getting acclimated to Emacs and Org stuff. |
I've been tinkering with this off and on. It looks as though there are multiple factors in play. The problem lies with your rmarkdown.lua filter. This problem occurs without any org or emacs in the mix. You can see this if you try to call pandoc on the command line with the filter. Rmarkdown is not compliant with any form of markdown supported by pandoc and thus is not appropriately handled by the AST and the lua filter. Rmarkdown is not a form of markdown that pandoc understands... but pandoc markdown is. I think you can use an approximation of your existing code if you take a different approach.
library(rmarkdown)
render("test.rmd",md_document(variant="markdown")) to convert the rmarkdown to the pandoc flavor of markdown which is equipped to handle both backticks and fenced code attributes and classes as mentioned here, I have a basic version of this working. The current problem with this approach is that the current settings mean losing chunk option information (ex. eval=FALSE). I suspect there's a way to get rmarkdown to dump that in the pandoc markdown too but experimentation, or perhaps posting an issue in their repo may be the next step. |
Thanks for following up @xxmissingnoxx. I'm using the following test document, I hope like yours. I'm thinking perhaps it has something to do with the pre-processor? Do you have |
I have sed available. I'm on a Mac so apparently you can't get the version number, but it works well enough to yell at me about it:
Pandoc version:
Command line call: pandoc --lua-filter=./org-pandoc-import/filters/rmarkdown.lua -f markdown -t org -o rmd.org test.md Test file contents:
org-pandoc-import-rmarkdown-as-org output:
Command line call output:
|
Thanks for the quick response. I get:
Screenshots below if that helps. |
Interesting. I'm guessing this is a platform-specific difference. Let's see if I can't resolve this over the next few days 🙂 |
That's what I'd guess too. I feel like you shouldn't need to jump through the regex hoops to do this and there should be a way to do this with the rmarkdown package itself. I asked a question that probably won't be answered on SO to see if there's a nicer way to dump rmarkdown attributes. If that works, then it should be easier to simplify your code, at the cost of the R dependency, and maybe build on it (ex. use chunk label as named code block in org or preserve attributes if you want to export back out to rmarkdown). Aside: What are you using to conceal the |
I'll return to On your aside, I use doom and it's a result of a |
Thank you for sharing this project with the Emacs community.
I stumbled across an error "Error running timer 'org-indent-initialize-agent'" while importing an rmarkdown file into the org-mode format. A screenshot is attached below. Is this something you've encountered before? I'm currently using Doom emacs.
The text was updated successfully, but these errors were encountered: