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

Corelib links for rc1 #76

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions src/global/url.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,29 @@ let minor v =
| _ -> invalid_arg (v ^ ": invalid version")

let patch v =
match String.split_on_char '.' v with
| x :: y :: z :: _ -> x ^ "." ^ y ^ "." ^ z
| x :: y :: [] -> x ^ "." ^ y
| _ -> invalid_arg (v ^ ": invalid version")
let pre, version =
match String.split_on_char '.' v with
| x :: y :: z :: _ -> false, x ^ "." ^ y ^ "." ^ z
| x :: y :: [] ->
(match String.split_on_char '+' y with
| [] -> assert false
| [y] -> false, x ^ "." ^ y
| y :: _ -> true, x ^ "." ^ y)
| _ -> invalid_arg (v ^ ": invalid version")
in
if pre then "v" ^ version
else "V" ^ version

let v2 = "https://v2.ocaml.org"
let manual_with_version v = "/doc/V" ^ patch v ^ "/refman/index.html"
let manual_with_version v = "/doc/" ^ patch v ^ "/refman/index.html"
let manual = "/refman"
let stdlib_with_version v = "/doc/V" ^ patch v ^ "/stdlib/index.html"
let corelib_with_version v = "/doc/" ^ patch v ^ "/corelib/index.html"
let corelib = "/corelib"
let stdlib_with_version v = "/doc/" ^ patch v ^ "/stdlib/index.html"
let stdlib = "/stdlib"
let api_with_version v = "/doc/V" ^ patch v ^ "/api/index.html"
let stdlib_manual_with_version v = "/doc/" ^ patch v ^ "/refman-stdlib/index.html"
let stdlib_manual = "/refman-stdlib"
let api_with_version v = "/doc/" ^ patch v ^ "/api/index.html"
let api = "/api"
let books = "/books"
let changelog = "/changelog"
Expand Down
5 changes: 4 additions & 1 deletion src/rocqproverorg_frontend/pages/learn.eml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ Learn_layout.single_column_layout
<div class="flex flex-col gap-4 md:gap-6 md:w-80">
<%s! Hero_section.hero_button ~left_icon:(Icons.rocq "w-5 h-5") ~right_icon:(Icons.download "w-5 h-5") ~text:("Install Rocq Platform " ^ latest_platform_version)
~href:(Url.install) "" %>
<%s! Hero_section.hero_button ~left_icon:(Icons.book "w-5 h-5") ~right_icon:(Icons.link "w-5 h-5") ~text:("Standard Library") ~href:(Url.stdlib) "" %>
<%s! Hero_section.hero_button ~left_icon:(Icons.book "w-5 h-5") ~right_icon:(Icons.link "w-5 h-5") ~text:("Rocq Reference Manual") ~href:(Url.manual) "" %>
<%s! Hero_section.hero_button ~left_icon:(Icons.book "w-5 h-5") ~right_icon:(Icons.link "w-5 h-5") ~text:("Rocq Core Library API") ~href:(Url.corelib) "" %>
<%s! Hero_section.hero_button ~left_icon:(Icons.book "w-5 h-5") ~right_icon:(Icons.link "w-5 h-5") ~text:("Rocq OCaml API") ~href:(Url.api) "" %>
<%s! Hero_section.hero_button ~left_icon:(Icons.book "w-5 h-5") ~right_icon:(Icons.link "w-5 h-5") ~text:("Rocq Standard Library Manual") ~href:(Url.stdlib_manual) "" %>
<%s! Hero_section.hero_button ~left_icon:(Icons.book "w-5 h-5") ~right_icon:(Icons.link "w-5 h-5") ~text:("Rocq Standard Library API") ~href:(Url.stdlib) "" %>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/rocqproverorg_web/lib/middleware.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let language_manual_version next_handler request =
:: (("api" | "corelib" | "refman" | "stdlib" | "refman-stdlib") :: _ as
path) ->
let version = patch Release.latest in
"" :: "doc" :: ("V" ^ version) :: tweak_base path
"" :: "doc" :: version :: tweak_base path
| u -> u
in
if init_path = path then next_handler request
Expand Down
Loading