nix.dev icon indicating copy to clipboard operation
nix.dev copied to clipboard

introduce eelco, a doctester

Open mightyiam opened this issue 2 years ago • 15 comments

mightyiam avatar Aug 10 '23 13:08 mightyiam

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

nixos-discourse avatar Aug 10 '23 14:08 nixos-discourse

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 avatar Aug 11 '23 11:08 mightyiam

Failure: https://github.com/NixOS/nix.dev/actions/runs/5832308481/job/15817476652?pr=672#step:5:907

Relevant crate: https://docs.rs/pty-process/latest/pty_process/index.html

mightyiam avatar Aug 11 '23 12:08 mightyiam

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

mightyiam avatar Aug 11 '23 14:08 mightyiam

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.

mightyiam avatar Aug 11 '23 15:08 mightyiam

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

nixos-discourse avatar Aug 14 '23 14:08 nixos-discourse

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 avatar Aug 14 '23 16:08 mightyiam

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 avatar Aug 14 '23 16:08 mightyiam

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

mightyiam avatar Aug 14 '23 16:08 mightyiam

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

domenkozar avatar Aug 17 '23 15:08 domenkozar

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

nixos-discourse avatar Aug 17 '23 20:08 nixos-discourse

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

fricklerhandwerk avatar Aug 23 '23 08:08 fricklerhandwerk

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?

mightyiam avatar Aug 23 '23 08:08 mightyiam

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 avatar Feb 22 '24 04:02 mightyiam

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

mightyiam avatar Feb 22 '24 04:02 mightyiam

Closing this for now as it hasn't seen any progress in a long time and is far out of date. Feel free to reopen if there is any notable update.

fricklerhandwerk avatar Aug 14 '24 22:08 fricklerhandwerk

Sorry for taking so long.

mightyiam avatar Aug 15 '24 01:08 mightyiam