magic-console

所属分类:编译器/解释器
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2016-07-01 20:18:10
上 传 者sh-1993
说明:  Atom的交互式编程,
(Interactive programming for Atom,)

文件列表:
.babelrc (93, 2016-07-01)
.bookignore (36, 2016-07-01)
.eslintignore (33, 2016-07-01)
.eslintrc (554, 2016-07-01)
.npmignore (20, 2016-07-01)
CHANGELOG.md (562, 2016-07-01)
LICENSE.md (1058, 2016-07-01)
book.json (429, 2016-07-01)
docs/ (0, 2016-07-01)
docs/api/ (0, 2016-07-01)
docs/api/payloads.md (5222, 2016-07-01)
docs/api/plugins.md (2687, 2016-07-01)
docs/api/runtimes.md (5232, 2016-07-01)
docs/docs.png (555529, 2016-07-01)
docs/examples.md (6024, 2016-07-01)
docs/glossary.md (720, 2016-07-01)
docs/live-edit.gif (4022170, 2016-07-01)
docs/live-edit.png (604196, 2016-07-01)
docs/playground.png (540741, 2016-07-01)
docs/plugins/ (0, 2016-07-01)
docs/plugins/Color.png (529836, 2016-07-01)
docs/plugins/Latex.png (379479, 2016-07-01)
docs/plugins/LineChart.png (529591, 2016-07-01)
docs/plugins/Markdown.png (462624, 2016-07-01)
docs/plugins/Mermaid.png (484381, 2016-07-01)
docs/plugins/PieChart.png (511665, 2016-07-01)
docs/plugins/ReactComponent.png (427529, 2016-07-01)
docs/plugins/Regex.png (353721, 2016-07-01)
docs/plugins/Table.png (537958, 2016-07-01)
docs/plugins/Test.png (512531, 2016-07-01)
docs/plugins/community.md (34, 2016-07-01)
docs/plugins/core.md (6486, 2016-07-01)
docs/prior_art.md (687, 2016-07-01)
docs/tests.png (523515, 2016-07-01)
examples/ (0, 2016-07-01)
... ...

# Magic Console (alpha) > Interactive programming for Atom Magic Console is a package for [Atom](https://atom.io/) that evaluates code in [pretty much any language](#supported-runtimes) and renders the output alongside the source code. If that alone weren't good enough, it also visualizes the outputs in a human-friendly way (e.g. string as Markdown, array as table, object/dictionary as tree). Wait there's more! Visualizations are entirely pluggable, so you can take advantage of the [core plugins](http://gnestor.github.io/magic-console/docs/plugins/core.html) and [plugins created by the community](http://gnestor.github.io/magic-console/docs/plugins/community.html) or create a custom plugin for your specific application. ![](/docs/live-edit.gif) ## Features * **Visual** * Automatically visualize [common data types](http://gnestor.github.io/magic-console/docs/plugins/core.html) * Pluggable visualizations ([using React components](http://gnestor.github.io/magic-console/docs/api/plugins.html)) * **Interactive** * Static and dynamic visualizations * Re-evaluate source code on save * Hot reload visualizations on save * Automatically install NPM dependencies when declared in visualization source (coming soon!) * Time-travel between past output states * **Universal** * Support for [68 programming languages](#supported-runtimes) (don't see your programming language, you can add support for it with a [couple lines of code](#add-a-runtime)) * Atom is cross-platform (OS X, Windows, Linux) and open-source * **Plug and play** * No configuration necessary * No (dev) server necessary ## Practical applications ### Interactive playground ![](/docs/playground.png) Use Magic Console to try out code, explore results, run experiments, etc. ### Interactive testing ![](/docs/tests.png) Use Magic Console to test code as you write it. Since you are evaluating your code in real-time, you don't *need* to write tests. Nonetheless, you can write assertions against your code and render the outputs using the Test plugin. ### Interactive documentation ![](/docs/docs.png) Use Magic Console to mix Markdown documentation with interactive code examples. ## Getting started ### Install * [Install Atom](https://atom.io/) * Clone the repo * `git clone https://github.com/gnestor/magic-console.git` * `cd magic-console` * Install the dependencies * `npm install` * Link the directory * `apm link` #### Commands | Command | OS X | Linux/Windows | Notes | |:--------------------------------------|:---------------------|:----------------------|:-------------------------------------------------------------| | Magic Console: Toggle | CMD+ENTER | CTRL+ENTER | Evaluate current file or selected text | | Magic Console: Open plugins directory | | | Open the plugins directory in a new workspace | | Magic Console: Create new plugin | | | Create a new plugin and open it in the current workspace | | Magic Console: Step Backward | CMD+Z | CTRL+Z | Step back in output history | | Magic Console: Step Forward | CMD+SHIFT+Z or CMD+Y | CTRL+Y | Step forward in output history | ## FAQ > I don't see any output... The runtime for the source code must be [supported by Magic Console](#supported-runtimes) and installed. For example, if your source code is a CoffeeScript file, then as long as the [coffee-script runtime](https://www.npmjs.com/package/coffee-script) is installed, you're good to go because CoffeeScript is supported. If your source code is a [Dogescript](https://dogescript.com/) file, then you would need to [add that runtime](#add-a-runtime) because it's not supported yet and have [dogescript runtime](https://www.npmjs.com/package/dogescript) installed. > I'm getting compilation errors... Check out the active grammar for your source code in the lower-right side of the bottom status bar and make sure that it matches the programming language you are using. For example, if you are writing ES6 Javascript and you are seeing "Javascript" and not "Babel ES6 Javascript," you need to [install](https://atom.io/packages/search?utf8=%E2%9C%93&q=language) the "Babel ES6 Javascript" grammar and use it instead. > How do I? * **Watch a file:** Enable "Evaluate on save" in Magic Console's package settings * **Toggle between visualizations/plugins?:** Hover over an output and use the drop-down selector to toggle between plugins available for that data type * **Edit a plugin's source code:** Hover over the plugin and click the code button. The plugin source code will open in a new editor panel and allow you to edit the source code inline with its rendering. When the source code is saved, it will be hot reloaded and the rendering will be updated instantly. * **Clear the outputs:** Hover out the outputs and click the clear button at the top. * **Copy/paste output:** Hover over the outputs and click the copy button at the top to copy the raw output data to the clipboard. * **Import output data into another source file or application?**: The output data for each source file is serialized in a hidden file by the same name in the same directory (`.helloWorld.js.json` for `helloWorld.js`). You can import this data as JSON like so (using Javascript): ```js import {outputs} from './.helloWorld.js.json' ``` ## Contributing Use the Atom [contributing guidelines](https://atom.io/docs/latest/contributing) ### Workflow * Re-install dependencies after pulling upstream changes * `npm install` * Run Atom in dev mode * `npm start` or `atom --dev .` * Submit a pull request! ### Thanks * [@nodejs](https://github.com/nodejs), [@atom](https://github.com/atom), [@facebook/react](https://github.com/facebook/react) for laying the foundation * [@rgbkrk](https://github.com/rgbkrk) and community for [atom-script](https://github.com/rgbkrk/atom-script) * [@jupyter](https://github.com/jupyter) and [@nteract](https://github.com/nteract) communities for inspiration ## Appendix ### Supported runtimes * 1C (BSL) * AppleScript * Bash * Behat Feature * C * C++ * C# * cript * Clojure (via Leiningen) * Coffeescript * CoffeeScript (Literate) * Crystal * Cucumber (Gherkin) * D * DOT * Elixir * Erlang * F# * Forth (via GForth) * Gnuplot * Go * Groovy * Haskell * ioLanguage * Java * Javascript * JavaScript for Automation (JXA) * Jolie * Julia * Kotlin * LaTeX (via latexmk) * LilyPond * Lisp (via SBCL) * Literate Haskell * LiveScript * Lua * Makefile * MoonScript * MongoDB * NCL# * newLISP * Nim (and NimScript) * NSIS * Objective-C * Objective-C++ * OCaml * Pandoc Markdown * Perl * Perl 6 * PHP * PostgreSQL * Prolog * Python * RSpec * Racket * RANT * Ruby * Ruby on Rails * Rust * Sage * Sass/SCSS * Scala * Shell Script * Swift * TypeScript * Dart * Octave * Zsh ### Add a runtime ```coffeescript Clojure: "Selection Based": command: "lein" args: (context) -> ['exec', '-e', context.getCode()] "File Based": command: "lein" args: (context) -> ['exec', context.filepath] ```

近期下载者

相关文件


收藏者