-
Notifications
You must be signed in to change notification settings - Fork 91
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
highlight.pack.js script removed after first build #153
Comments
This happens because I see several ways to solve this:
I suggest (3) because, in the future, odoc might need to output different sets of files depending on, for example, the theme. So, the implementation of If the contents of the directory are affected by theme or other conditions, it might need to be regenerated when the theme or other condition changes. I'm not sure, at this point, if this will necessarily be detectable by the build system. If not, we should probably go with (2). @dbuenzli, @rgrinberg, @rizo, what do you think? |
I think all the solutions are fine. Replying to each individual solution:
|
Personally, I prefer option 2. It is how the rest of odoc works, and it is the easiest option for build systems. Depending on the details of the build system "directory targets" can be awkward to implement in a way that is completely reliable and deterministic. |
I also would really prefer option 2, that's the way build system friendly tools work. |
Resolves #174. See also: #153 (comment)
Btw, one issue is that I'm not sure how it would work when composing odoc into builds that you'd like to generate docs for. The issue in this case is that dune would like to know the list of target statically. That is, without building anything. With odoc inside the build, this can no longer be done as dune will need to build odoc first. |
I noticed that Dune doesn't call |
Anyway, it seems that Dune would have to be able to stratify its build to use |
@diml, we are thinking to add What is your opinion on this? Is |
We wouldn't be able to use it straight away, as Dune doesn't support specifying dynamic targets. However, we are doing some work on the internals of Dune and we will eventually be able to support this. Currently we just assume that the output of odoc is a whole directory. |
In that case, I'll merge in |
@aantron Formally that's not an issue with |
Yes, I will do so after I open an issue in |
Resolves #174. See also: #153 (comment)
Opened ocaml/dune#1556. |
Currently when generating docs with dune (
dune build @doc
) the generated HTML uses thehighlight.pack.js
javascript library for syntax highlighting. This script is copied to_build/default/_doc/_html/
along withodoc.css
by theodoc/assets.ml/write
function.For some reason the second, and all consecutive builds, remove the
highlight.pack.js
file.To reproduce run the following in any dune-managed package:
I find this strange because both the css and the javascript files seem to be handled equally in odoc, but only the javascript file disappears.
The text was updated successfully, but these errors were encountered: