-
Notifications
You must be signed in to change notification settings - Fork 25
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
Infinity loop with Literate #165
Comments
Hello! tldr: use Explanation(I'd appreciate a PR to the readme making some of this more explicit btw) The docstring of but the reason why it should be indicated to LiveServer where the literate scripts are is explained in the code here: the code below it does this (in short it assumes that closing for now, I hope this helps! |
Thank you @tlienart for your detailed explanation! I made some changes to However, while writing and checking this, I discovered that if the generated Using servedocs(literate=joinpath("docs","literate")) Everything is fine:
No loop if
This folder structure could be helpful if someone wants to specify servedocs(skip_dirs=[joinpath("docs","src","generated")]) How can this behavior be explained? Could it be helpful to add tips on manually specifying the location of the |
Yeah so LiveServer's servedocs needs two things:
Several cases that you've encountered:
This could be cleaned up by providing an additional keyword
where If you have an opinion on the above lmk, otherwise I'll just add this |
Your proposed syntax changes are a great idea and would make it easier to understand what must be done to use Literate properly together with It could be worth considering just a slight change of the current
Then, the The additional What do you think? |
Thanks for your suggestion, I'll open a PR with:
|
closed by #167 + patch release + update to docs (link fixed in readme); @kaipartmann kindly have a look and lmk if that works for you, thanks! |
Wield, no matter what I tried, the skip_dirs=[
joinpath("docs", "src", "generated"),
joinpath("docs", "build"),
], This is my const EXAMPLE_DIR = pkgdir(TensorInference, "examples")
const LITERATE_GENERATED_DIR = pkgdir(TensorInference, "docs", "src", "generated")
for each in readdir(EXAMPLE_DIR)
workdir = joinpath(LITERATE_GENERATED_DIR, each)
cp(joinpath(EXAMPLE_DIR, each), workdir; force=true)
input_file = joinpath(workdir, "main.jl")
@info "building" input_file
Literate.markdown(input_file, workdir; execute=true)
end |
I have no idea why the following script still runs into infinite loops using LiveServer;
LiveServer.servedocs(;
doc_env=true,
skip_dirs=[
joinpath("docs"), # skip everything in docs
]
) |
Maybe we should consider switch to #124 |
@GiggleLiu I don't think In the meantime, it would be helpful if you could reproduce exactly the scenario below and let me know what happens please:
the changes should be reflected in your browser without any looping; I just re-did this and it should be fine. If not, please open a separate issue quoting the Julia version, OS and confirming you did exactly the above. Note that 1.2.1 hasn't been released yet (even though it's been tagged) so assuming you had added LiveServer the standard way, the PR #167 above did not affect you and the problem you have encountered is elsewhere. |
Ok I've worked a bit with your repo, here are steps which will make things work, I'll think a bit about how to potentially make what you initially had work: make.jl basically remove
then call
that should work as expected, if you edit allowing a different hierarchy in
|
I tested on both master and latest release, the infinite loop is consistent. I am using Julia 1.9.2, Ubuntu 23.04. |
Thank for your suggestions, but I believe the behavior of skip_dirs still needs to be fixed. |
Thanks @GiggleLiu , the PR #169 (basically your PR + one addition after testing with your repo) should fix the problem you reported. I also re-wrote the relevant doc page to clarify the different cases. |
When trying to modify the simple example created with
LiveServer.servedocs_literate_example("littest")
, I get an infinity-loop with LiveServer.I want to use the simple folder structure suggested here in the documentation (https://docs.juliahub.com/LiveServer/CGL3l/1.2.0/man/ls+lit/) where the
*.jl
literate files and the*.md
files are in the same directory.Contents of
pg1.jl
:Contents of
index.md
:# Test A test
Contents of
make.jl
:julia> versioninfo() Julia Version 1.9.1 Commit 147bdf428cd (2023-06-07 08:27 UTC) Platform Info: OS: macOS (x86_64-apple-darwin22.4.0) CPU: 16 × Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-14.0.6 (ORCJIT, skylake) Threads: 1 on 16 virtual cores (@v1.9) pkg> status [16fef848] LiveServer v1.2.0
I am grateful for any help!
The text was updated successfully, but these errors were encountered: