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

Add option to display the output of the compiler and the application statically #107

Open
gusthoff opened this issue Jul 23, 2018 · 3 comments · Fixed by #507
Open

Add option to display the output of the compiler and the application statically #107

gusthoff opened this issue Jul 23, 2018 · 3 comments · Fixed by #507
Assignees
Labels

Comments

@gusthoff
Copy link
Collaborator

Some source-code examples don't have a "run" button. In those cases, we could still display the output of the compiler and the application statically (i.e., embedded in the HTML page). A "run" button still wouldn't be available in those cases. However, the reader would be able to see the expected output.

One way of implementing this feature could be by (automatically) running the examples on server side and storing the output on a file (on server-side). When the page is accessed on the website, the web-server would merge this output to the remaining HTML code.

@raph-amiard raph-amiard added the enhancement New feature or request label Jul 27, 2018
@raph-amiard
Copy link
Member

As discussed live with Gustavo: This could be a good way to then embed the ouptut of the compiler/run into the resulting PDF version.

gusthoff added a commit to gusthoff/ada-learning-material that referenced this issue Feb 16, 2019
@gusthoff
Copy link
Collaborator Author

gusthoff commented Mar 5, 2021

Added support for compiler output (for PDF books): #507.

@FryingPanBrock
Copy link

I would like to add to this issue. Currently in the PDF files, you cannot see the commands used to generate the output. Thus, I, as a learner, have no idea what to run in the terminal unless I look somewhere else, such as the online version of the course at hand, to find out.

It would be very nice if all of the terminal output were included, not just the results. E.g.:

$ gprbuild -q -P main.gpr
Build completed successfully.
$ ./learn
Learning Ada from A to Z

Or in the case of SPARK:

$ gnatprove -P main.gpr --checks-as-errors --level=0 --no-axiom-guard --report=all
Phase 1 of 2: generation of Global contracts ...
Phase 2 of 2: flow analysis and proof ...
increment.adb:5:10: info: overflow check proved
increment.ads:4:03: info: data dependencies proved
increment.ads:5:03: info: flow dependencies proved
increment.ads:7:14: info: postcondition proved
increment.ads:7:24: info: overflow check proved
Summary logged in gnatprove/gnatprove.out

Furthermore, all of the examples have example files that can be downloaded. E.g. in the Hello World example in Ada, only the source code of greet.adb is shown. However, the example involves the use of the files main.gpr and main.adc. There is no way to know this just from reading the PDF file. I have made a separate issue about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants