DEV Community

How to Manage Documentation in a GitHub Repository: A Guide for Junior Developers

Geoffrey Kim on February 18, 2024

Welcome to the world of development, where your code not only speaks for itself but also relies on well-crafted documentation to shine. For junior ...
Collapse
 
towkneed profile image
towkneed

In previous years, when I have used C# and .Net, I always used Sandcastle to generate MS-style documentation for my code. I would also use jsdoc for JavaScript and generate something roughly the same. Is there a location for this type of documentation, or is best practice to just use the markdown?

Collapse
 
mochafreddo profile image
Geoffrey Kim

Thank you for bringing up this great point about documentation generators! While Sandcastle and JSDoc are excellent tools for generating API documentation from code comments, GitHub repositories typically handle documentation in different layers:

  1. Code Documentation (API docs)

    • For .NET: Sandcastle, DocFX
    • For JavaScript: JSDoc, TypeDoc
    • These are great for detailed API reference documentation
  2. Repository Documentation (what my article focuses on)

    • Markdown files in the repo
    • More focused on high-level concepts, getting started guides, and project information
    • GitHub renders these beautifully and they're easily maintainable

You can actually use both approaches! A common pattern is:

  • Use markdown for repository-level documentation (README, CONTRIBUTING, etc.)
  • Generate API documentation using tools like Sandcastle/JSDoc
  • Host the generated API docs either:
    • On GitHub Pages (in a docs folder)
    • On a dedicated documentation hosting service (like Read the Docs)

This gives you the best of both worlds: easily maintainable markdown files for project documentation and comprehensive API documentation for developers.

Collapse
 
thumbone profile image
Bernd Wechner

Mildly disappointed but then I'm not a junior developer so that's on me 😉.

But the reason is that I clicked in hoping to find some mention of the ubiquitously encountered readthedocs documentation site that FOSS products and github projects lean on (because I've been too busy/lazy/distracted to bother looking into that myself yet - so a 2 minute primer on my feed would lure me).

Collapse
 
mochafreddo profile image
Geoffrey Kim

Absolutely, Bernd. Point taken about missing out on Read the Docs. It's a key piece for anyone in the FOSS and GitHub scene, for sure. Appreciate the nudge! We'll keep in mind to dive into those essential tools a bit more in the future. Thanks for the heads-up! 😉

Collapse
 
fullfull567 profile image
fullfull567

This is a great summary! Thank you!!

Collapse
 
mochafreddo profile image
Geoffrey Kim

Super glad you liked it. 😊 If there's anything else you're curious about, just shout. More cool stuff coming your way!

Collapse
 
fullfull567 profile image
fullfull567

Thanks for you kindness. I am a beginner. I'm still learning.