Commit graph

94 commits

Author SHA1 Message Date
Nathaniel Nicandro
ea5ae74c1d
Don't rely on temporarily clearing :file header argument
Attempt at #16.
2019-02-20 13:34:10 -06:00
Nathaniel Nicandro
d4969cbfcc CHANGELOG.org: Add function to change version numbers 2019-02-14 23:05:00 -06:00
Nathaniel Nicandro
46fd8bec20
Generalize org-babel-jupyter-setup-export 2019-02-14 16:54:33 -06:00
Nathaniel Nicandro
3f5aa0039e
Add org-babel-jupyter-setup-export
This function is used to ensure that export variables are setup to handle
Jupyter src-blocks.
2019-02-12 11:49:17 -06:00
Nathaniel Nicandro
63717b9e39
Bump version 2019-02-12 09:17:06 -06:00
Nathaniel Nicandro
4978c28add
Revert jupy- prefix to jupyter- for org-mode src-blocks
Closes #5.
2019-02-12 09:17:06 -06:00
Nathaniel Nicandro
771e267034
Fix checkdoc errors 2019-02-06 22:49:41 -06:00
Nathaniel Nicandro
9bb0415255
Handle :file parameter in a cleaner way
Temporarily remove the :file parameter from the src-block parameters so that
`org-babel` does insert it as the result of the src-block.
2019-01-26 18:44:23 -06:00
Nathaniel Nicandro
ee1078d0c7
org-babel-jupyter-cleanup-file-links: Handle links with no directory 2019-01-26 16:17:15 -06:00
Nathaniel Nicandro
1054dc8857
Use when-let* 2019-01-22 12:14:32 -06:00
Nathaniel Nicandro
0e6192c86e
Refactor implementation of :dir option in Jupyter src-block's 2019-01-18 23:01:57 -06:00
Nathaniel Nicandro
c138d35b83
Remove stale comments 2019-01-17 20:45:45 -06:00
Nathaniel Nicandro
0423fd6168
Simplify extraction of src-block kernel language 2019-01-17 19:00:28 -06:00
Nathaniel Nicandro
bf761b7990
org-babel-jupyter-cleanup-file-links: Another fix for search bound
`org-babel-result-end` assumes that `point` is on the first line of the result
not on the line containing the RESULTS keyword.
2019-01-15 16:05:48 -06:00
Nathaniel Nicandro
51a4d9b2d6
org-babel-jupyter-cleanup-file-links: Fix search bound 2019-01-14 19:00:36 -06:00
Nathaniel Nicandro
bf057552d8
Promote org-babel-jupyter--cleanup-file-links to a public function 2019-01-13 22:19:25 -06:00
Nathaniel Nicandro
2231eb2378
Add the org-babel-jupyter-transform-code method
This method allows kernel languages to do transformations of a src-block's code
based on the parameters supplied to the src-block before sending the code to
the kernel. The method is called in `org-babel-expand-body:jupyter`. Currently
the only parameter supported is the `:dir` option of a src-block.
2019-01-13 22:05:35 -06:00
Nathaniel Nicandro
e2a9d9b645
Support inline Jupyter code blocks 2019-01-13 22:05:35 -06:00
Nathaniel Nicandro
5c004a43a5
Remove stale comments; fix documentation 2019-01-13 22:05:35 -06:00
Nathaniel Nicandro
1fcbf6ac5b
Delete files of unreachable links from org-babel-jupyter-resource-directory 2019-01-12 20:38:35 -06:00
Nathaniel Nicandro
cee0db9b2b
Remove unused function 2019-01-11 11:35:48 -06:00
Nathaniel Nicandro
f4eb8fee7c
org-babel-jupyter--after-execute: Remove redundancy
`jupyter-org--append-result` already handles making the right buffer current.
2019-01-08 20:26:31 -06:00
Nathaniel Nicandro
ad3ba3bdf5
org-babel-execute:jupyter: Modify block parameters after obtaining results 2018-12-10 21:36:35 -06:00
Nathaniel Nicandro
c6efda58b1
jupyter-org-insert-sync-results -> jupyter-org-sync-results
Change the behavior of `jupyter-org-sync-results` to return the org formatted
result string and modify the result parameters in `org-babel-execute:jupyter`
to add the "raw" result parameter so that the result string is directly
inserted into the buffer.

This is to work towards better support for in-lined code blocks.
2018-12-10 21:36:35 -06:00
Nathaniel Nicandro
669f1716aa Remove unused functions 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
2ac0a8b621 Do not conform to the semantics of org-babel-insert-result
There was an ugly hack that destructively modified the source block parameters
supplied to the org-babel execute function to make `org-babel-insert-result` do
all of the insertion work. This relied too much on knowing the internals of
that function. I also could never figure out how to insert stream results in a
clean way.

Instead we manually insert the results by taking advantage of the `org-element`
API. Specifically the function `org-element-interpret-data` which takes an org
syntax tree and returns its printed representation. Now the
`jupyter-org-result` method returns either a string or a syntax tree. If the
latter is returned, it is filtered through `org-element-interpret-data` to
obtain the string representation for insertion.

In addition, all source blocks insert results in a RESULTS drawer. This allows
for inserting stream output as raw text in the drawer and allows for a way to
append results since the end of the drawer acts as an insertion point.
2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
99a50c7b80 Satisfy the :dir source block argument when initializing a session 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
cec69a6d30 Change jupyter- org-mode prefix to jupy-
This is to avoid name clashing with another popular package that uses the same
prefix.
2018-11-24 22:13:28 -06:00
Nathaniel Nicandro
081f329da1 v0.6.0 2018-11-16 00:27:47 -06:00
Nathaniel Nicandro
79538c67a0 org-babel-jupyter-aliases-from-kernelspecs: Handle tangling extensions 2018-10-25 23:17:28 -05:00
Nathaniel Nicandro
5395d4d44a Rename connect-jupyter-repl -> jupyter-connect-repl, run-jupyter-repl -> jupyter-run-repl 2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
477b1ceeb1 ob-jupyter.el: Ensure that macros are available when compiling 2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
d2d0452c82 org-babel-jupyter-initiate-session-by-key: Take into account changes to run-jupyter-repl 2018-10-25 23:17:27 -05:00
Nathaniel Nicandro
a9246fcecb Rename with-jupyter-* to jupyter-with
Ensure that all functions and macros have the same
pseudo-namespace
2018-10-25 23:17:25 -05:00
Nathaniel Nicandro
a8231db79b Rename jupyter-repl-current-client to jupyter-current-client
Also move `jupyter-current-client` to `jupyter-client.el`
2018-10-25 23:07:46 -05:00
Nathaniel Nicandro
8bb43e6c68 Rename jupyter-repl-language to jupyter-kernel-language
Also move `jupyter-kernel-language` to `jupyter-client.el`
2018-10-25 23:07:46 -05:00
Nathaniel Nicandro
c070f2d04d Update documentation and comments 2018-10-25 22:57:23 -05:00
Nathaniel Nicandro
9fcfcdd32c Rename no-execute to delay-eval in org-babel-prep-session:jupyter 2018-10-25 22:10:16 -05:00
Nathaniel Nicandro
51131cde63 Pass the request object to org-babel-jupyter-clear-file-param 2018-10-25 22:10:16 -05:00
Nathaniel Nicandro
7d30fe0615 Pass the right arguments to jupyter-send-execute-request 2018-10-25 22:10:16 -05:00
Nathaniel Nicandro
9c99e5f2f9 Add jupyter-org-file-header-arg-p 2018-10-25 22:10:16 -05:00
Nathaniel Nicandro
55449c1d6a Introduce jupyter-org-client
- A `jupyter-org-client` is a subclass of a `jupyter-repl-client` and replaces
  the use of callbacks in `org-babel-execute:jupyter` to handle the insertion
  of code block results in an `org-mode` buffer. `ob-jupyter.el` now only
  contains the integration with `org-babel` and all integration with
  `emcacs-jupyter` is placed in `jupyter-org-client.el`

- Introduce `jupyter-org-request`, which inherits all of the field of a
  `jupyter-request` and adds the fields necessary for keeping track of the
  source code block information a request was generated from during the
  lifetime of the request.
2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
bbb677c573 Pop up traceback buffer on errors when executing code blocks 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
892ab84148 Silence byte compiler warnings 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
23cecb9c0f [WIP] Widget support in ob-jupyter 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
c207bea8d4 Fix indentation 2018-08-30 18:02:25 -05:00
Nathaniel Nicandro
22b1e809a0 Update documentation, cleanup comments 2018-08-30 18:02:13 -05:00
Nathaniel Nicandro
c357ee9c00 Avoid unnecessary work, remove improper usage of variable in ob-jupyter
- Do not add callbacks if source code block has no results

- Remove improper use of language argument to `org-babel-insert-result`
2018-05-28 01:25:01 -05:00
Nathaniel Nicandro
8a2468973e Fix wrong order of variable names 2018-05-16 20:46:10 -05:00
Nathaniel Nicandro
3b3fe9c43f jupyter-<type> -> jupyter-send-<type> where appropriate 2018-05-16 12:25:57 -05:00