-
Notifications
You must be signed in to change notification settings - Fork 115
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
py for windows and custom head #159
Conversation
Hello Daniel! thanks so much for helping out, testing on windows 10 is something I was not able to do so it's super helpful to have someone who is willing to try things out and report problems. Now I have a comments/questions for your suggestions suggestion 1 -- python 3I understand your issue though you would also need to change where it's called (in the I think the easiest would be to follow the good example specified by the package PyCall https://github.com/JuliaPy/PyCall.jl where you can specify whatever path you want to the python3 executable. I've openened an issue for this (#160) and will try to do this soon. suggestion 2 -- headI'm not entirely sure I understand what you're trying to do here 🙂 you can modify the If that doesn't help, could you show me the repository where you're trying to use this and I can take a look and make suggestions depending on what you want to do? That will also help me understand how to clarify things better in the doc. Thanks! |
1. PythonIt looks like it is the standard way on windows. I am not a big python user but the documentation hints that this is the way.
That is why I kept the
That is a good point, but since I couldn't use optimize before because JuDoc could not find python. 2. HeadI just realized that calling it "custom head" was not the best name choice. My point is, if you keep the way the head.html comes, you can only use it as a user site. You can't use it as a project site. In other words, I could use JuDoc to make the site for https://danmrc.github.io, but not for https://danmrc.github.io/repo (where repo is the name of the repository). The section for hosting the website at the documentation of the package leads to github tutorial on how to establish a user site. However, it is straightforward to change the head.html in a way that you can host your site on a /repo address. All you need is to change some links on head. Let me use the example from the template tutorial:
The way to allow github pages to make it work is to change the /pub to /repo:
(You will also need to change the path to the css accordingly) However, now when I use There might be an easier way to do this using your package and my suggestion might be absolutely useless. However, this was based on the help for the
But the current directory is not the directory I am using to put the site on the web, and even if it was, I could not make it work for https://danmrc.github.io/repo. So my solution was to change the head.html. Then again, I am not sure this is the best way to do this nor if this is already implemented. Maybe this is a completely unnecessary change. Best regards |
Ok right, I now understand both issues, thanks. I've opened new issues to track this:
I'll try to fix both soon! |
Ok, I've now merged a PR for the first problem (python on windows, #160). It would be great if you could try the following (assuming you have both pkg> add JuDoc#master julia> using JuDoc
julia> newsite("testpy")
julia> optimize() This should work, if you check the website, the html should be minified and there should be no javascript. If you could confirm that's the case, it would be super useful, thanks!! Note: I've also allowed user-specification of how to call python/node via julia> ENV["PYTHON3"] = "..." # by default `py -3` on windows now
julia> ENV["PIP3"] = "..." # by default `py -3 -m pip` on windows now
julia> ENV["NODE"] = "..." # by default `node` on windows |
The second problem is fixed by #165. Example: https://tlienart.github.io/testproj/. You can already use this on master and specify in your
when using You can either specify that in the config (which is probably the most natural) or specify it when you call optimize or publish:
irrelevant of whether you use I hope this helps! your feedback would be much appreciated. |
Hi guys,
I am not sure if this is the right way to do it, so my apologies if I am wrong.
I made 2 modifications in the package that may be interesting:
On windows, I can only run python via
py -3
, so every time I built the package it said that python was not installed. I simply added a try forpy -3
on build.jl. It works here, and might solve this for some windows users (although this is not something that prevents people using the package, it might be handy and was really simple). I kept thepython3
because I guess this is how unix/osx calls python3. I think it might work in those systems, but I haven't tried it.Another change is on the
serve()
command: I added an option for a custom head.html. To understand why this is useful, it is not straight forward to generate a webpage for a repo - only for the user. I am using this package to write a small guide for economists using Julia (in portuguese, which is my native language and is far from complete). It took me a couple of hours to understand exactly what I had to change in order to this work, but I did.To make it work, the biggest problem was with head.html so it would get the files from the right address. Here is the modified head. However, this generated another problem: I could not serve it and take a look at the site, since the head.html was written to point to the right paths in github.
My solution was to create two head files, one for serving and one for publishing. Since I am publishing inside a docs folder in github, I don't use
publish()
. Therefore, I changedserve()
. I have tested it and it works, but I have not tested in another OS.I hope this can be useful for the package
Best regards