olivierkes / manuskript

A open-source tool for writers
http://www.theologeek.ch/manuskript
GNU General Public License v3.0
1.75k stars 230 forks source link

Support Rmarkdown #554

Open bepolymathe opened 5 years ago

bepolymathe commented 5 years ago

Hello,

Thank you for this great project. Whether it is for fiction or scientific writing, we need it. On the other hand, for scientific articles it would be useful to have some improvements. Many researchers, who have statistics to do (among other things) use Rmarkdown (.rmd) which are actually markdown files with R code in them. These are basic text files. It would be very useful to be able to import/export them in Manuskript.

I will also contribute to the translation.

worstje commented 5 years ago

What is it that is lacking right now? Can't you just copy-paste it in? After all, Markdown is little more than flat text with a teensy bit of intuitive structure.

I use a Markdown flavor with certain Pandoc extensions in the editor and that works just fine. (Then again, I don't use the builtin exporter because it does not match my specific needs...)

Regarding the exporting / compiling... I feel like shortcomings in output flexibility is a somewhat recurring theme I keep bumping into when reading the issues. On one hand, it is probably not too hard to add, but on the other hand, there's almost as many different output formats as there are people writing them, which would make supporting those formats rather troublesome in the long run.

As such, I wonder if a more structural solution that gives users more power to achieve their own kind of end result may be necessary on that front.

bepolymathe commented 5 years ago

Hello,

Thank you for your feedback. Yes of course, we can copy/paste but if we could import a "project" folder in which I have several .rmd would be even more convenient ;-).

That said, the real need to match my needs would be to have a configurable keyboard shortcut that allows me to send an order at the terminal for compilation in Rmardown.

I also need to put a lot of information in a YAML part at the beginning of the file for the configuration options...

worstje commented 5 years ago

Manuskript has an import tool. What's lacking about it that you can't use that?

Regarding exporting.. you are definitely stepping beyond what the exporting function can do right now. I myself have some YAML at the top of my texts, and the only way I could achieve the output I wanted was by writing a manual script.

I think that right now the feature meets the needs of a lot of common scenarios, but lacks the tweakability that it seems you and I desire from an exporting or compilation feature. Ideally, someone who is really motivated and knowledgeable takes on a task like this to tackle it really hard.

(I'm not saying others need to do this or put it high on their TODO list. I am only saying that I myself am very much lacking in knowledge, skill and even time, so I can't do it. But I do know that tackling the kind of combined simplicity & flexibility I would love to see is not a simple thing at all.)

In my case I wrote a powershell script that processes all the texts in my projects in the manner I want it to while using pandoc, and it produces output in several different formats while relying on the YAML blobs I have at the top of my output... with a shortcut of that script placed on my desktop within easy reach. It wasn't trivial, but it lets me create exactly the kind of outputs (3 different formats) I desire to have without worrying that I accidentally change some setting in the Manuskript compile window. (Compilation profiles would be a huge thing IMHO... but I digress..)

Saying 'script your own solution' is not what I want to write, obviously. But it is what worked for my specific scenario, and a way for you to accomplish today as opposed to waiting for an unknown date to where these features are improved. A manual publishing script is what I will continue to rely on until Manuskript can do the things I want it to do in that regard.

At its core, the format in which Manuskript stores your data is relatively simple, so pulling out what you need through scripts is not that difficult. Admittedly: I took several days to accomplish it, but that is just because I had no clue what I was doing, was teaching myself along the way and was quite finnicky about the eventual output.

If you want to wander down this particular path, I'd be happy to share what I've learned along the way to make your own journey a bit easier. Toss me an e-mail in that case; I don't think an issue like this is the right place to discuss such external scripts in depth.

bepolymathe commented 5 years ago

Yes of course we can find a certain amount of satisfaction with a well done script. Nevertheless, the question that is being asked is whether Manuskript aims to become a tool for scientific articles and books as well. If so, it will indeed be necessary to make the compilation options, the integration of YALM, etc. more complex...

But for now, if I could consider....

  1. To run it under Wayland
  2. To be able to edit my documents with an external editor (Vim, etc)

... it would be a big step.

bepolymathe commented 5 years ago

Hello,

Could you explain how you make possible YALM integration. In my case, i try to use at the begining of the first doc :

---
title: Real title
subtitle: 
author: Bepolymathe
date:  17 may 2019
tags: tag1 tag2
lang: fr
abstract: 
output: 
 pdf_document: 
  toc: true
---