|
Wondering if there is any way to prompt and get input from the user in notebookjs. It would be useful for prototyping some small scripts that I write. Maybe create an HTML input form? Use Node to read from the console (e.g. readline)? |
Answered by
alagrede
Mar 18, 2022
Replies: 4 comments 2 replies
|
Hi @lostecmo, 1 - The load block:Declaration Usage 2 - The global block:```js ```js I hope this will help you. |
0 replies
Answer selected by
lostecmo
|
As a follow-up, a few more examples of using the Display HTML element (htmlEL and el) would be helpful as well.
Thanks,
Alan
…________________________________
From: alagrede ***@***.***>
Sent: Friday, March 18, 2022 11:29 AM
To: alagrede/znote-app ***@***.***>
Cc: Alan Gingras ***@***.***>; Mention ***@***.***>
Subject: Re: [alagrede/znote-app] How to prompt for input? (Discussion #55)
Hi @lostecmo<https://github.com/lostecmo>,
Thank you for your feedback 😊
I don't know if this is enough for your use case, but we already have 2 similar features to get user input.
But I will think about displaying an HTML input, it would be prettier 👍
1 - The load block:
Declaration
```json block1
{ "name": "val1", "props": "val2"}
```
Usage
```js
print(loadBlock('block1'));
```
2 - The global block:
```js
//global 1
const myVar = "Hello";
```
```js
print(myVar);
```
I hope this will help you.
Anthony
—
Reply to this email directly, view it on GitHub<#55 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACWSWFXQ7AFBYOPBINOUJSTVASONRANCNFSM5RAMVOXQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
1 reply
|
Thanks for the quick response. To be honest, I am probably looking for more than is currently possible. I would like to be able to run my code block and have a prompt (HTML for or even some type of console) to get input. I can at least work on most of my script logic with things as they are. The load block will at least give me a good area for canned user input.
…________________________________
From: alagrede ***@***.***>
Sent: Friday, March 18, 2022 11:29 AM
To: alagrede/znote-app ***@***.***>
Cc: Alan Gingras ***@***.***>; Mention ***@***.***>
Subject: Re: [alagrede/znote-app] How to prompt for input? (Discussion #55)
Hi @lostecmo<https://github.com/lostecmo>,
Thank you for your feedback 😊
I don't know if this is enough for your use case, but we already have 2 similar features to get user input.
But I will think about displaying an HTML input, it would be prettier 👍
1 - The load block:
Declaration
```json block1
{ "name": "val1", "props": "val2"}
```
Usage
```js
print(loadBlock('block1'));
```
2 - The global block:
```js
//global 1
const myVar = "Hello";
```
```js
print(myVar);
```
I hope this will help you.
Anthony
—
Reply to this email directly, view it on GitHub<#55 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACWSWFXQ7AFBYOPBINOUJSTVASONRANCNFSM5RAMVOXQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
1 reply
|
Thank you so much for the update. I will review and try the examples. As for what I'm doing... for the most part, trying to learn more javascript/html/etc. Thought NotebookJS and/or ZNote would be a nice platform to use for it. Similar to Jupyter for python. In the long run, I'm hoping to use it as a working notebook for development of some private applications for use in trading various stocks/forex/etc. So I want to see what I can create for a bit of a user interface / display of information.
Sincerely yours,
Alan
…________________________________
From: alagrede ***@***.***>
Sent: Tuesday, October 11, 2022 3:25 AM
To: alagrede/znote-app ***@***.***>
Cc: Alan Gingras ***@***.***>; Mention ***@***.***>
Subject: Re: [alagrede/znote-app] How to prompt for input? (Discussion #55)
Hi @lostecmo<https://github.com/lostecmo>,
To complete my previous answer, I had some useful examples explaining how to load external libs, scripts, manipulate data...
https://github.com/alagrede/znote-app/tree/master/examples
Check the expressjs example, I put an HTML input and send user value to a server. Or maybe the React example.
I would be very interested to know in detail what you are trying to do. Could you try to explain me your use-case? Maybe I could help you build it and isolate new features to put in the application.
Anthony
—
Reply to this email directly, view it on GitHub<#55 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACWSWFQFDM4ITSQE3FH2SH3WCUJALANCNFSM5RAMVOXQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @lostecmo,
Thank you for your feedback 😊
I don't know if this is enough for your use case, but we already have 2 similar features to get user input.
But I will think about displaying an HTML input, it would be prettier 👍
1 - The load block:
Declaration
```json block1
{ "name": "val1", "props": "val2"}
```
Usage
```js
print(loadBlock('block1'));
```
2 - The global block:
```js
//global 1
const myVar = "Hello";
```
```js
print(myVar);
```
I hope this will help you.
Anthony