Skip to content

Gleam Doc Comments into Javascript JsDoc #4597

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

Open
Kacaii opened this issue May 13, 2025 · 2 comments · May be fixed by #4611
Open

Gleam Doc Comments into Javascript JsDoc #4597

Kacaii opened this issue May 13, 2025 · 2 comments · May be fixed by #4611
Labels
help wanted Contributions encouraged priority:medium

Comments

@Kacaii
Copy link

Kacaii commented May 13, 2025

I would be nice to turn the /// doc comments above functions and modules into /** */ when exported to a Javascript target. That allows the documentation to be available when hovering the exported function.

Gleam

/// This is the Gleam version
pub fn add(a: Int, b: Int) -> Int {
  a + b
}

Javascript

/** This is the JS version */
export function add(a, b) {
  return a + b;
}
@lpil
Copy link
Member

lpil commented May 14, 2025

We do this on Erlang, seems good to have it in JS too!

P.S. GitHub has Gleam support, you can use gleam instead of ts for your codeblock and it'll highlight better

@lpil lpil added help wanted Contributions encouraged priority:medium labels May 14, 2025
@giacomocavalieri
Copy link
Member

I'd like to give this a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions encouraged priority:medium
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants