Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide some sort of guide on self hosting? #1

Closed
ghost opened this issue Oct 6, 2022 · 2 comments
Closed

Please provide some sort of guide on self hosting? #1

ghost opened this issue Oct 6, 2022 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 6, 2022

I can't figure out how to self host this. I built it with the makefile, but now I'm confused as to running it? I tried running the html file with firefox but the input is blank, and the examples does nothing, etc.

@leozamboni
Copy link
Owner

Hello, thank you for opening an issue.

For local run you need a HTTP server, you can do this with python3:

python3 -m http.server 8000   

or with bun:

bun dev

Now you will need only the "holy.js" file.

Make sure you have a input tag with "stdin" id and other with "stdout/stderr" in your HTML DOM:

 <textarea id="stdin"></textarea>   
 <textarea id="stdout/stderr"></textarea>

The "stdin" will be for the HolyC code and the "stdout/stderr" the output of the interpreter.

After you will need to import this procedure in your BOM inside the head tag:

<script defer type="module">
     import { holyc_web_run } from "./holy.js"
     window.holyc_web_run = holyc_web_run;
 </script>  

You can call this procedure for run the stdin with a button, for example:

<button onclick="holyc_web_run()">RUN(▶)</button>

When you click, the interperter will get the code in the "stdin" tag and put the output inside the tag with "stdout/stderr" id.

@ghost
Copy link
Author

ghost commented Oct 7, 2022

Lifesaver. Tysm.

@leozamboni leozamboni pinned this issue Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant