RKWard ignoring some configuration (working directory)

meik michalke meik.michalke at uni-duesseldorf.de
Sat May 14 18:40:28 BST 2022


Am Dienstag, 12. April 2022, 14:30:59 CEST schrieb Thomas Friedrichsmeier:
> > btw, was RKWard 0.7.2 associated with Rmd files, or did i manually
> > configure this? that has stopped working as well, association with R
> > files is still present.
> 
> I believe it never was. Is there even an official mimetype for Rmd?
> That would be needed in order to make the association in our
> .desktop-file.

after freshly installing kubuntu 22.04, i can confirm that i must have 
manually configured this ;)

there is a mimetype for text/markdown (*.markdown, *.md, *.mkd). registereing 
RKWard with text/markdown should be no problem, but adding *.rmd etc. to the 
list of file extensions isn't supported, and probably a bad idea to begin 
with.

i've found an (inofficial) mimetype for "github flavoured markdown", txt/x-
gfm, which includes *.rmd:

  https://www.digipres.org/formats/sources/githublinguist/formats/#313

we could just add that mimetype definition ourselves, e.g. name it 
application/vnd.kde.rmarkdown and include *.rmarkdown and *.rmd -- i 
understand it's ok for an extension to be used in multiple mimetypes, so this 
shouldn't break if another type definition for *.rmd was added.

the following worked well on my system:

1. create a new file
   ~/.local/share/mime/packages/application-vnd.kde.rmarkdown.xml
   containing this:

  <?xml version="1.0" encoding="utf-8"?>
  <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
      <mime-type type="application/vnd.kde.rmarkdown">
          <comment>RMarkdown document</comment>
          <comment xml:lang="de">RMarkdown-Dokument</comment>
          <sub-class-of type="text/markdown"/>
          <generic-icon name="text-markdown"/>
          <glob pattern="*.rmd"/>
          <glob pattern="*.rmkd"/>
          <glob pattern="*.rmarkdown"/>
      </mime-type>
  </mime-info>

2. run
 
   update-mime-database ~/.local/share/mime

you can now register RKWard with either text/markdown or
application/vnd.kde.rmarkdown (since i've defined the latter as a sub-class, 
applications for text/markdown will automatically also open RMarkdown files).


viele grüße :: m.eik

-- 
  dipl. psych. meik michalke
  institut f"ur experimentelle psychologie
  abt. f"ur diagnostik und differentielle psychologie
  heinrich-heine-universit"at d-40204 d"usseldorf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20220514/72bb48fb/attachment.sig>


More information about the rkward-devel mailing list