Skip to content
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

documentation at source{d} #84

Merged
merged 3 commits into from
Jan 15, 2018
Merged

documentation at source{d} #84

merged 3 commits into from
Jan 15, 2018

Conversation

campoy
Copy link
Contributor

@campoy campoy commented Jan 5, 2018

No description provided.

@campoy
Copy link
Contributor Author

campoy commented Jan 5, 2018

This is a first draft of the document on how to write documentation at source{d}
Please review and let me know what you all think.

There is no reason for your document to make assumptions on the reader's identity.

Avoid sexist connotations.
For instance, "mom-proof" implies mothers are not technical. Tell that to Grace Hopper.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually Grace Hopper never had children. Let's try also not to assume any woman is a mom ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point! replaced mothers with women
thanks :)


### CONTRIBUTING.md

This document describes what contributors should know in order to contribute to the project.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since there's probably a lot of common practices, would it be useful to have a standard org-wide CONTRIBUTING.md just ready to copy and paste for all new projects?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm, we have it: https://github.com/src-d/guide/blob/master/engineering/documents/CONTRIBUTING.md. Still think it'd be useful to mention it here, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should copy it around on every repo or simply link to it?
It seems a bit dangerous to simply copy things around in every repo tbh

What do you think, @mcuadros ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like copy things, but I was told that's the standard way.
Anyhow, I see two different parts in the CONTRIBUTING.md

  • general contributing guidelines, that could be linked or copied everywhere,
  • project instructions, like how to develop, run tests, run in development or even how to develop... that we sometimes put in the CONTRIBUTING.md instead of in the README.md

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The contributing file has custom parts, maybe half of it, so you need to having it on the repo. You can link to a more regeneral stuff, but at the end what I saw in other orgs, is that just simply copy the file, since doesn't change to much during the time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a reference to that file and added also a Template field on the reference section below.


### Code of Conduct

All projects under the source{d} organization should mention the Code of Conduct available
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be useful here to have a block of markdown you can just copy and paste in a README with the "we have a CoC and it's yada yada yada" and a link to the specific text (https://www.contributor-covenant.org/version/1/4/code-of-conduct.md)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done
also added .github/CODE_OF_CONDUCT.md as per https://help.github.com/articles/adding-a-code-of-conduct-to-your-project/

Should it be used in production? Is too soon, or maybe too late because it's been deprecated?

For tools, it is also worth including basic installation instructions.
If the instructions are long they should be part of a different document linked from this one.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And also maybe a script, docker or something should be provided.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great point, yes
done


### Release Notes

Every new release of your project should be versioned following semantic versioning principles.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following this guide, please include a link to semantive versioning principles. :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

### Release Notes

Every new release of your project should be versioned following semantic versioning principles.
Each new release should come with release notes. These notes are not a list of every single
Copy link
Contributor

@mcuadros mcuadros Jan 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but sometime expensive, its a realistic objetive?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not necessarily expensive. The notes are not exhaustive. Basically what's in the release that I might care about.

Now that we've covered how to write, let's talk about what to write.
This section lists the pieces of documentation we care about at source{d}.

### README.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A template will be great to have more homogoneus files, the same with CONTRIBUTING.md.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created one under documents

@mcuadros
Copy link
Contributor

mcuadros commented Jan 9, 2018

Excellent guide. Congratulations @campoy

Take that into account and try to add captions explaining the image where possible.
At least make usage of the `alt` attributes on HTML and markdown.

## Documentation Artifacts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issues are part of the articacts, include the templates. We need to document how to handle an issue, and also define a template or at least the rules to create one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we using issue templates anywhere already?
I know of them through github.com/golang/go

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I wantted to include here, about how create documentation from an issue, but maybe this is not the place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, I added a section on this too!


```
row of badgesyou might consider necessary.
Examples include:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it might be useful to include some actual examples of .md syntax with the badges, so people can just update it, instead of opening some other project and copying from there?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! I added a couple of examples taken from go-git

@bzz
Copy link
Contributor

bzz commented Jan 10, 2018

Guys after reading README template, I have few questions:

  1. Do we really expect to have Example of utilization section or do we expect each project to re-phrase it to something like Usage or Run, etc?
  2. As a developer, I find it very useful when readme includes a section on Development with at least a high-level description on how to build/test the project. As many of our projects are for developers, do you think it might be worth adding such thing near to the end? (With many be a link to CONTRIBUTING.md for excessive details)
  3. As a user, I find it very useful to have a Quickstart of TL;DR style of section that describes main usage in few lines, so a fist-time users can copy and run them immediately to accommodate their goal of trying out new things very quickly, before spending more time on reading/exploring it. Would that be something useful to have?
  4. One more thing that I find really useful - explicit statement about pre-requisites or runtime dependencies or assumptions about environement that the project has in order to be operational. Ideally those would have been incapsulated in Docker images, so a commands to start DB, a Queue, a Bblfsh, etc might be given, or, at worst, links to each dependency documentation can be provided. So user does not need to discover this though trail and errors, on trying to kickstart the process. What do you think?

On the other hand I know you're a developer, so there's no point explaining
what source code is. That would seem patronizing or a waste of time.

I also know that most of you don't speak English as a first language.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/most of you/most of us/ ?

Otherwise, together with I, might be perceived as a little bit.. well, alienating.
What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! 😄
done

@@ -0,0 +1,241 @@
# Documentation at source{d}

Our company has been a big believer on Open Source from very early on.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between "believe in" and "believe on"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently one believes on god, but in other things ... so fixed


### Release Notes

Every new release of your project should be versioned following [semantic versioning principles](https://semver.org/).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it play with Golang? go-git.v4 spans for one year :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was following the semvers, since you had the RCs, but yes, wasn't a good example of semver

@@ -0,0 +1,53 @@
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also maybe we can provid guides for format, like witch headers, should be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the headers that appear on this list are the ones I'd like people to use

# Project Name being the first one


# Example of utilization

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some langauages we should define the style of the examples, for example in go, the example should be from a extnernal point of view (good), or for a internal point of view of the library (bad). Because some example doesn't include the package name for the symbols of the package on the example, because are code from a example in the package, and then you can't copy paste it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Copy link
Contributor

@dpordomingo dpordomingo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! you did an awesome work (we needed it a lot), thanks!

Since we're trying to improve the documentation and our projects itself, and having a homogeneous structure benefits the developer experience (as I could understand from comment#r160391444), why not offering a project skeleton. I think it would ensure that all our projects follow our requirements?

I'd suggest:

engineering/project-skeleton/
├── .github
│   ├── CODE_OF_CONDUCT.md
│   ├── CONTRIBUTING.tpl.md
│   ├── ISSUE_TEMPLATE
│   └── PULL_REQUEST_TEMPLATE
├── DCO
├── LICENSE.apache
├── LICENSE.gpl
├── MAINTAINERS
└── README.tmpl.md

TL;DR:
- Audience: Everyone.
- Content: Description of the project and its current state. Links to other resources.
- Example: https://github.com/twbs/bootstrap/blob/v4-dev/README.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an example to follow? It seems it does not follow your template, nor sections.
What if we link to one of our README?
(example: https://github.com/src-d/go-git/blob/master/README.md)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an example, this is a quick reference for README.md
Every kind of document has one.


### CONTRIBUTING.md

This document describes what contributors should know in order to contribute to the project.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like copy things, but I was told that's the standard way.
Anyhow, I see two different parts in the CONTRIBUTING.md

  • general contributing guidelines, that could be linked or copied everywhere,
  • project instructions, like how to develop, run tests, run in development or even how to develop... that we sometimes put in the CONTRIBUTING.md instead of in the README.md

Examples of these include code coverage requirements, adopted unit testing frameworks,
and documentation conventions.

A very good example of `CONTRIBUTING.md` is the one from [angular.js](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd link here a template, as you did in the README section
documents/CONTRIBUTING.md

TL;DR:
- Audience: Contributors.
- Content: Steps necessary to modify the project, verify the changes, and contribute back to the project.
- Example: https://github.com/angular/angular.js/blob/master/README.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

links to a [README.md]; anyhow: what if we link one of ours?
(example: https://github.com/bblfsh/dashboard/blob/master/CONTRIBUTING.md)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a link to the CONTRIBUTING.md in the guide

Short description of the project.
Should mention the kind of project this is (library, demo, tool, etc.) and
the current [stability status](https://www.npmjs.com/package/stability-badges).
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For apps having visual interface, it would be useful to have a screenshot (like in bblfsh/dashboard) or a recorded cli session (as in sqle/gitquery)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added


# Contribute

[Contributions](https://github.com/src-d/{project}/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) are more than welcome, if you are interested please take a look to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the filter applied really worths; could it be only the link to the issues tab?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, I got this from go-git but I don't have strong feelings about it.
I'll remove it.

# Contribute

[Contributions](https://github.com/src-d/{project}/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) are more than welcome, if you are interested please take a look to
our [Contributing Guidelines](CONTRIBUTING.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our first CONTRIBUTING.md didn't include info about how to develop, run tests... and I didn't expect to find that info over there. I think it makes sense to put such info in the CONTRIBUTING.md but we should maybe say so in the README.md to inform our visitors (as we tried at snippet-search or bblfsh/dashboard)

Copy link
Contributor

@bzz bzz Jan 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was one of the questions I tried to rise in #84 (comment) as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each project is different, but yes, it is part of the things CONTRIBUTING.md should cover (as mentioned in documentation.md)


# License

Apache License Version 2.0, see [LICENSE](LICENSE).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is proposed as a template, I'd add our two options for licenses, and a link to the guide/engineering/licensing.md#licence

  • GPL v3.0, for core parts
  • Apache License 2.0, for libraries/tools that intended to be consumed by third-parties

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@@ -0,0 +1,241 @@
# Documentation at source{d}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc is huge with a lot of useful resources.
Do you think a TOC would help the reader what can be found here?
I see the following:

  • General Best Practices
    • State a clear goal
    • Define a scope
    • Don't alienate the reader
    • Take accessibility in mind
  • Documentation Artifacts
    • README.md
    • CONTRIBUTING.md
    • Reference material
    • Release Notes
    • Issues, PullRequests, Improvement Proposals...
    • Guides/Tutorials
    • Code of Conduct
    • Other pieces documentation
  • Resources

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm happy to add the TOC once the content has been agreed on.

In general, if someone would find what you wrote offensive it's time to change it.
There's no excuse to offend anyone in a technical document.

### Take accessibility in mind
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@campoy I'll comment further on this matter, nevertheless, one classic accessibility best practice is to avoid having links like: "you can find something here" or "more about something" or even "download the latest something". The reason is because a common use-case for visual-impair people is to use screen-readers in a way to go over links, and as you have probably guessed what they will hear will be here, more and download without context. So I would recommend to shorten links but be as explicit/descriptive as possible. You can read more about descriptivelinks here.


For more extreme cases the user will not be able to see the image at all.
Take that into account and try to add captions explaining the image where possible.
At least make usage of the `alt` attributes on HTML and markdown.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@campoy There are images that are complex to describe with an alt attribute, like some data visualisations. We can aim - maybe @dpordomingo can help how to do this in markdown - to make complex images as usable and accessible as possible. There are some techniques to improve accessibility on complex images.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's why I say "at least". An alt attribute doesn't solve the problem but at least can tell the reader whether the image is relevant or just a logo.

@campoy
Copy link
Contributor Author

campoy commented Jan 11, 2018

OK, I sent a bunch of updates and I feel this starts to look quite decent!

Thanks all for your help 👍

Copy link
Contributor

@dpordomingo dpordomingo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said, it looks great to me.
(there are some things that could be improved, but since it can be proposed/studied via issues, I'll not block the merge because of that)

Copy link
Member

@eiso eiso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving because all relevant comments (that were on my mind) have been mentioned already and I see they're being incorporated in the doc.

@eiso
Copy link
Member

eiso commented Jan 11, 2018

@bzz just want to give a +1 on your 4 points, especially on the quick start section (minor feedback @bzz, if you make your general review a comment on a line; it's not as clean, but easier to have a threaded discussion).

@campoy
Copy link
Contributor Author

campoy commented Jan 11, 2018

+1 on having comments in line, it's easy to miss the comments made in the conversation

@@ -0,0 +1,89 @@
![logo if any exists](path/to/logo)
Copy link
Contributor Author

@campoy campoy Jan 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding comment from @bzz here to keep track of it

Guys after reading README template, I have few questions:

  1. Do we really expect to have Example of utilization section or do we expect each project to re-phrase it to something like Usage or Run, etc?

  2. As a developer, I find it very useful when readme includes a section on Development with at least a high-level description on how to build/test the project. As many of our projects are for developers, do you think it might be worth adding such thing near to the end? (With many be a link to CONTRIBUTING.md for excessive details)

  3. As a user, I find it very useful to have a Quickstart of TL;DR style of section that describes main usage in few lines, so a fist-time users can copy and run them immediately to accommodate their goal of trying out new things very quickly, before spending more time on reading/exploring it. Would that be something useful to have?

  4. One more thing that I find really useful - explicit statement about pre-requisites or runtime dependencies or assumptions about environement that the project has in order to be operational. Ideally those would have been incapsulated in Docker images, so a commands to start DB, a Queue, a Bblfsh, etc might be given, or, at worst, links to each dependency documentation can be provided. So user does not need to discover this though trail and errors, on trying to kickstart the process. What do you think?

Copy link
Contributor Author

@campoy campoy Jan 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your points @bzz!

  1. I think "Example of utilization" is good, but not necessarily the best. So up to the maintainer of the project to use whatever they feel like.

  2. I think the build/test instructions could be part of the "Example of utilization" section if it's simple enough. If not I'd probably simply have a link to "building from source code". Most people will use Docker or aptitude packages when available.

  3. This is exactly the kind of context I expect to see in the "Example of utilization" for tools. Something like make build; cmd foo bar

  4. I would expect these requirements to be part of the installation instructions yeah. See line 46 for this. Maybe I should make it more obvious?

Copy link
Contributor

@bzz bzz Jan 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Sounds great. Do you think it may be worth to articulate that somehow in there that it's acceptable to have short build commands in that section?

  2. From my experience, indeed it's totally worth to go extra mile here and make it painfully obvious

@campoy
Copy link
Contributor Author

campoy commented Jan 12, 2018

Applied @bzz's feedback. I think I just need @mcuadros's approval to be able to merge

@mcuadros mcuadros merged commit 0cfbbd8 into src-d:master Jan 15, 2018
@eiso
Copy link
Member

eiso commented Jan 15, 2018

Glad to see this merged, can you please make a PR to the README with a link (and possibly add a README to the documentation folder with a ToC to these files)

@campoy
Copy link
Contributor Author

campoy commented Jan 16, 2018

There you have it: #96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants