-
Notifications
You must be signed in to change notification settings - Fork 9
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
can this be used with org-mode src-code blocks #43
Comments
I don't think it would be that difficult. https://github.com/arnm/ob-mermaid/blob/master/ob-mermaid.el is an example of this working. We can put it on the feature map. |
Happy to help testing |
@uliw it actually might be already supported 😆 Can you check if this works for you and is sufficient for your use case? |
it mostly works! I get the following error:
even so
shows that the file is there (and calling it directly is working ok). Setting d2 location explicitly resolved the issue. Some practicalities:
|
The image size problem can be circumvented by setting this in the startup file
Which will apply the above value unless another value is set for given image |
Hey @uliw , thanks1 re: the
yea...hmm...maybe the "~" is not resolving correctly? Re: the width, yea...there are options we can add. I need to check the d2 apis to see if there is a way to do it via the cli. If so, we can add another arg, |
Hi! Here's a hack I use to control size of an image while exporting to LaTeX that might help you automate Put this somewhere at the beginning of the file: #+NAME: attr_wrap
#+BEGIN_SRC sh :var data="" :var width="\\textwidth" height="200" :results output :exports none
echo "#+ATTR_LATEX: :width $width :height $height"
echo "$data"
#+END_SRC Example of usage: #+BEGIN_SRC d2 :file complex.png :post attr_wrap(width=200, height=500, data=*this*) :results drawer
clouds: {
aws: {
load_balancer -> api
api -> db
}
gcloud: {
auth -> db
}
gcloud -> aws
}
#+END_SRC
#+RESULTS:
:results:
#+ATTR_LATEX: :width 200 :height 500
[[file:complex.png]]
:end: |
Would it be difficult to enable org-mode src-code block support similar to plantuml?
The text was updated successfully, but these errors were encountered: