SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
Docathon
How to write (good) documentation
Thanks to our
sponsors!
Why documentation?
“Documentation is important because it's one of the first connections
between the human world and the machine world. It helps us effectively
translate our concepts and ideas into the languages that we use to control
machines. “
Why documentation?
● For you you will be using your code in 6 months.
● For users you want people to use your code
○ Shows your project exists.
○ Shows how to install it.
○ Shows how to use it.
● For contributors you want people to help out
○ You only have contributors once you have users.
○ Documentation provides a platform for your first contributions.
Different types of documentation
● Literal documentation
○ Installation instructions
○ User documentation
○ Contributor documentation
● API documentation
○ What does a function do?
○ How do I use it? What are the arguments I need to provide? What are the default values?
● Examples and galleries
○ How can I put all the pieces together to form a script or a program?
● Tutorials/Guides
○ Use the tools in a package to cover topics in a particular field.
● FAQ/stackoverflow
Different formats of documentation
● HTML documentation
○ Website usually with literal, API and gallery/examples documentation
○ Stack overflow
● PDF documentation
○ Equivalent of website, but downloadable.
○ Usually doesn’t include the API
● Interactive documentation
○ Python
■ >>> help(my_function)
○ R
■ > help(limma)
■ > ?limma
What type of documentation do people use?
What format of documentation do people use?
Which type of documentation is most often neglected?
Examples of well documented projects
● Python
○ Scikit-learn
○ numpy
○ Django
○ Mne
○ nilearn
● R
○ ggplot2
○ caret
○ shiny
○ rcpp
Key elements to think about when writing documentation
Rule n°1: Documentation is like code : it needs to be maintained
● Favor quality over quantity
● All examples in the documentation should run automatically.
Key elements to think about when writing documentation
Rule n°2: “If it is not documented, it does not exist”
● Write documentation as you write code.
● Documentation driven development.
Key elements to think about when writing documentation
Rule n°3: Documentation is about communication
● Who is your audience?
● How to organize your ideas?
● Visual communication…
Documentation in practice
Tools, guidelines and next steps for improving documentation
Tools for documentation
● Literal documentation
○ Python
■ Sphinx
■ Doctest
○ R
■ Knitr & LaTeX (pdf)
■ Knitr & R-markdown (html & pdf)
● API documentation
○ Python
■ Docstrings (numpydoc)
■ Doctest
○ R
■ Help files
■ roxygen
● Examples and galleries
○ Python
■ Sphinx-gallery
○ R
■ N/A
Project manager : Where to start?
1. A README file with a brief description of the project & installation instructions
2. (A licence)
3. A short example/tutorial
4. API documentation
5. Link to code, issue tracker and mailing list if applicable
6. Literal documentation
7. Contributor documentation
New contributor : Where to start?
1. Familiarize yourself with the project
○ Read the tutorial
○ Read the user documentation
○ Read the contributor documentation
○ Is anything unclear? Are there typos or english mistakes?
2. Improve docstrings
○ Of functions
○ Of Examples
3. Find tickets labeled “Documentation”
How to get users to contribute documentation?
1. Think about your contribution workflow?
○ Can users install your package easily? Is the package publicly available?
○ Can users contribute easily?
2. Make sure users can get started
○ Write a brief tutorial
○ Write a couple of examples
3. Where are the pain points of your documentation?
○ Create documentation specific tickets and label them clearly as documentation-related.
4. Write a short “how to contribute” guide.
5. Don’t be too nitpicky about documentation patches!
○ Is the patch an improvement? Yes? Just push the green button.
Let’s get started!
The end…

Contenu connexe

Tendances

Presentation joining processes
Presentation joining processesPresentation joining processes
Presentation joining processesR G Sanjay Prakash
 
Considering part orientation in design for additive manufacturing
Considering part orientation in design for additive manufacturingConsidering part orientation in design for additive manufacturing
Considering part orientation in design for additive manufacturingPhuong Dx
 
09 technical report
09 technical report09 technical report
09 technical reportNikhil Joshi
 
Technical comunication
Technical comunicationTechnical comunication
Technical comunicationGulfam Hussain
 
models of e publishing
models of e publishingmodels of e publishing
models of e publishingEssam Obaid
 
Design for manufacturing and assembly (DFMA) Presentation
Design for manufacturing and assembly (DFMA) PresentationDesign for manufacturing and assembly (DFMA) Presentation
Design for manufacturing and assembly (DFMA) PresentationAli Karandish
 
Writing an engineering technical report
Writing an engineering technical reportWriting an engineering technical report
Writing an engineering technical reportMuhammad Shorrab
 
Design for manufacture_and_assembly
Design for manufacture_and_assemblyDesign for manufacture_and_assembly
Design for manufacture_and_assemblyR PANNEER
 
product design (managment)
product design (managment)product design (managment)
product design (managment)Hafis Puzhakkal
 
Discussion Director Sheet
Discussion Director SheetDiscussion Director Sheet
Discussion Director Sheetmoran23
 

Tendances (11)

Presentation joining processes
Presentation joining processesPresentation joining processes
Presentation joining processes
 
Considering part orientation in design for additive manufacturing
Considering part orientation in design for additive manufacturingConsidering part orientation in design for additive manufacturing
Considering part orientation in design for additive manufacturing
 
09 technical report
09 technical report09 technical report
09 technical report
 
Technical comunication
Technical comunicationTechnical comunication
Technical comunication
 
models of e publishing
models of e publishingmodels of e publishing
models of e publishing
 
Design for manufacturing and assembly (DFMA) Presentation
Design for manufacturing and assembly (DFMA) PresentationDesign for manufacturing and assembly (DFMA) Presentation
Design for manufacturing and assembly (DFMA) Presentation
 
Writing an engineering technical report
Writing an engineering technical reportWriting an engineering technical report
Writing an engineering technical report
 
Design for manufacture_and_assembly
Design for manufacture_and_assemblyDesign for manufacture_and_assembly
Design for manufacture_and_assembly
 
Plastics(srinivas)
Plastics(srinivas)Plastics(srinivas)
Plastics(srinivas)
 
product design (managment)
product design (managment)product design (managment)
product design (managment)
 
Discussion Director Sheet
Discussion Director SheetDiscussion Director Sheet
Discussion Director Sheet
 

En vedette (17)

Mediation analysis
Mediation analysisMediation analysis
Mediation analysis
 
Huruf vokal
Huruf vokalHuruf vokal
Huruf vokal
 
Children's book
Children's bookChildren's book
Children's book
 
Benami properties Act
Benami properties ActBenami properties Act
Benami properties Act
 
Project loon
Project loonProject loon
Project loon
 
The Trouble with Open Source Software
The Trouble with Open Source SoftwareThe Trouble with Open Source Software
The Trouble with Open Source Software
 
Gdz informatika rivkind_2014
Gdz informatika rivkind_2014Gdz informatika rivkind_2014
Gdz informatika rivkind_2014
 
FT Bootcamp2 - 19/04/13 - Fernandez
FT Bootcamp2 - 19/04/13 - FernandezFT Bootcamp2 - 19/04/13 - Fernandez
FT Bootcamp2 - 19/04/13 - Fernandez
 
Generalidades del emprendimiento
Generalidades del emprendimientoGeneralidades del emprendimiento
Generalidades del emprendimiento
 
Presentación1 (2)
Presentación1 (2)Presentación1 (2)
Presentación1 (2)
 
Problematica social en colombia
Problematica social en colombiaProblematica social en colombia
Problematica social en colombia
 
Actividades MJC Marzo
Actividades MJC MarzoActividades MJC Marzo
Actividades MJC Marzo
 
Ventajas y desventajas web 2
Ventajas y desventajas web 2Ventajas y desventajas web 2
Ventajas y desventajas web 2
 
Presentación duránn
Presentación duránnPresentación duránn
Presentación duránn
 
Estacion esperanza
Estacion esperanzaEstacion esperanza
Estacion esperanza
 
Presentacion redes sociales
Presentacion redes socialesPresentacion redes sociales
Presentacion redes sociales
 
VICTIMIZACION 3
VICTIMIZACION 3VICTIMIZACION 3
VICTIMIZACION 3
 

Similaire à Docathon: How to write (good) documentation

Navigating Python: Milestones from Essential Reads
Navigating Python: Milestones from Essential ReadsNavigating Python: Milestones from Essential Reads
Navigating Python: Milestones from Essential ReadsTakayuki Shimizukawa
 
A Comprehensive Guide of Python Final Year Projects with Source Code.pdf
A Comprehensive Guide of Python Final Year Projects with Source Code.pdfA Comprehensive Guide of Python Final Year Projects with Source Code.pdf
A Comprehensive Guide of Python Final Year Projects with Source Code.pdfjagan477830
 
Python Programming Introduction For Students
Python Programming Introduction For StudentsPython Programming Introduction For Students
Python Programming Introduction For StudentsShaunakBale1
 
apidays LIVE Paris 2021 - Who writes the Docs? by Laura Vass, Pronovix
apidays LIVE Paris 2021 - Who writes the Docs? by Laura Vass, Pronovixapidays LIVE Paris 2021 - Who writes the Docs? by Laura Vass, Pronovix
apidays LIVE Paris 2021 - Who writes the Docs? by Laura Vass, Pronovixapidays
 
Getting started contributing to Apache Spark
Getting started contributing to Apache SparkGetting started contributing to Apache Spark
Getting started contributing to Apache SparkHolden Karau
 
DockerCon US 2016 - Scaling Open Source operations
DockerCon US 2016 - Scaling Open Source operationsDockerCon US 2016 - Scaling Open Source operations
DockerCon US 2016 - Scaling Open Source operationsArnaud Porterie
 
Is it a Package or a Wrapper? Designing, Documenting, and Distributing a Pyth...
Is it a Package or a Wrapper? Designing, Documenting, and Distributing a Pyth...Is it a Package or a Wrapper? Designing, Documenting, and Distributing a Pyth...
Is it a Package or a Wrapper? Designing, Documenting, and Distributing a Pyth...Azavea
 
Getting Started Contributing to Apache Spark – From PR, CR, JIRA, and Beyond
Getting Started Contributing to Apache Spark – From PR, CR, JIRA, and BeyondGetting Started Contributing to Apache Spark – From PR, CR, JIRA, and Beyond
Getting Started Contributing to Apache Spark – From PR, CR, JIRA, and BeyondDatabricks
 
Open Source Tools for Libraries
Open Source Tools for LibrariesOpen Source Tools for Libraries
Open Source Tools for LibrariesNicole C. Engard
 
Python Django Basics
Python Django BasicsPython Django Basics
Python Django BasicsRahilMemon5
 
Kickstarting career as an Android developer.pdf
Kickstarting career as an Android developer.pdfKickstarting career as an Android developer.pdf
Kickstarting career as an Android developer.pdfShreyaDhurde
 
Markdown - friend or foe?
Markdown - friend or foe?Markdown - friend or foe?
Markdown - friend or foe?Ellis Pratt
 
DevOps practices and tools of a small company in love with open source
DevOps practices and tools of a small company in love with open sourceDevOps practices and tools of a small company in love with open source
DevOps practices and tools of a small company in love with open sourceFrancesco Chicchiriccò
 
Services, tools & practices for a software house
Services, tools & practices for a software houseServices, tools & practices for a software house
Services, tools & practices for a software houseParis Apostolopoulos
 
Python programming ppt.pptx
Python programming ppt.pptxPython programming ppt.pptx
Python programming ppt.pptxnagendrasai12
 
Python in Industry
Python in IndustryPython in Industry
Python in IndustryDharmit Shah
 
BUD17-TR01: Philosophy of Open Source
BUD17-TR01: Philosophy of Open SourceBUD17-TR01: Philosophy of Open Source
BUD17-TR01: Philosophy of Open SourceLinaro
 

Similaire à Docathon: How to write (good) documentation (20)

Navigating Python: Milestones from Essential Reads
Navigating Python: Milestones from Essential ReadsNavigating Python: Milestones from Essential Reads
Navigating Python: Milestones from Essential Reads
 
A Comprehensive Guide of Python Final Year Projects with Source Code.pdf
A Comprehensive Guide of Python Final Year Projects with Source Code.pdfA Comprehensive Guide of Python Final Year Projects with Source Code.pdf
A Comprehensive Guide of Python Final Year Projects with Source Code.pdf
 
Python Programming Introduction For Students
Python Programming Introduction For StudentsPython Programming Introduction For Students
Python Programming Introduction For Students
 
apidays LIVE Paris 2021 - Who writes the Docs? by Laura Vass, Pronovix
apidays LIVE Paris 2021 - Who writes the Docs? by Laura Vass, Pronovixapidays LIVE Paris 2021 - Who writes the Docs? by Laura Vass, Pronovix
apidays LIVE Paris 2021 - Who writes the Docs? by Laura Vass, Pronovix
 
Getting started contributing to Apache Spark
Getting started contributing to Apache SparkGetting started contributing to Apache Spark
Getting started contributing to Apache Spark
 
DockerCon US 2016 - Scaling Open Source operations
DockerCon US 2016 - Scaling Open Source operationsDockerCon US 2016 - Scaling Open Source operations
DockerCon US 2016 - Scaling Open Source operations
 
Is it a Package or a Wrapper? Designing, Documenting, and Distributing a Pyth...
Is it a Package or a Wrapper? Designing, Documenting, and Distributing a Pyth...Is it a Package or a Wrapper? Designing, Documenting, and Distributing a Pyth...
Is it a Package or a Wrapper? Designing, Documenting, and Distributing a Pyth...
 
Create your library
Create your libraryCreate your library
Create your library
 
Getting Started Contributing to Apache Spark – From PR, CR, JIRA, and Beyond
Getting Started Contributing to Apache Spark – From PR, CR, JIRA, and BeyondGetting Started Contributing to Apache Spark – From PR, CR, JIRA, and Beyond
Getting Started Contributing to Apache Spark – From PR, CR, JIRA, and Beyond
 
Open Source Tools for Libraries
Open Source Tools for LibrariesOpen Source Tools for Libraries
Open Source Tools for Libraries
 
Python Django Basics
Python Django BasicsPython Django Basics
Python Django Basics
 
Kickstarting career as an Android developer.pdf
Kickstarting career as an Android developer.pdfKickstarting career as an Android developer.pdf
Kickstarting career as an Android developer.pdf
 
Markdown - friend or foe?
Markdown - friend or foe?Markdown - friend or foe?
Markdown - friend or foe?
 
DevOps practices and tools of a small company in love with open source
DevOps practices and tools of a small company in love with open sourceDevOps practices and tools of a small company in love with open source
DevOps practices and tools of a small company in love with open source
 
Tech-Writing-101
Tech-Writing-101Tech-Writing-101
Tech-Writing-101
 
PYTHON UNIT 1
PYTHON UNIT 1PYTHON UNIT 1
PYTHON UNIT 1
 
Services, tools & practices for a software house
Services, tools & practices for a software houseServices, tools & practices for a software house
Services, tools & practices for a software house
 
Python programming ppt.pptx
Python programming ppt.pptxPython programming ppt.pptx
Python programming ppt.pptx
 
Python in Industry
Python in IndustryPython in Industry
Python in Industry
 
BUD17-TR01: Philosophy of Open Source
BUD17-TR01: Philosophy of Open SourceBUD17-TR01: Philosophy of Open Source
BUD17-TR01: Philosophy of Open Source
 

Dernier

My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Baileyhlharris
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIINhPhngng3
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatmentnswingard
 
Zone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptxZone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptxlionnarsimharajumjf
 
Introduction to Artificial intelligence.
Introduction to Artificial intelligence.Introduction to Artificial intelligence.
Introduction to Artificial intelligence.thamaeteboho94
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...ZurliaSoop
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoKayode Fayemi
 
Digital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalDigital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalFabian de Rijk
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfSkillCertProExams
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar TrainingKylaCullinane
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityHung Le
 
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdfSOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdfMahamudul Hasan
 
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...David Celestin
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...amilabibi1
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lodhisaajjda
 

Dernier (17)

My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait Cityin kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
 
Zone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptxZone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptx
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
Introduction to Artificial intelligence.
Introduction to Artificial intelligence.Introduction to Artificial intelligence.
Introduction to Artificial intelligence.
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
Digital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalDigital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of Drupal
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
 
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdfSOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
 
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 

Docathon: How to write (good) documentation

  • 1. Docathon How to write (good) documentation
  • 3. Why documentation? “Documentation is important because it's one of the first connections between the human world and the machine world. It helps us effectively translate our concepts and ideas into the languages that we use to control machines. “
  • 4. Why documentation? ● For you you will be using your code in 6 months. ● For users you want people to use your code ○ Shows your project exists. ○ Shows how to install it. ○ Shows how to use it. ● For contributors you want people to help out ○ You only have contributors once you have users. ○ Documentation provides a platform for your first contributions.
  • 5. Different types of documentation ● Literal documentation ○ Installation instructions ○ User documentation ○ Contributor documentation ● API documentation ○ What does a function do? ○ How do I use it? What are the arguments I need to provide? What are the default values? ● Examples and galleries ○ How can I put all the pieces together to form a script or a program? ● Tutorials/Guides ○ Use the tools in a package to cover topics in a particular field. ● FAQ/stackoverflow
  • 6. Different formats of documentation ● HTML documentation ○ Website usually with literal, API and gallery/examples documentation ○ Stack overflow ● PDF documentation ○ Equivalent of website, but downloadable. ○ Usually doesn’t include the API ● Interactive documentation ○ Python ■ >>> help(my_function) ○ R ■ > help(limma) ■ > ?limma
  • 7. What type of documentation do people use?
  • 8. What format of documentation do people use?
  • 9. Which type of documentation is most often neglected?
  • 10. Examples of well documented projects ● Python ○ Scikit-learn ○ numpy ○ Django ○ Mne ○ nilearn ● R ○ ggplot2 ○ caret ○ shiny ○ rcpp
  • 11. Key elements to think about when writing documentation Rule n°1: Documentation is like code : it needs to be maintained ● Favor quality over quantity ● All examples in the documentation should run automatically.
  • 12. Key elements to think about when writing documentation Rule n°2: “If it is not documented, it does not exist” ● Write documentation as you write code. ● Documentation driven development.
  • 13. Key elements to think about when writing documentation Rule n°3: Documentation is about communication ● Who is your audience? ● How to organize your ideas? ● Visual communication…
  • 14. Documentation in practice Tools, guidelines and next steps for improving documentation
  • 15. Tools for documentation ● Literal documentation ○ Python ■ Sphinx ■ Doctest ○ R ■ Knitr & LaTeX (pdf) ■ Knitr & R-markdown (html & pdf) ● API documentation ○ Python ■ Docstrings (numpydoc) ■ Doctest ○ R ■ Help files ■ roxygen ● Examples and galleries ○ Python ■ Sphinx-gallery ○ R ■ N/A
  • 16. Project manager : Where to start? 1. A README file with a brief description of the project & installation instructions 2. (A licence) 3. A short example/tutorial 4. API documentation 5. Link to code, issue tracker and mailing list if applicable 6. Literal documentation 7. Contributor documentation
  • 17. New contributor : Where to start? 1. Familiarize yourself with the project ○ Read the tutorial ○ Read the user documentation ○ Read the contributor documentation ○ Is anything unclear? Are there typos or english mistakes? 2. Improve docstrings ○ Of functions ○ Of Examples 3. Find tickets labeled “Documentation”
  • 18. How to get users to contribute documentation? 1. Think about your contribution workflow? ○ Can users install your package easily? Is the package publicly available? ○ Can users contribute easily? 2. Make sure users can get started ○ Write a brief tutorial ○ Write a couple of examples 3. Where are the pain points of your documentation? ○ Create documentation specific tickets and label them clearly as documentation-related. 4. Write a short “how to contribute” guide. 5. Don’t be too nitpicky about documentation patches! ○ Is the patch an improvement? Yes? Just push the green button.