Giter Site home page Giter Site logo

shell-runner-notebooks's Introduction

Shell Runner Notebooks

Parses scripts in popular shell languages and allows you to run the cells in the active terminal below.

  • Comment blocks get rendered as markdown.
  • Code blocks get rendered as code blocks.

Usage

Create a file whose filename ends with the following

  • PowerShell (*.Notebook.ps1)
  • Bash (*.Notebook.sh or *.Notebook.bash)
  • Zsh (*.Notebook.sh or *.Notebook.zsh)
  • Basically any POSIX shell (*.Notebook.sh)

Features

You can load, run, and edit scripts in a Notebook-like experience.

Gif of running scripts: PowerShell Notebooks

Gif of editing on the script side: edits go back

Requirements

The shell you want to run scripts of.

shell-runner-notebooks's People

Contributors

airtonix avatar tanhakabir avatar tylerleonhardt avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

shell-runner-notebooks's Issues

how to export md format

I want to share my notebook to others,for example copy to wechat official accounts,but the code cells
are not in ``````,how to export md format?

multi code cell will be one when reopen?

When you reopen a shell file with consecutive multiple code cells, they will become one single cell.

image

markdown cells also. Then will be the wrong outline like following(Lost the first one):
image

Single cell can execute,why reopen the .Notebook.sh these cells to be one?
Thank you!

Exploration: Having an interactive terminal as the output of a Shell code cell?

Currently @TylerLeonhardt's notebook takes a normal script file that has markdown and scripts and serializes the file into a notebook file. So this means you would have a file like example.sh and if you add .Notebook to the name to be example.Notebook.sh the original scripts and markdown become a Notebook.

Some work items I wanted to do from this:

  1. Add a serializer to read off just a generic notebook file like example.shell-notebook to read just a notebook file and not need any script file beforehand.
  2. Currently there's 2 controllers(kernels): PowerShell and Shell. We can combine these two to be just one controller and get a polyglot notebook. 1 controller/kernel to many languages.

Currently the terminal is run by just using the visible integrated terminal. The notebook just passes the scripts to the terminal.

But @rebornix and @jrieken and I were exploring the idea of having an interactive terminal as output cells in the notebook.

I remember @Tyriar mentioned in a stand up that you were interested in a shell notebook. I was wondering what your ideas for the notebook was? And if you think it'd be feasible/a good idea to put in an interactive terminal like this?

I think @lszomoru was also interested in doing some sort of branching for a shell notebook where a user runs the first cell script and depending on the result, insert/show some cells with scripts to fix the errors.

comment in shell script will be markdown when reopen the sh file

import jaydebeapi
import pandas as pd
# 连接 Hive 数据库
conn = jaydebeapi.connect('org.apache.hive.jdbc.HiveDriver',
                          'jdbc:hive2://192.168.200.207:10000/default',
                          ['hive', ''],
                          'D:\jars\hive-jdbc-1.1.0-cdh5.15.0-standalone.jar')

# 执行 SQL 查询语句
cursor = conn.cursor()
cursor.execute('show databases')

# 读取查询结果
results=cursor.fetchall()
# for row in cursor.fetchall():
# print(row)
df = pd.DataFrame(results, columns=[column[0] for column in cursor.description])
print(df)
# 关闭连接
cursor.close()
conn.close()

this is one cell in test.Notebook.sh, but when closed and reopen the file, every #row will be markdown cell, and original 1 cell will be
more than 11 cells,
image

how to void the bug?
thank you!

Cannot open resource with notebook editor type 'pwshnb'

I get this error when trying to open a new, empty file test.Notebook.ps1

Cannot open resource with notebook editor type 'pwshnb', please check if you have the right extension installed or enabled.

It also happens for existing .ps1 that I convert to Notebooks.

[FEATURE REQUEST] - export to HTML

I'd like to request the feature to export the format to HTML. I think this is possible because VSCode uses notebook format natively so that would be capable of converting to HTML format.

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.