DPS909/OSD600 Fall 2017 Lab 9

From CDOT Wiki
Revision as of 20:54, 29 December 2017 by Halshakhori1 (talk | contribs) (Submission)
Jump to: navigation, search

Introduction: Documenting Open Source

In this lab we will explore different techniques for documenting an open source project. One of the goals will be to learn more about authoring Markdown, as well as other areas where good documentation helps a project gain users and developers.

A big part of creating and maintaining an open source project is writing good documentation. There are many levels of documentation that people need, for example:

  • code comments: to explain design decisions, why certain choices were made (e.g., edge cases), references to other parts of the code or other projects.
  • README.md: to give users information on how to install and use a project, define APIs and the options one can use, give short examples. See https://guides.github.com/features/wikis/#creating-a-readme
  • CONTRIBUTING.md: to give developers information on how to contribute fixes or new code to the project, including info on how to setup the environment, how to run tests, coding conventions, etc.
  • CODE_OF_CONDUCT.md: a recent practice aimed at helping to establish norms and expectations for everyone in a project. See https://opensource.guide/code-of-conduct/ for more info.
  • examples/: a directory with example code to show how one might accomplish common tasks using the project
  • wikis: a place to put various types of other documentation, from help docs to sample code to instructions for doing various development/coding tasks. See https://guides.github.com/features/wikis/#creating-your-wiki
  • tests/: test code is often surprisingly good at also serving as technical documentation. When developers write tests, they are also communicating how they think their code should work, how APIs can be called, etc. Having good tests means also get some documentation for free.

In this lab, you will add documentation for your project from the code you wrote in Labs 6, 7, and 8.

Step 1. Add a README.md

GitHub will automatically render any Markdown (.md) it finds in a repo.

Start by reviewing GitHub's Markdown Guide, and familiarizing yourself with the various ways to do things in Markdown (e.g., links, images, lists, source code highlighting, etc.)

Next, create a README.md file in the root of your project, and start documenting your project. You should take a look at some good READMEs for ideas on how to structure yours. Also, checkout READMEs for projects written in the same language as your code, to get ideas on how people tend to document things in language X.

Here are some ideas to include:

  • Project title
  • Build status (e.g., see https://docs.travis-ci.com/user/status-images/)
  • Clear description of what it is, what it does, and if necessary what it isn't
  • Images, if applicable (e.g., screenshot, logo)
  • Table of contents, with links to different sections, so it's fast to jump around
  • Installation instructions for different environments
  • API documentation
  • Example code
  • FAQ, if necessary

There's no one right way to do this, and not every README needs to include everything.

Create your README.md file, add it to your repo, and push it up to GitHub.

Step 2. Add code comments

Audit your code (go back and read it all) and see where you need to add comments. There are a few types to consider:

  1. Comments to explain tricky bits of code, or why you decided to do something the way you did. If the code is self-explanatory, then it won't need a comment. If you have to think about it for a bit, you might consider adding a comment.
  2. Comments above functions, classes, etc. that provide API level docs. These could be in JavaDoc style, or whatever style your language uses for doing higher-level documentation embedded in your code. Here you can document function arguments and return types, possible error cases, and the purpose of APIs in general.
  3. TODO, HACK, XXX style comments help to point out places in the code where you know you have technical debt, and need to return and fix something later. Even better would be a bug you might file and then link to it in the comments.
  4. Any code you've borrowed from another project should be commented, and a link to the original and its license.

Make sure that your code is maintainable by you and others, and include enough documentation in the code to make it easy to understand. Always favour clarity over complexity, and be explicit vs. assuming too much prior knowledge. Imagine if you have to fix this code a year from now, what will you wish you still knew? Document that!

Step 3. Examples/ code

Add some example code to show people how to use your API. This can be different than a unit test, since you are showing a more real-world use case of how to interact with your code. You are trying to make it clear to someone looking at your code for the first time how they might use it. If there are common ways people will want to do that, add examples here. You don't have to jam everything into one example and over-complicate it. Do lots of little ones if that makes it easier.

Make sure you include links from your README to your examples/ code, so that people can find it easily.

Step 4. Get your docs reviewed

Ask another student in the class to review your project's documentation. Get them to look at everything you wrote above, and any other docs you decide to add, and see what suggestions they make. Fix any issues they find in your docs.

Submission

Please add your info to the table below. Include a blog post about the process above, what you learned, what you found interesting/new, what you got stuck on or found hard, and any other ideas you might have had while doing this. Did you know about Markdown before? What about the other forms of documentation? Are there any projects on GitHub you found that you thought were well documented? Why? What did your reviewer suggest when he/she looked at your docs?

# Name README.md (URL) Reviewed Repositories (URL) Blog Post (URL)
1 Dan Epstein https://github.com/Securter/FileInfoFinder/blob/master/README.md https://github.com/SeanPrashad/Fiffy/pull/13 http://www.danepstein.ca/the-importance-of-documenting-open-source-projects/
2 Marco Beltempo https://github.com/marcobeltempo/fileside/blob/master/README.md https://github.com/MPierre9/FileInfo https://www.marcobeltempo.com/open-source/tips-writing-readme/
3 Steven De Filippis https://github.com/St3v3n-D/file_info_lib/blob/master/README.md N/A https://dps909.defilippis.ca/index.php/2017/12/09/creating-fancy-readme-files-via-markdown-language/
4 Svitlana Galianova https://github.com/svitlana-galianova/FileInfo/blob/master/README.md https://github.com/jmrodriguesgoncalves/filepy/pull/1 http://svitlanagalianova.blogspot.ca/2017/12/proper-documentation-is-key-to-success.html
5 Earle White https://github.com/5earle/File_Info/blob/master/README.md N/A WIP
6 Michael Pierre https://github.com/MPierre9/FileInfo/blob/master/README.md https://github.com/MPierre9/FileInfo/issues/9 https://michaelpierreblog.wordpress.com/2017/12/04/learning-markdown-and-forming-a-proper-readme-md/
7 Fateh Sandhu https://github.com/Fatehsandhu/DPS-OpenSource/blob/master/README.md https://github.com/Fatehsandhu/DPS-OpenSource/pull/7 https://firefoxmacblog.wordpress.com/2017/12/27/readme-file/
8 Joao Rodrigues https://github.com/jmrodriguesgoncalves/filepy/blob/master/README.md https://github.com/svitlana-galianova/FileInfo/pull/9 https://jmrodriguesgoncalves.blogspot.ca/2017/12/lab-9-read-me.html
9 Anthony LoMagno https://github.com/ajlomagno/File-Info-Tool/blob/master/README.md N/A WIP
10 Sean Prashad https://github.com/SeanPrashad/Fiffy#fiffy-- https://github.com/Securter/FileInfoFinder/pull/2 https://medium.com/seanprashad/documentation-a-programmers-nightmare-279e2967fc42
11 Jay Yin https://github.com/jayyyin/python-filelib-thingy/blob/master/README.md http://jyopensource.blogspot.ca/2017/12/making-readmemd-file-in-my-github-repo.html
12 Jiel Selmani https://github.com/jselmani/Extractor/blob/master/README.md https://github.com/ericschv/node-extract-file-info https://www.jielselmani.me/blog/2017/12/5/good-documentation-great-project
13 Joshua Longhi https://github.com/Jlonghi/go-file-utils/blob/master/README.md WIP https://jlonghiblog.wordpress.com/2017/12/06/markdown/
14 Eric Schvartzman https://github.com/ericschv/node-extract-file-info https://github.com/jselmani/Extractor/pull/6
15 Marvin Sanchez https://github.com/msanchez5/DestinyFileIO https://marvinrsanchez.wordpress.com/markdown-your-readme
16 Mat Babol https://github.com/mmBabol/file-info/blob/master/README.md https://github.com/5earle/File_Info/pull/4 http://mmbabol.blogspot.ca/2017/12/learning-proper-documentation.html
17 Hans van den Pol https://github.com/HansvandenPol/FileFunctions/blob/master/README.md WIP https://opensourcetoronto.wordpress.com/2017/12/11/documentation-in-github/
18 Nicholas Krause https://github.com/xerofoify/Python-File-Utils/blob/master/README.md https://github.com/jayyyin/python-filelib-thingy https://wordpress.com/post/nicholas95com.wordpress.com/234
19 Phil Henning https://github.com/PhillypHenning/osd-lab11/blob/master/README.md https://github.com/ppatel221/xtractor https://bluesockphil.wordpress.com/2017/11/24/a-guide-to-creating-healthy-intelligent-test-driven-github-repositories-2/
20 Avedis Zeitounilian https://github.com/Avedis777/OpenSourceLabs/blob/master/README.md https://github.com/Fatehsandhu/DPS-OpenSource/pull/6 http://avedis777.blogspot.com/2017/12/documentation.html
21 Azusa Shimazaki https://github.com/azusaaz/WhatsTheFile/blob/master/README.md http://assmith2017.blogspot.ca/2017/12/documenting-open-source.html
22 Haoyu Yang https://github.com/feihaozi77/BuildingJSLibrary/blob/master/README.md http://haoyu1337.blogspot.ca/2017/12/documentation-in-opensource.html
23 Hadi Saeed https://github.com/HadiAlshakhori/Python/blob/master/README.md N/A https://techbreaksblog.wordpress.com/2017/12/30/how-to-make-your-github-readme-md-readable/
24 Parthkumar Patel https://github.com/ppatel221/xtractor/blob/master/README.md https://github.com/HadiAlshakhori/Python/pull/1 https://ppatel221.wordpress.com/2017/12/29/documentation-is-a-must/
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40