opral / monorepo

lix (change control system) && inlang (globalization ecosystem for software built on lix)
https://opral.com
Apache License 2.0
1.2k stars 102 forks source link

Improve Paraglide docs #1689

Closed NilsJacobsen closed 11 months ago

NilsJacobsen commented 11 months ago

from https://github.com/inlang/monorepo/issues/1667

Problem

Feedback from @KraXen72: "i am not sure if this is the relevant issue for it, but it took me an hour or two to figure the following things out:

@inlang/martketplace-infrastructure @inlang/paraglide-js

NilsJacobsen commented 11 months ago

I feel like we do need information when things happen under the hood. Maybe we can add collapsable element where we can go into detail without polluting the pages. What do you think?

LorisSigrist commented 11 months ago

A collapsible Element for an FAQ style section would be very convenient.

I'll rewrite the Docs to address the points listed above. (also the init command is supposed to add it as a devDependency, we might have a bug)

NilsJacobsen commented 11 months ago

If you need custom elements ping me or @flornkm we handle that so you should only work on the md file

flornkm commented 11 months ago

A collapsible Element for an FAQ style section would be very convenient.

This was proposed very often. @LorisSigrist how urgent is it to have this element / when do you plan to use it? @NilsJacobsen I can implement the element, that's fine

LorisSigrist commented 11 months ago

I don't need it urgently, I can do an FAQ by just listing out everything. It's more of a nice to have

KraXen72 commented 11 months ago

thank you guys <33

samuelstroschein commented 11 months ago

npx @inlang/paraglide-js@latest init

Prompts to run pnpm,npm, yarn install after completion. Seems like @KraXen72 overread this. Question: How can we make this more prominent?

i think the init script should automatically add an alias (vite or sveltekit alias, idk about other frameworks tho) to src/paraglide as something like $paraglide or @paraglide, and you should mention that this is an implicity created, invisible folder

Disagree. It opens a the box of pandora:

KraXen72 commented 11 months ago

understandable. however, atleast a few of the most popular bundlers could offer adding an alias. there are a lot of people using vite nowadays, and it supports asiases. or atleast mention how it all works, with the compiled paraglide directory or just mention in the docs that explain the file structure that you can easily add an alias in your bundler

now that i re-rad the init command in a test repo, it does indeed show that you should run install. but the paraglide-js dependency still gets added to dependencies (when using pnpm), instead of devDependencies - unless thats to be expected

LorisSigrist commented 11 months ago

The worry we have with automatically configuring aliases is that it would be a lot of technical complexity, and it would need to be purpose built for each bundler / framework causing a lot of work.

Expanding the documentation to better inform people about the output directory, and then suggest adding an alias is the way to go.

now that i re-rad the init command in a test repo, it does indeed show that you should run install. but the paraglide-js dependency still gets added to dependencies (when using pnpm), instead of devDependencies - unless thats to be expected

The fix for that is already merged and will be in the next prerelease You can safely move paraglide to devDependencies if you like

NilsJacobsen commented 11 months ago

@KraXen72 if you want you can leave feedback on the update of PR #1715

KraXen72 commented 11 months ago

left some feedback. it is a big improvement!

KraXen72 commented 11 months ago

very nice. however, i still thing there should be a link to auto-generated, latest API docs in https://inlang.com/m/gerre34r/library-inlang-paraglideJs#runtime

this looks pretty good: https://github.com/blakmatrix/vitepress-jsdoc

also, i found out you can literallly use jsdoc (the api documentation generator) by jsdoc (the github organization), who created jsdoc (the doc comments in js), to generate an api documentation site

https://github.com/jsdoc/jsdoc

another option would be something handrolled that nicely integrates into inlang.com. you can take a look at the dependencies of vitepress-jsdoc, but i think https://www.npmjs.com/package/jsdoc-to-markdown does most of the heavy lifting.

LorisSigrist commented 11 months ago

Agreed, auto-generating the docs would be nicer & more robust. We would need to do the work to integrate the auto-generated docs into the website, and in the meantime doing it manually is better than not having it :)

Definitely a nice-to have for the future!