dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.06k stars 1.55k forks source link

Move SDK wiki docs in repo #54066

Open parlough opened 9 months ago

parlough commented 9 months ago

GitHub wiki's doesn't have a great workflow since only those with write access can edit it. There is also no review, which is admittedly less important since it is contributor facing docs, but contributor docs are important too and deserve to be thoughtfully considered and correct.

It's also separated from the rest of development, so updating them requires a separate step from landing a CL, and it's simply often forgotten. If you visit the SDK wiki now, there are some pages that don't make sense and others that are out of date.

To enable easier contribution and foster an environment where contribution docs are public, written, and maintained, we should consider moving them into the repository. These could be separated by team and/or project (like the VM docs now) and linked to from a central location or all centrally located, perhaps in the mostly untouched /docs folder or in a new /contributors folder.

GitHub's inline markdown viewing is generally sufficient, even with an autogenerated TOC and header anchors, but if desired/needed the docs could always be hosted on GitHub pages or consumed by dart.dev.

This migration could be completed incrementally, giving a chance to discard now irrelevant pages and update others as necessary.

To reduce contribution friction I would encourage this directory (if centrally located) would be excluded from any extra OWNERS requirements.


As a personal aside, I raise that building on this foundation and creating a culture of public documentation of both SDK contribution processes and SDK implementation details/internals has many benefits. I constantly hear about how much Dart user's love @mraleph's Introduction to Dart VM and how they want more documents like it. If we ever want to see Dart for Education succeed, the SDK will need to be better understood and approachable, and this is would be a helpful step towards that. šŸ’™

devoncarew commented 9 months ago

I did look at some of the options here when this came up on discord a few days ago. I see the downsides of the (current) wiki being:

They do have benefits in that they're discoverable and that they're easy for committers to update.

Some options for a replacement:

plain markdown files in an sdk directory

markdown files in the sdk, rendering to html via jekyll

This would convert the markdown files to html as a github action and serve them via github pages. We'd control the styling here and changes to the files would also go through code review. Some drawbacks:

markdown files in the repo, rendered to docusaurus

This is similar to the 2nd option but we'd render to docusaurus (see [docusaurus.io](https://docusaurus.io/ - a fairly polished documentation UI). Some drawbacks:

parlough commented 9 months ago

Thanks for adding your thoughts @devoncarew!

I think starting with 1. plain markdown files in an sdk directory makes the most sense, as the other two forms can always be built on top of that if it's deemed necessary. A structure would just need to be determined, probably based on someone migrating a few of the still relevant pages of the wiki.

As for some other concerns and ideas you raised:

(In referring to the wiki) They do have the benefits in that they're discoverable

That is true but with appropriate cross links from wherever relevant to the new location, in-repo markdown files should be quite discoverable too. In-repo markdown also has the benefit of being in the same search results as code on GitHub so users only have to search in one place, and the added benefit of now being searchable on Google Codesearch.

It also appears GitHub Enterprise allows repositories to add custom tabs, hopefully they enable that for github.com eventually. For now, the Wiki homepage could link to the new docs.

markdown files in the repo, rendered to docusaurus

I don't think the maintenance cost of pulling in Node and everything else that comes with this is worth it. If we want nicely rendered results, the docs should just be consumed by dart.dev and rendered there, just like Fuchsia does. That time could be spent improving dart.dev :)

repo getting started / contributing / maintenance docs

You mention this as the content. I do think that's the core, but I hope the structure decided on would support (and encourage) implementation/explanatory docs as well.

devoncarew commented 3 months ago

This is done now! We went with 'plain markdown files in an sdk directory', from above. All the files are now in https://github.com/dart-lang/sdk/tree/main/docs, and the old wiki (just link redirects at this point) is deprecated.

Many of the pages need review for freshness, and the main readme (https://github.com/dart-lang/sdk/tree/main/docs#readme) could likely use some updates wrt being a good, brief overview of the wiki contents.

parlough commented 2 months ago

@devoncarew Do you think we could rename all the docs to be lower-case-with-dashes.md or lower_case_with_underscores.md? The redirects from the wiki would have to be updated again, but I think the consistency will be really helpful and make the directory a bit more approachable.

devoncarew commented 2 months ago

We could, and lowercase would likely read better. We could also shorten file names, esp. if we categorized content into sub-directories.

Doing a one-time update of the old wiki pages (the forward pointers) to the new file names is doable and not too onerous. There are a few other places that have been updated to point to these markdown files (dart.dev/go/...); those links would break w/ case changes and other renames. We wouldn't want to do a rename like this more than necessary.

Not sure I have an opinion for dashes vs underscores; whichever is more common / familiar.