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

introduce eelco, a doctester #672

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

mightyiam
Copy link
Member

No description provided.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-08-10-documentation-team-meeting-notes-71/31558/1

@mightyiam
Copy link
Member Author

The doctester app seems to fail when executed in the build phase. I'm guessing this has something to do with failing to creating a file that is part of creating a PTY.

Perhaps as a flake "check" this would be run in an environment that would allow such files to be created?

Can something be done otherwise to allow these files to be created?

@mightyiam
Copy link
Member Author

Worked around this by making this a flake app, instead.

@mightyiam
Copy link
Member Author

Regarding the fenced code block language tag, the following

```text nix-repl

would work, but it's not nice. I'd like to use the Sphinx API to create an extension that prepends text to nix-repl, avoiding the issue.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-08-14-documentation-team-meeting-notes-72/31722/1

@mightyiam mightyiam force-pushed the doctest branch 3 times, most recently from 6c5715b to c7d96aa Compare August 14, 2023 16:09
@mightyiam mightyiam marked this pull request as ready for review August 14, 2023 16:10
@mightyiam
Copy link
Member Author

I can refine the implementation but that can be done later, as well. This is already useful. Therefore, asking for review.
A few hundred lines of Rust code. But you can also take the approach that it probably works and if it doesn't then @mightyiam will fix it.

@mightyiam
Copy link
Member Author

I feel that there is some open source rust crate potential somewhere in this but haven't thought of where to draw that line yet.

@mightyiam
Copy link
Member Author

Yes, there are no tests. I wonder whether anyone will insist on tests...

Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consider moving the Rust project into a separate repository, it should also definitely have tests and code comments and somebody should take a somewhat closer look at the code.

@domenkozar
Copy link
Member

Have you seen https://github.com/OceanSprint/tesh

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-08-17-documentation-team-meeting-notes-73/31853/1

@fricklerhandwerk
Copy link
Collaborator

Yes, and I don't know why we didn't start with integrating tesh to begin with.

@mightyiam
Copy link
Member Author

It didn't seem to me like tesh provides the desired interface.

I'm in the process of extracting the vast majority of this PR into its own repo.

I suppose I will convert to draft. But I don't see the button. Are draft PRs disabled?

@fricklerhandwerk fricklerhandwerk marked this pull request as draft August 23, 2023 08:38
@mightyiam mightyiam force-pushed the doctest branch 2 times, most recently from 72ebef3 to 5f16ed9 Compare February 21, 2024 14:41
@mightyiam mightyiam changed the title doctester: repl examples introduce eelco, a doctester Feb 22, 2024
@mightyiam
Copy link
Member Author

Well... today is the last day of https://thaigersprint.org/, during which I've been working primarily on this. The documentation example tester has been extracted and released. And I've updated this pull request.

All examples are skipped except for two. Those two are repl examples.

As it stands in this PR branch, repl examples and expression examples can be written and/or edited, as long as they're within the limited feature set of eelco. That is, channels cannot be used. Examples that consist of multiple files are not supported. Could be other things we wanna do that are not supported.

@mightyiam
Copy link
Member Author

Should this be merged at this stage? Is it better than nothing? Is the design of eelco reasonable?

Copy link
Collaborator

@fricklerhandwerk fricklerhandwerk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have to play with it to see how it behaves in case of errors. From the consumer perspective I'd expect it not to require changing anything about the documentation source though.

Comment on lines +112 to +113
Use the Nix REPL to evaluate Nix expressions interactively (by typing them on the command line).
Execute it as `$ nix repl`, and you have a repl:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is not an improvement because now there is no link to reference docs. It was good as it was.

nix-repl> 1 + 2
3

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Why is there an empty line?

@@ -158,7 +158,7 @@ On NixOS, `$NIX_PATH` can be set permanently with the [`nix.nixPath`](https://se

To quickly obtain packages for demonstration, we use the following concise pattern:

```nix
```nix skip
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're only testing nix-repl blocks, there should be no need to spam every other block with redundant information (the purpose of which is not evident without "just knowing" what it means).

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

Successfully merging this pull request may close these issues.

None yet

5 participants