-
Notifications
You must be signed in to change notification settings - Fork 481
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
Add option to change working directory for evaluation of example code #1025
Conversation
I'm testing on a document called # Testing
Here's a test
```@repl
pwd()
``` Default behavior works as expected, but if I pass strings like "src", "build" or "test", I get the same output for all of them:
But if I pass "." I get
or if I pass ".." I get
Clearly I'm missing something about how the paths are passed through - any help would be appreciated. Also happy to take other comments / suggestions of course |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For testing, an option would be to set up a simple site build similar to test/examples/
, say under test/workdir/
.
So, this now works locally. If I do Other tests all pass, but this is causing an error outside of tests:
I copied the code from |
FWIW, other than #1027, this branch now works for my use-case 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For docs, it should have an entry in the makedocs
' docstring. And would you also mind adding an entry to CHANGELOG.md?
I took the liberty of re-organizing the tests a bit. I marked a few as broken though until it's clear how we want to handle relative paths. |
That's awesome, thanks! I like your changes, and all of your tests now pass. How should I bring this up to date with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. LGTM other than the small buildnode
thing.
How should I bring this up to date with master - do you have preferences about rebase vs merge commits?
I would probably just squash merge this, if that sounds reasonable to you.
That's fine with me! Please let me know if there's anything else you need, and thanks for helping me through this :-) |
The appveyor failure only occurs on |
I appreciate the work you have put into this PR. However, it feels a bit wrong with a global option for this. Would it be better with something in an
? Also, regardless of this we should store the |
I do feel that per-file option would be better in principle. So I am thinking that it might be a good idea to declare |
I marked it experimental so that we could go ahead and merge this, but also potentially revisit these decisions in the future. As a side note, we should probably move some of the other "experimental" keywords out the experimental section -- e.g. Edit: test failures unrelated, see #1037. |
I hope I didn't find one these compromises that makes everyone unhappy 😆 Thank you @kescobo for your work on this! Are you fine with using Documenter on |
@mortenpi This is great! Thanks so much for shepherding me through this :-). Definitely happy to be on Documenter |
Attempt to address #1013
working_dir
option tomakedocs
I've added a
working_dir
option tomakedocs()
, which is intended to allow a user to set where code in@example
and@repl
blocks is evaluated from. The default value is:build
which recapitulates current behavior.