Git Product home page Git Product logo

org-krita's Introduction

org-krita

https://img.shields.io/github/v/tag/lepisma/org-krita.svg

Minor mode for working with krita notes, sketches etc. in org mode.

./screen.gif

Quickstart

The package is not on melpa yet. For installing, I would recommend downloading the release tarballs from here. Or if you are using quelpa-use-package, you can do the following:

(use-package org-krita
  :ensure t
  :quelpa (org-krita :fetcher github :repo "lepisma/org-krita" :files ("*.el" "resources"))
  :config
  (add-hook 'org-mode-hook 'org-krita-mode))

Or, if you are using Doom emacs you can add this to your packages.el:

(package! org-krita
  :recipe (:host github
           :repo "lepisma/org-krita"
           :files ("resources" "resources" "*.el" "*.el")))

and this to your config.el:

(use-package! org-krita
  :config
  (add-hook 'org-mode-hook 'org-krita-mode))

org-krita creates a new org link type called krita that:

  • when clicked on, opens krita for editing the file linked, and
  • shows the updated image preview inline if org-krita-mode is enabled.

For using, you need to enable the minor mode org-krita-mode in org buffer with krita links like this [[krita:./some-file.kra][image]]. To create new files within the buffer itself, try calling org-krita-insert-new-image.

Roadmap

Here are the directions that need work (as far as I can think of right now):

  1. Making the package tool agnostic. This basically means abstracting out the following pieces that are tuned to krita at the moment:
    1. Function for creating new image in the tool’s format.
    2. Function for extracting png from the file for inline display.
    3. Function for running the program to edit an image.
  2. Better inline display. Right now we bypass org’s inline display which means we miss out on basic things like setting width and height for larger images and other goodies.

org-krita's People

Contributors

accacio avatar coltoneakins avatar firmart avatar lepisma avatar nickdaly avatar stardiviner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

org-krita's Issues

Obsolete function & Dependency

You may want to add org in Package-Requires list.
Note that org-add-link-type is deprecated for org-mode 9.0.

This function is obsolete since Org 9.0;
use `org-link-set-parameters' instead.

Configuration instruction: Quelpa

Until this package goes to Melpa, it would be nice to have a configuration snippet in the README to install automatically org-krita. quelpa-use-package can do it as follows:

  (use-package org-krita
    :ensure t
    :quelpa (org-krita :fetcher github :repo "lepisma/org-krita" :files ("*.el" "resources"))
    :config
    (add-hook 'org-mode-hook 'org-krita-mode))  

New canvas file extension cannot be other than .kra

(let ((kra-path (expand-file-name (f-swap-ext png-path "kra"))))

The line above is doubtful. This is why:

  1. org-krita-insert-new-image ask for a filepath (without specifying any constraints). Suppose the user fed it /path/to/myimage, then resources/template.kra is copied to /path/to/myimage.
  2. The line 100 try to compute the .kra path by substituting the extension to .kra (or appending .kra if there is no extension). Consequently, (expand-file-name (f-swap-ext "/path/to/myimage.kra" "kra")) evals to "/path/to/myimage.kra". Then, krita try to open "/path/to/myimage.kra" which doesn't exist.

Conclusion:

  • If the filepath fed doesn't have an extension or have another than .kra, then it's not possible to edit the canvas.

I'm not sure why the extension should be added/substituted (maybe for windows ?), but at least the file should be renamed accordingly & this behaviour should be documented somewhere (e.g. prompted).

Configuration?

Hi @lepisma ,

Nice macro. Yet could not figure out configuration info. Appreciate if you post.

Cheers, and stay safe,
/z

Fix org-krita-insert-new-image

Hey, thanks for the neat tool! I couldn't get the 'org-krita-insert-new-image' to work interactively. I have reworked the function to remove the arguments, which fixes the issue.

@@ -182,16 +182,16 @@ If FULL-MODE is not null, run full krita."
       path)))
 
 ;;;###autoload
-(defun org-krita-insert-new-image (output-kra-path desc)
+(defun org-krita-insert-new-image ()
   "Insert new image in current buffer."
-  (interactive
-   (let ((output-kra-path (funcall org-krita-get-new-filepath))
-         (desc (funcall org-krita-get-new-desc)))
-     (list (org-krita-validate-path output-kra-path) desc)))
-  (org-krita-make-new-image output-kra-path)
-  (org-insert-link nil (concat "krita:" output-kra-path) desc)
-  ;; TODO: Enable only the new image
-  (org-krita-enable))
+  (interactive)
+  (let ((output-kra-path (funcall org-krita-get-new-filepath))
+        (desc (funcall org-krita-get-new-desc)))
+    (list (org-krita-validate-path output-kra-path) desc)
+    (org-krita-make-new-image output-kra-path)
+    (org-insert-link nil (concat "krita:" output-kra-path) desc)
+    ;; TODO: Enable only the new image
+    (org-krita-enable)))

[Feature request] Integrate org-yt feature (online image preview/editing)

From this answer of emacs.SE, we can display online image in an Org buffer (actually only .png, still requires some investigation for others). It would be interesting to integrate the feature of org-yt (which is not a complete package as its purpose was answering an emacs.SE question). Some features I can imagine are the following:

  • Consider the link [[krita:<https-link>]]
    • Display the online image whose the url is <https-link>.
    • Edit it with C-c C-o (as it was an offline .kra), save the edited image to a .kra and overwrite the old link (prompt if necessary).
    • Export to pdf & html with possibly mixed online and edited images.

An interesting workflow would be, for instance, using org-protocol-capture-html to capture a web page as an Org buffer, then be able to edit the online images captured.

org-xournalpp

Hi, I just wanted to let you know, that i ported org-krita for xournalpp.

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.