Skip to content

Conversation

oxzi
Copy link

@oxzi oxzi commented Aug 12, 2025

The "play" command for present does not only support Go code, which was
implicitly documented, but also generic scripts identified by a shebang
or txtar-encoded input - enabling Go modules.

The locally used implementation for "play" resides in
./playground/socket/socket.go. Mostly undocumented, this code first
checks the input for a shebang and, if present, executes input with the
shebang interpreter. This code also allows txtar-encoded input, which
can be used to "play" Go modules, including external dependencies.

Documenting the actual behavior helps users to understand and use the
software better. Personally, I initially wanted to patch Go module
support in present, just to find out everything is already there - just
undocumented.

@gopherbot
Copy link
Contributor

This PR (HEAD: 7f76053) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/695356.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@oxzi oxzi force-pushed the present-doc-play-formats branch from 7f76053 to 3dcbeb7 Compare August 12, 2025 18:42
@oxzi oxzi changed the title present: Document shebang and txtar for .play present: document shebang and txtar for .play Aug 12, 2025
@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/695356.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 3dcbeb7) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/695356.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

The "play" command for present does not only support Go code, which was
implicitly documented, but also generic scripts identified by a shebang
or txtar-encoded input - enabling Go modules.

The locally used implementation for "play" resides in
./playground/socket/socket.go. Mostly undocumented, this code first
checks the input for a shebang and, if present, executes input with the
shebang interpreter. This code also allows txtar-encoded input, which
can be used to "play" Go modules, including external dependencies.

Documenting the actual behavior helps users to understand and use the
software better. Personally, I initially wanted to patch Go module
support in present, just to find out everything is already there - just
undocumented.
@oxzi oxzi force-pushed the present-doc-play-formats branch from 3dcbeb7 to 10dcaf4 Compare August 13, 2025 11:30
@gopherbot
Copy link
Contributor

This PR (HEAD: 10dcaf4) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/695356.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

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.

2 participants