Comments (4)
If your moving over to ScriptCS as your underlying runtime engine and planning in allowing CShell modules to be loaded via nuget maybe you would want to integrate them with ScriptCS modules/script packs.
This would allow developers to be able to simply extend and depend on those data renders when running in both ScriptCS at the commnad line and CShell.
On the command line the module might just dump to file system but when hosted in CShell it would open in a tab and display the data.
from cshell.
@tocsoft, I do like that idea. I'm looking into ScriptCs modules right now. Where are they normally installed? Are in the install dir of ScriptCS itslef?
I've been thinking for a while how to allow scripts to run on command line. I like the idea of sinks supporting writing their output to the file system instead of opening a tab. For some sinks this might be a bit hard to do. But it could be optional for a sink developer to support command line execution.
from cshell.
disclaimer: no expert on scriptcs
Believe they are designed to be loaded up from Nuget packages and normally scriptcs handles loading them all in and registering themselves into its pipeline.
How I would approach it would be provide a series of script packs for the sinks.
Each script pack could expose its own set of extension methods and they all take a dependency on ISink
and allow the runtime to provide the implementation (allowing you to swap it out when hosted in CShell).
The Api could look something as simple as;
interface ISink
{
/// <remarks>
/// data must implement one of
/// ISinkDataFileSave or ISinkDataUIControl
/// </remarks>
bool Display(ISinkData data);
}
interface ISinkData
{
string Name { get; }
}
interface ISinkDataFileSave : ISinkData
{
string FileExtension { get; }
void Save(Stream streamToSaveto);
}
interface ISinkDataUIControl : ISinkData
{
void Render(UIControl controlToAppendTo);
}
This allows each sink to be pretty much standalone.
And giving them the power to optionally render to screen or file system. (screen being a noop on the command line or it could write a text file using a well known pattern telling the user that it needs to be run from cshell to access this output).
Additionally sink extension methods should (by conventions) should always require a name to be provided (to be used as either the tab name and/or the file name).
from cshell.
I moved the sinks to external modules, and simplified the sink API substantially.
Basically it boils down to:
ISink
Implmentation
Some static extension methods for syntactic sugar.
See the sink projects.
from cshell.
Related Issues (20)
- DumpGrid omits property named "Name" (v0.1.2.30750) HOT 3
- Upload Chocolatey package
- Add support for clearing the interactive console HOT 2
- License HOT 1
- Should have a menu item to 'close all files' HOT 2
- Can't add an 'assembly reference' to the workspace HOT 1
- Upgrade CShell to also run F# scripts HOT 1
- Coding Guideline: Convert all tabs to spaces HOT 2
- Add Wix Installer to project HOT 2
- Output window doesn't work anymore HOT 1
- Refactor console output
- Wix installer has assemblies missing, CShell.exe crashes on open
- Default workspaces not opened when installed via the installer
- Input string was not in a correct format
- Printers
- Add the ability to dump into files and clipboard
- Multiple Workspaces
- UX: Text editing painful to use (suggestion) HOT 1
- Is there a place where we can change the splash screen image?
- Can you update the referenced assembly version?(AvalonEdit + NRefactory) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cshell.