dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.85k stars 381 forks source link

[Feature Request] : Add html + css support for me to render output cells #1833

Open Xyncgas opened 2 years ago

Xyncgas commented 2 years ago

So I can use the web with c# instead of javascript

Xyncgas commented 2 years ago

Imagine I give you a note book, you are greeted with pretty UI instead of a bunch of codes. You can click a button to see the code that's behind your beautiful application. Permissions can be set to sandbox what distributed codes can do, people can customize their app and sometimes even swap out different UI (framework) providers in the marketplace to customize their UI.

Imagine I am a gamer and you are a gamer, I shared a template to you that can run a minecraft server, but our enviornment is different so you are able to go into the code and change the values (ip, ports) yourself. Then maybe in the future add an entry point to the notebook and now it can be distributed as an app and can be compiled to run on the server. Maybe 1 entry for UI 1 entry point for server side behavior.

Szeraax commented 2 years ago

Sorry, I don't see how your title matches up to your description.

Do you want the output cells to rendered with like a notebook wide .css style? I ask because your description doesn't talk about css styling at all. I touches on being able to run notebooks as executables (on the roadmap already) and access interactive input (already on the roadmap for notebooks and compiled mode too).

And I just don't even know where permissions and swapping out framework fit in here. Can you please provide more detail on your specific feature request that you would like implemented?

Xyncgas commented 2 years ago

it's ok, I am sorry for causing the confusions too.

In my opinion, currently blazor can let people render the web using c#, developing the interface and logics in one project, and if we can extend .NET interactive to blazor, we can distributed applications in a new way aside from blazor.

The difference to making websites with blazor would be that you are distributing the source code instead of a compiled version of it, and people can modify this source code aka script to modify the behavior of the application.

ps: this feature request's difference to what we have now is the ability to hide codes to behind the screen, essentially an interface that we can toggle to see the 'code behind' just like the experience we have today, and another mode for toggling to see an interface without the code but rendered by the code (of course it would be nice that we can import other notebooks aside from nuget packages)

I like the idea that Notebook can be distributed as an executable, and I do see that users would now get their applications through an installation file just like the old days but it's also possible that people can visit the website and then change its behavior by changing the source code that the website is generated and either store it in the server or in local store inside the browser (this requires at minimum only being able to use .NET interactive in the browser, for interpreting c# like it's javascript, the rest of the flow can be left to the developers)

Use cases for example are :

  1. Simplifying application configurations by allowing directly manipulate the source code that makes it work.
  2. Provide Documentations of how things works.
  3. Bring developer's world closer to the users, make insights and ease of access available to the end user, it's also healthier to understand the developer's experience for both the reason to have something nice and to embrace the freedom to control their technologies.
  4. Portability. Through blazor and MAUI we can make applications with web UI across a majority of platforms, now if people download the app instead of visiting it on an url it should still work by either opening the browser on localhost like the developing experience we already have in visual studio when making blazor projects or we run the code inside MAUI.
  5. Prosperity. When you are sharing the software using .NET interactive, your source code is made available to the people, which makes it a great way to modify and control its behavior, but also taking parts of what works and putting it in other places, in the world where developer experience and user experience are blended together, developers are encouraged to make their application in more modular ways, and then users are encouraged by the enablement of having the possibility to take the way Application A is rendering messages and use it to render Application B's messages and the ecosystem is going to be filled with people's ideas to do one thing in 10 different ways.
Xyncgas commented 2 years ago

Also would be nice if we can have an experience, where people are browsing and downloading .ipynb notebooks from the web inside visual studio code, so it feels like a browser and you can play a game written in c# just by putting the game's github repository's url or just some url that serves the .ipynb or c sharp project file in visual studio code.

Xyncgas commented 2 years ago

I like that you can write codes in the notebook and then run it as an executable

GeorgeS2019 commented 2 years ago

Now, we are using Plotly.NET

With this feature request,

We could use not only plotly.blazor but other blazor components created by c# developers to share through .NET interactive

msedge_lahSYjk5ug