Giter Club home page Giter Club logo

language-weave's Introduction

Atom support Weave.jl and Pweave

Atom syntax highlighting for Weave.jl and Pweave documents.

Provides the following modes:

  • Weave.jl: markdown for .jmd, .mdw and .jmdw (markdown with noweb)
  • Weave.jl: LaTex for texw, .jtexw and .jnw.
  • Weave.jl: reStructuredText for .jrstw
  • Pweave: markdown for .pmd and .pmdw (markdown with noweb)
  • Pweave: LaTex for .ptexw and .pnw
  • Pweave: reStructuredText for .prstw and .rstw

If you need support for other formats open as issue or make a pull request.

Juno integration image

Run code using Hydrogen

Hydrogen supports running code from Pweave and Weave code chunks using its rich multi language document -feature.

For Python you simply need to install Hydrogen and you can use hydrogen keybindings to run code e.g ctrl-enter to run a line and ctrl-alt-enter to run entire chunk.

For Julia you need to add the following to .atom/keymap.cson if you want to use Hydrogen instead of Juno:

'.platform-linux .item-views > atom-text-editor[data-grammar="source weave md"],
.platform-linux .item-views > atom-text-editor[data-grammar="source weave latex"],
.platform-win32 .item-views > atom-text-editor[data-grammar="source weave md"],
.platform-win32 .item-views > atom-text-editor[data-grammar="source weave latex"]':
    'ctrl-enter': 'hydrogen:run'
    'shift-enter': 'hydrogen:run-and-move-down'

'.platform-darwin .item-views > atom-text-editor[data-grammar="source weave md"],
.platform-darwin .item-views > atom-text-editor[data-grammar="source weave latex"]':
    'cmd-enter': 'hydrogen:run'
    'shift-enter': 'hydrogen:run-and-move-down'

Run Julia code using Juno

If you have installed Juno, running code from Weave.jl documents works using ctrl-enter and shift-enter keybindings.

language-weave's People

Contributors

aviatesk avatar heliosdrm avatar kescobo avatar kylebarron avatar maximsch2 avatar mpastell avatar pfitzseb avatar tobi-lipede-oodle avatar tpoisot avatar

Stargazers

 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  avatar  avatar  avatar  avatar

language-weave's Issues

Weave HTML displays a blank preview when out_path is set

Weave HTML displays a blank preview when out_path is set.

I'm setting the out_path via YAML.

options:
    md2html:
        out_path : html
---

The HTML document weaves successfully and is output to the specified path. However, Atom displays a blank preview of the HTML.

release 0.6.5 breaks buttons

I think after update to 0.6.5 tool bar buttons are broken, at least for my .jl scripts. Was working great on 0.6.4, even though the html button was invisible. 0.6.5 brings back the html button, but no functionality for either button.

Pweave Latex syntax highlighting issue

When I open a document (with .Pnw extension) which contains some inline TeX formulas and pweave inline code ilke:

$ x= <%= x %>$

The following syntax highlighting of paragraph is broken. You can see an illustration of what happen in the attached screenshot file here.
pweave-latex-syntax-bug

Add a "Start Jupyter" button

I cannot tell you how often I go to a repository in Atom and then drop to the terminal to type jupyter lab in that directory.

A simple but useful tool would be for the language-weave extension to have a "Jupyter" button that does exactly that. Start a terminal in that directory and executes jupyter. You could give it a simple configuration option (e.g. jupyter command defaults to jupyter lab but let the user put in the full path, etc.)

Add a button to generate notebook

Just like the PDF and HTML, it would be great to have a jupyter notebook button on the toolbar.
This just calls notebook(...) on the file.

I don't believe that there is an obvious "preview" window to show, but you could try out some of the atom packages to see if one exists. Worst case, generating the notebook without preview is perfectly fine.

language-weave stealing ~, !, and @

After updating language-weave I noticed that I'm suddenly unable to type ~, !, and @ from within a julia block in a weave file. It looks like those keybindings are now triggering the commands markdown:strike-through, markdown:image, and markdown:link, but not actually typing the characters.

language-weave breaks pane opening in atom

When a .jmd file is open no other panes can be opened. Other .jmd or .jl files wont open, the config pane won't open.
If I close the .jmd file and restart atom, everything works as expected. Open a jmd file again, nothing opens.

The juno/julia terminal also wont start once a .jmd file is open.

atom 1.5.0.
language-weave 0.7.2
Arch Linux OS

All config directories were wiped and atom reinstalled.

Edit: To make things worse, save also doesn't work while a .jmd is open, so you can't actually change .jmd files at all

Soft wrap does not work

If I change the language of a pane to language-weave the soft-wrap of text is no longer working. The option is checked in the language_weave settings.

Error triggered if only pdf-view-plus is installed

The package check

!atom.packages.isPackageActive('pdf-view') ||
!atom.packages.isPackageActive('pdf-view-plus')

causes an error to be raised if pdf-view-plus is installed without pdf-view, leading to a confusing recommendation.

shift-enter in .jmd bug

A small bug: Every time i do shift-enter block evaluation the result of the block is echoed in the REPL pane (and can be by mistake evalueated at REPL). This is not a correct behavior (compared to behavior in .jl files)

Clipboard 5

Support for Documenter.jl style code blocks

It would be awesome if code fences that use Documenter.jl's syntax could be highlighted properly. Eg.

```@example
x = 2 + 2
```

or

```@repl 1
x = 2 + 2
```

It looks like the code is here, and uses some form of regular expressions? I'd be happy to try a PR, but that looks like jibberish to me. Are there any useful resources on whatever that syntax is?

Uncaught TypeError: this.webview.reloadIgnoringCache is not a function

[Enter steps to reproduce:]

  1. Click to weave HTML document.

Atom: 1.47.0 x64
Electron: 5.0.13
OS: Mac OS X 10.15.4
Thrown From: language-weave package 0.7.0

Stack Trace

Uncaught TypeError: this.webview.reloadIgnoringCache is not a function

At /Users/username/.atom/packages/language-weave/lib/html-preview.js:49

TypeError: this.webview.reloadIgnoringCache is not a function
    at HTMLPreview.reloadWebview (/packages/language-weave/lib/html-preview.js:49:26)
    at /packages/language-weave/lib/html-preview.js:38:26)
    at FSWatcher.emit (events.js:194:13)
    at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:131:12)

Commands

     -0:12.2.0 weave:weave-to-html (input.hidden-input)

Non-Core Packages

atom-clock 0.1.18 
ftp-remote-edit 0.18.0 
hyperclick 0.1.5 
indent-detective 0.4.0 
ink 0.12.4 
julia-client 0.12.5 
language-julia 0.19.3 
language-weave 0.7.0 
latex-completions 0.3.6 
pdf-view-plus 1.11.0 
tool-bar 1.3.0 
uber-juno 0.3.0 

enable cacheing?

For cells that take a long time to compute it would be great to use Weave's cache support. One way to implement it would be to add the cache=:user option when running Weave from the button, and then if the user ctrl-clicks the button it would be cache=:refresh. Using the :user option would mean that it wouldn't do any caching unless the user opts-in.

The ctrl-click behavior is sort of like what Atom uses for the git push button, where ctrl makes it a force push.

Adding a Hotkey for Weaving to HTML

I was wondering why there is not hotkey for weaving to HTML such as CMD+J CMD+H or something similar.
I've tried figuring out how to do this myself, but just started using Julia and Juno. Haven't found a solution yet.

Go to section

In sublimetext, there is a handy feature for navigating between sections with markdown files using the cmd+r shortcut. Is this also possible in Atom for weave.jl files and pweave files?

Feature request: cell-wise execution for Julia/Juno

It would be great to have an analog of julia-client:run-cell-and-move for (non-script) weave documents. Of course, weave already has a natural notion of cell, but even better would be if this command recognized "subcells" as well: I'm thinking of code chunks that, e.g., can be further divided by ## for interactive evaluation.

Can't type tabs or @

With Weave Markdown set as the language, I can no longer type tabs or @. Tab completion still functions and this does not happen in github markdown. Keybinding resolver:

@: `'atom-text-editor[data-grammar="source weave md"]':
'@': 'markdown:link'

tab: 'atom-text-editor[data-grammar="source weave md"]':
'tab': 'markdown:indent-list-item'

Markdown parts of .jmd not highlighting

Just came back to wanting to use .jmd notebooks for code, but the markdown syntax highlighting isn't working (julia highlighting is).

Note the bold text:

screenshot 2017-07-18 17 15 48

And some other formatting:

screenshot 2017-07-18 17 16 05

Weave.jl markdown is auto-detected as the file type. I'm on Atom v1.18.0, language-weave v0.4.0

If I switch file type to plain markdown, the highlighting works but I lose the lovely ability to execute code in codeblocks with juno.

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.