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

Feature: Automatically run example code in a REPL #28

Closed
RichardLitt opened this issue Aug 5, 2016 · 6 comments
Closed

Feature: Automatically run example code in a REPL #28

RichardLitt opened this issue Aug 5, 2016 · 6 comments

Comments

@RichardLitt
Copy link
Owner

There should be a tool that does this on top of the standard-readme spec.

@martinheidegger
Copy link

There is run-markdown That does something similar. In its current state it is not well usable because you can't prepare an environment for the test. (specify code that you don't need to be visible within the markdown file). But I think think in general it is good practise - I don't know how often I published broken docs ...

@RichardLitt
Copy link
Owner Author

This would have to be a suggestion, as some code can't easily be run in a REPL. We could suggest run-markdown. Or others?

@martinheidegger
Copy link

martinheidegger commented Oct 20, 2016

If there is a linter, it should include a way to pass the code snippets to an executor: i.e. if there is a

console.log('Hello')

and you run the readme against standard-readme --exec="npm run test-doc"

and it will execute the above snippet like:

$ echo "console.log('Hello')" | npm run test-doc -- 1

@RichardLitt
Copy link
Owner Author

Agreed about this is something that ought to be worked into the linter. Going to link it to #5 and leave this open for now.

@wooorm
Copy link
Collaborator

wooorm commented Nov 14, 2019

Is this something standard-readme can dictate? 🤔 I’d leave this up to platforms that render readmes!

@RichardLitt
Copy link
Owner Author

Agreed.

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

No branches or pull requests

4 participants
@RichardLitt @martinheidegger @wooorm and others