fix(examples): make the per-example "run locally" command actually runnable#3308
Merged
Conversation
The 'Run this example locally' command substituted <url> with a
github.com /blob/ URL, which serves an HTML page rather than the script,
so every rendered command failed (deno run/test on the blob URL throws a
SyntaxError on '<!DOCTYPE html>'). Use the raw docs.deno.com URL, which
serves the script, and fix the repo name in the GitHub links
(deno-docs -> docs).
deno test additionally cannot run a remote URL at all ('No test modules
found'), so for deno test examples render a download-then-run-locally
command instead.
Closes #1827
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Run this example locally" command on every example page substituted
<url>with a github.com/blob/URL, which serves an HTML page ratherthan the script. As a result the rendered command never worked:
This switches the run command to the raw
docs.deno.comURL the componentalready computes, which serves the script and runs:
It also corrects the repo name in the GitHub source links (
deno-docswas relying on a redirect to
docs).Separately,
deno testcannot run a remote URL at all, even the workingraw one:
So for
deno testexamples the page now renders a download-then-runcommand that works (verified end to end against the three test examples):
Closes #1827.