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

Rename latest to dev. #802

Merged
merged 1 commit into from
Aug 20, 2018
Merged

Rename latest to dev. #802

merged 1 commit into from
Aug 20, 2018

Conversation

fredrikekre
Copy link
Member

I think this might be easier to do before removing stable.

@fredrikekre
Copy link
Member Author

fredrikekre commented Aug 16, 2018

~25 packages uses the latest kwarg but since it is deprecated it will not be a hard break so should be fine. We can keep the deprecation around for some time.

@fredrikekre fredrikekre added this to the 0.20.0 milestone Aug 16, 2018
@fredrikekre
Copy link
Member Author

Result from running with this PR: https://fredrikekre.github.io/Literate.jl/stable/

@fredrikekre
Copy link
Member Author

Maybe call it devel by default? dev looks a bit short in the version selector from above.


osname = "linux",
julia = error("no 'julia' keyword provided."),

deps = Deps.pip("pygments", "mkdocs"),
make = () -> run(`mkdocs build`),

devbranch = "master",
devfolder = "dev",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "directory" is the technically more correct work here, over "folder". So devdir? devdirectory? Or even maybe devurl or devpath, since it's not even a directory here what we're setting, but the URL?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

devbranchurl 😛

documentation. By default this value is set to `"master"`.

**`devfolder`** the folder that in-development version of the docs will be deployed.
Defaults to `"dev"`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. this is now a breaking change, and will be somewhat chaotic for the users that their URLs suddenly change. Not sure how to handle it at the moment though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking how? I guess links to latest will break. But otherwise when packages build new docs they will deploy to dev and also get dev in the version selector, no?

We can insert a symlink from latest to dev I guess.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then we also have to remove the latest directory if it exists so idk.


# include stable first, and dev at the bottom
"stable" in all_folders && pushfirst!(folders, "stable")
"dev" in all_folders && push!(folders, "dev")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep "dev" at the top, since that's usually the one you want. At least as long as we have all the patch versions in the selector.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I'm planning to make this more customizable anyway, but will put at the top for now.

@mortenpi
Copy link
Member

As for dev vs devel: dev/ looks a bit better in the URL I'd say. As a hack we could print dev/ as "devel" or "development" in the version selector.

@fredrikekre
Copy link
Member Author

As for dev vs devel: dev/ looks a bit better in the URL I'd say. As a hack we could print dev/ as "devel" or "development" in the version selector.

Lets keep it as dev then, I'm planing to make this more customizable anyway, so people can change it if they don't like it.

@mortenpi
Copy link
Member

It's exactly the links I am worried about. This is a pretty big behaviour change I'd say and shouldn't happen silently if we can avoid it. OTOH, the whole point of 0.20.0 is to break backwards compatibility, so we should go forward with it. But we need to figure out what to do with the packages. I see two options at the moment:

  • As you suggested, have latest/ still be a symlink to dev/. This would only have to run once.
  • Do automated PRs to the whole ecosystem to fix Documenter to v0.19.
  • (Or a combination of both)

@fredrikekre fredrikekre force-pushed the fe/latest branch 2 times, most recently from f35fa1a to d1eafef Compare August 19, 2018 00:20
@fredrikekre
Copy link
Member Author

Ok, I am happy with this now. See https://fredrikekre.github.io/Literate.jl/stable/ where https://fredrikekre.github.io/Literate.jl/latest/ is symlinked to /dev.

)
# deprecation of latest kwarg (renamed to devbranch)
if latest !== nothing
Base.depwarn("The `latest` keyword argument have been renamed to `devbranch`.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"has been renamed"

if latest !== nothing
Base.depwarn("The `latest` keyword argument have been renamed to `devbranch`.")
devbranch = latest
latest = nothing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, just wanted this not to propagate.

# deprecation of latest kwarg (renamed to devbranch)
if latest !== nothing
Base.depwarn("The `latest` keyword argument have been renamed to `devbranch`.")
devbranch = latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One silly edge case: if the user defines both latest and devbranch simultaneously. Might be good to error here just in case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can know this, if the user have set devbranch to the defaul. I'll just add an @info here saying which branch we choose.

# symlink "latest" to devurl to preserve links (remove in some future release)
if devurl != "latest"
rm(joinpath(dirname, "latest"); recursive = true, force = true)
cd(dirname) do; symlink(devurl, "latest"); end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's print a huge warning here as well that we're creating this symlink.

Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to merge this as is. I might want to iterate on this a bit more at some point, but no need to hold this PR back.

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

Successfully merging this pull request may close these issues.

2 participants