Skip to content
Merged
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
14 changes: 5 additions & 9 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,10 @@ jobs:
dune-cache: false # can cause trouble when generating melange docs in step below: https://github.com/ocaml/dune/issues/7720
- name: Install all deps
run: make install
- name: Generate melange docs in ml syntax
run: opam reinstall -y melange --with-doc
- name: Copy melange docs in ml syntax
run: cp -r _opam/.opam-switch/build/melange.dev/_build/default/_doc/_html docs/public/api/ml
- name: Generate melange docs in re syntax
run: ODOC_SYNTAX="re" opam reinstall -y melange --with-doc
- name: Copy melange docs in re syntax
run: cp -r _opam/.opam-switch/build/melange.dev/_build/default/_doc/_html docs/public/api/re
- name: Generate melange library docs for OCaml syntax
run: make pull-melange-docs SYNTAX=ml
- name: Generate melange library docs for Reason syntax
run: make pull-melange-docs SYNTAX=re
- name: Run canonical script
run: opam exec -- dune exec add_canonical docs/public/api
- name: Check Reason syntax
Expand All @@ -46,7 +42,7 @@ jobs:
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Fetch and checkout gh-pages
run: |
run: |
git fetch origin gh-pages --depth=1
git checkout gh-pages
- name: Copy published site into folder
Expand Down
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ node_modules
docs/.vitepress/cache
docs/.vitepress/dist
docs/public/playground
docs/public/api/ml
docs/public/api/re
docs/api/ml
docs/api/re

melange
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project_name = documentation-site

DUNE = opam exec -- dune

SYNTAX ?= ml
.DEFAULT_GOAL := help

.PHONY: help
Expand All @@ -13,7 +13,7 @@ help: ## Print this help message

.PHONY: create-switch
create-switch: ## Create opam switch
opam switch create . 5.3.0 -y --deps-only
opam switch create . 5.3.0 -y --deps-only --no-install

.PHONY: init
init: create-switch install ## Configure everything to develop this repository in local
Expand Down Expand Up @@ -82,3 +82,17 @@ dev: ## Start docs dev server
.PHONY: preview
preview: ## Preview the docs
yarn vitepress preview docs

.PHONY: pull-melange-docs
pull-melange-docs: ## Pull melange docs

if [ ! -d "melange" ]; then \
opam source melange.$$(opam show melange -f version) --dir melange; \
fi
ODOC_SYNTAX=$(SYNTAX) $(DUNE) build @doc-markdown
rm -rf docs/api/$(SYNTAX)
mkdir -p docs/api/$(SYNTAX)
cp -r _build/default/_doc/_markdown/melange docs/api/$(SYNTAX)/
# Keep only Js*, Belt*, Dom*, and Node* files (but exclude Js_parser)
cd docs/api/$(SYNTAX)/melange && find . -type f -name "Js_parser*.md" -delete
cd docs/api/$(SYNTAX)/melange && find . -type f -name "*.md" ! -name "Js*.md" ! -name "Belt*.md" ! -name "Dom*.md" ! -name "Node*.md" ! -name "index.md" -delete
Empty file removed docs/public/api/.gitkeep
Empty file.
21 changes: 10 additions & 11 deletions documentation-site.opam
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Melange documentation site"
description: "Content for the Melange documentation site"
Expand All @@ -11,25 +12,18 @@ authors: [
]
license: "MIT"
homepage: "https://github.com/melange-re/melange-re.github.io"
bug-reports: "https://github.com/melange-re/melange-re.github.io"
bug-reports: "https://github.com/melange-re/melange-re.github.io/issues"
depends: [
"ocaml"
"dune" {>= "3.8.0"}
"reason" {>= "3.13.0"}
"dune" {>= "3.8"}
"reason"
"reason-react"
"reason-react-ppx"
"ocamlformat"
"js_of_ocaml"
"cmarkit" {dev}
"melange" {dev} # needs to pin it to get the docs in a stable path
"melange-playground" {dev}
"ocaml-lsp-server" {dev}
]
dev-repo: "git+https://github.com/melange-re/melange-re.github.io.git"
pin-depends: [
[ "melange.dev" "git+https://github.com/melange-re/melange.git#973fa8d80c55ea31e468bae390da2200580ddda6" ]
[ "melange-playground.dev" "git+https://github.com/melange-re/melange.git#973fa8d80c55ea31e468bae390da2200580ddda6" ]
[ "cmarkit.dev" "git+https://github.com/dbuenzli/cmarkit.git#f37c8ea86fd0be8dba7a8babcee3682e0e047d91" ]
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
Expand All @@ -45,3 +39,8 @@ build: [
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/melange-re/melange-re.github.io.git"
pin-depends: [
["dune.dev" "git+https://github.com/davesnx/dune.git#e2e04ac9da46185268c50b73f702973b483ed139"]
["cmarkit.dev" "git+https://github.com/dbuenzli/cmarkit.git#f37c8ea86fd0be8dba7a8babcee3682e0e047d91"]
]
4 changes: 4 additions & 0 deletions documentation-site.opam.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pin-depends: [
["dune.dev" "git+https://github.com/davesnx/dune.git#08114d521b1d9b3c7323694aa785c218a1db2ae0"]
["cmarkit.dev" "git+https://github.com/dbuenzli/cmarkit.git#f37c8ea86fd0be8dba7a8babcee3682e0e047d91"]
]