SlideShare a Scribd company logo
1 of 36
Download to read offline
Alexandre Stanislawski
Generating docs in the
static website era
Software engineer / Algolia
Public
@bobylito
bobylito
About me
> Software engineer at Algolia
> Lead of InstantSearch.js
> Side topic: docs of our main libraries
#AlgoliaSearchParty
@bobylito
Documentation in the static website era
Dedicated documentation team
DocSearch (React, vue.js, Laravel…)
Main libraries have their documentation websites
Algolia + docs = <3
#AlgoliaSearchParty
@bobylito
Documentation in the static website era
#AlgoliaSearchParty
@bobylito
And now a little story
Documentation in the static website era
2015: InstantSearch.js v1
#algoliaSearchParty
@bobylito
Documentation in the static website era
Jekyll was cool
#algoliaSearchParty
@bobylito
Documentation in the static website era
JsDoc less so
#algoliaSearchParty
@bobylito
> the tool
> the annotations in the code
jsDoc: 1 word, two things
#algoliaSearchParty
@bobylito
Documentation in the static website era
Documentation in the static website era
> Exhaustivity: all annotations are translated into doc
> Collocation: doc lives with the code
Reasons for keeping annotations
#algoliaSearchParty
@bobylito
Documentation in the static website era
Documentation generators (like JSDoc) are the ancestors of
static website generators
They do the same for docs than Jekyll does for blogs.
Before it was cool...
#algoliaSearchParty
@bobylito
Documentation in the static website era
> poor / unique templating system
> no css preprocessor
> no modern js stack
And they haven’t aged well
#algoliaSearchParty
@bobylito
Documentation in the static website era
Applies a theme to output HTML and CSS
#algoliaSearchParty
@bobylito
Integrate the JSDoc in Jekyll?
Extracts the comments in the code
Organizes the comments
Export as markdown
Documentation generator
Documentation in the static website era
#algoliaSearchParty
@bobylito
Not the only one!
Documentation in the static website era
1. A script generates markdown files from *.js
2. The markdown can then be integrated to Jekyll
And in our case, we used jsdoc-to-markdown
Our solution
#algoliaSearchParty
@bobylito
#AlgoliaSearchParty
@bobylito
Let’s fast forward to
now
#AlgoliaSearchParty
@bobylito
Documentation in the static website era
> Metalsmith
○ Not focussed on blogs
○ Written in JS
○ Easy to build plugins
> PUG + Sass (+ webpack + handlebars)
> And a custom plugin for documentation.js
Using modern tools for docs
#algoliaSearchParty
@bobylito
Documentation in the static website era
Applies a theme to output HTML and CSS
Bypassing the output
Extracts the comments in the code
Organizes the comments
Export as markdown
Documentation generator
#algoliaSearchParty
@bobylito
Documentation in the static website era
> Fully compatible with jsDoc comments
> Under active development
> Built-in javascript API
Documentation.js
#algoliaSearchParty
@bobylito
Documentation in the static website era
Metalsmith architecture
Read Write
#algoliaSearchParty
@bobylito
Documentation in the static website era
Metalsmith plugin
Files Files
#algoliaSearchParty
@bobylito
Documentation in the static website era
Documentation.js plugin
Files Files
Extracts JS
documentation
data
Organizes
documentation
in files
#algoliaSearchParty
@bobylito
Documentation in the static website era
Our pipeline
Read Write
Pug plugin +
JSDoc specific mixins
Documentation.js
plugin
#algoliaSearchParty
@bobylito
Documentation in the static website era
> Editorial content with reference doc
> Tools you know
> Requires some time investment
Results
#algoliaSearchParty
@bobylito
Get more from your
doc!
#AlgoliaSearchParty
@bobylito
Documentation in the static website era
> Edit this page button
> Jsdoc is more structured than markup
Easy contributions
#algoliaSearchParty
@bobylito
Documentation in the static website era
> The API can be separated in concepts
> Organizing topics with the learning curve in mind
> Driven by the business logic of the doc based on the jsDoc
data
Topic oriented documentation
#algoliaSearchParty
@bobylito
Documentation in the static website era
Runnable example
#algoliaSearchParty
@bobylito
> The user know what they get
> They can copy it
Documentation in the static website era
> Generate usage in pseudo code
> Non formal way of seeing the API
Usage
#algoliaSearchParty
@bobylito
Documentation in the static website era
> Document framework specific concepts?
> Add custom tags in the comments
> Output them in the generated documentation
Extend the semantic
#algoliaSearchParty
@bobylito
Reflexions and future
#AlgoliaSearchParty
@bobylito
Documentation in the static website era
> Metalsmith is small and very easy to hack
> Maybe other tools could fit too
> Other languages could benefit from this approach
Current stack
#algoliaSearchParty
@bobylito
Documentation in the static website era
> jsDoc is typing without verifications
> documentation.js support flow as typing
> Double bonus: Writing type once + checks
Code semantics
#algoliaSearchParty
@bobylito
Documentation in the static website era
> Documentation is key for a successful library
> You don’t have to rely on old stacks
> Documentation is data, you can harness it
Conclusion
#algoliaSearchParty
@bobylito
Thank you
Questions?
Alexandre Stanislawski
Software engineer / Algolia
@bobylito
bobylito
Documentation in the static website era
● InstantSearch.js documentation
● react-instantsearch documentation
Tools
● Documentation.js
● Metalsmith
● jsdoc-to-markdown
● jsdoc
Some interesting blog post on the doc topic
● Making docs more inspiring
● In defense of jsDoc
#algoliaSearchParty
@bobylito
Reference

More Related Content

Similar to Generating docs in the static website era

Publishing strategies for API documentation
Publishing strategies for API documentationPublishing strategies for API documentation
Publishing strategies for API documentationTom Johnson
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Tom Johnson
 
Front End Development for Back End Developers - Devoxx UK 2017
 Front End Development for Back End Developers - Devoxx UK 2017 Front End Development for Back End Developers - Devoxx UK 2017
Front End Development for Back End Developers - Devoxx UK 2017Matt Raible
 
Web components - The Future is Here
Web components - The Future is HereWeb components - The Future is Here
Web components - The Future is HereGil Fink
 
Html5 Brown Bag
Html5 Brown BagHtml5 Brown Bag
Html5 Brown Bagstuplum
 
API Documentation Workshop tcworld India 2015
API Documentation Workshop tcworld India 2015API Documentation Workshop tcworld India 2015
API Documentation Workshop tcworld India 2015Tom Johnson
 
Frontend for developers
Frontend for developersFrontend for developers
Frontend for developersHernan Mammana
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)François Massart
 
Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereJohn Riviello
 
ASP.NET MVC Workshop for Women in Technology
ASP.NET MVC Workshop for Women in TechnologyASP.NET MVC Workshop for Women in Technology
ASP.NET MVC Workshop for Women in TechnologyMałgorzata Borzęcka
 
Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Estelle Weyl
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkTroy Miles
 
DocDokuPLM: Domain Specific PaaS and Business Oriented API
DocDokuPLM: Domain Specific PaaS and Business Oriented APIDocDokuPLM: Domain Specific PaaS and Business Oriented API
DocDokuPLM: Domain Specific PaaS and Business Oriented APIDocDoku
 
DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris.
DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris. DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris.
DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris. OW2
 
Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016
Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016
Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016Eric Descargues
 
Documentation An Engineering Problem Unsolved
Documentation  An Engineering Problem UnsolvedDocumentation  An Engineering Problem Unsolved
Documentation An Engineering Problem UnsolvedSchalk Cronjé
 
Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...
Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...
Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...Laure Vergeron
 
Leaping Forward: Finding The Future of Your API Docs
Leaping Forward: Finding The Future of Your API DocsLeaping Forward: Finding The Future of Your API Docs
Leaping Forward: Finding The Future of Your API DocsPronovix
 
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるIt is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるSadaaki HIRAI
 

Similar to Generating docs in the static website era (20)

Publishing strategies for API documentation
Publishing strategies for API documentationPublishing strategies for API documentation
Publishing strategies for API documentation
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
 
Front End Development for Back End Developers - Devoxx UK 2017
 Front End Development for Back End Developers - Devoxx UK 2017 Front End Development for Back End Developers - Devoxx UK 2017
Front End Development for Back End Developers - Devoxx UK 2017
 
Web components - The Future is Here
Web components - The Future is HereWeb components - The Future is Here
Web components - The Future is Here
 
Html5 Brown Bag
Html5 Brown BagHtml5 Brown Bag
Html5 Brown Bag
 
API Documentation Workshop tcworld India 2015
API Documentation Workshop tcworld India 2015API Documentation Workshop tcworld India 2015
API Documentation Workshop tcworld India 2015
 
Frontend for developers
Frontend for developersFrontend for developers
Frontend for developers
 
Dojo & HTML5
Dojo & HTML5Dojo & HTML5
Dojo & HTML5
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
 
Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is Here
 
ASP.NET MVC Workshop for Women in Technology
ASP.NET MVC Workshop for Women in TechnologyASP.NET MVC Workshop for Women in Technology
ASP.NET MVC Workshop for Women in Technology
 
Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
 
DocDokuPLM: Domain Specific PaaS and Business Oriented API
DocDokuPLM: Domain Specific PaaS and Business Oriented APIDocDokuPLM: Domain Specific PaaS and Business Oriented API
DocDokuPLM: Domain Specific PaaS and Business Oriented API
 
DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris.
DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris. DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris.
DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris.
 
Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016
Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016
Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016
 
Documentation An Engineering Problem Unsolved
Documentation  An Engineering Problem UnsolvedDocumentation  An Engineering Problem Unsolved
Documentation An Engineering Problem Unsolved
 
Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...
Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...
Docker Meetup Tokyo #23 - Zenko Open Source Multi-Cloud Data Controller - Lau...
 
Leaping Forward: Finding The Future of Your API Docs
Leaping Forward: Finding The Future of Your API DocsLeaping Forward: Finding The Future of Your API Docs
Leaping Forward: Finding The Future of Your API Docs
 
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるIt is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
 

Recently uploaded

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Recently uploaded (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Generating docs in the static website era

  • 1. Alexandre Stanislawski Generating docs in the static website era Software engineer / Algolia Public @bobylito bobylito
  • 2. About me > Software engineer at Algolia > Lead of InstantSearch.js > Side topic: docs of our main libraries #AlgoliaSearchParty @bobylito Documentation in the static website era
  • 3. Dedicated documentation team DocSearch (React, vue.js, Laravel…) Main libraries have their documentation websites Algolia + docs = <3 #AlgoliaSearchParty @bobylito Documentation in the static website era
  • 5. Documentation in the static website era 2015: InstantSearch.js v1 #algoliaSearchParty @bobylito
  • 6. Documentation in the static website era Jekyll was cool #algoliaSearchParty @bobylito
  • 7. Documentation in the static website era JsDoc less so #algoliaSearchParty @bobylito
  • 8. > the tool > the annotations in the code jsDoc: 1 word, two things #algoliaSearchParty @bobylito Documentation in the static website era
  • 9. Documentation in the static website era > Exhaustivity: all annotations are translated into doc > Collocation: doc lives with the code Reasons for keeping annotations #algoliaSearchParty @bobylito
  • 10. Documentation in the static website era Documentation generators (like JSDoc) are the ancestors of static website generators They do the same for docs than Jekyll does for blogs. Before it was cool... #algoliaSearchParty @bobylito
  • 11. Documentation in the static website era > poor / unique templating system > no css preprocessor > no modern js stack And they haven’t aged well #algoliaSearchParty @bobylito
  • 12. Documentation in the static website era Applies a theme to output HTML and CSS #algoliaSearchParty @bobylito Integrate the JSDoc in Jekyll? Extracts the comments in the code Organizes the comments Export as markdown Documentation generator
  • 13. Documentation in the static website era #algoliaSearchParty @bobylito Not the only one!
  • 14. Documentation in the static website era 1. A script generates markdown files from *.js 2. The markdown can then be integrated to Jekyll And in our case, we used jsdoc-to-markdown Our solution #algoliaSearchParty @bobylito
  • 16. Let’s fast forward to now #AlgoliaSearchParty @bobylito
  • 17. Documentation in the static website era > Metalsmith ○ Not focussed on blogs ○ Written in JS ○ Easy to build plugins > PUG + Sass (+ webpack + handlebars) > And a custom plugin for documentation.js Using modern tools for docs #algoliaSearchParty @bobylito
  • 18. Documentation in the static website era Applies a theme to output HTML and CSS Bypassing the output Extracts the comments in the code Organizes the comments Export as markdown Documentation generator #algoliaSearchParty @bobylito
  • 19. Documentation in the static website era > Fully compatible with jsDoc comments > Under active development > Built-in javascript API Documentation.js #algoliaSearchParty @bobylito
  • 20. Documentation in the static website era Metalsmith architecture Read Write #algoliaSearchParty @bobylito
  • 21. Documentation in the static website era Metalsmith plugin Files Files #algoliaSearchParty @bobylito
  • 22. Documentation in the static website era Documentation.js plugin Files Files Extracts JS documentation data Organizes documentation in files #algoliaSearchParty @bobylito
  • 23. Documentation in the static website era Our pipeline Read Write Pug plugin + JSDoc specific mixins Documentation.js plugin #algoliaSearchParty @bobylito
  • 24. Documentation in the static website era > Editorial content with reference doc > Tools you know > Requires some time investment Results #algoliaSearchParty @bobylito
  • 25. Get more from your doc! #AlgoliaSearchParty @bobylito
  • 26. Documentation in the static website era > Edit this page button > Jsdoc is more structured than markup Easy contributions #algoliaSearchParty @bobylito
  • 27. Documentation in the static website era > The API can be separated in concepts > Organizing topics with the learning curve in mind > Driven by the business logic of the doc based on the jsDoc data Topic oriented documentation #algoliaSearchParty @bobylito
  • 28. Documentation in the static website era Runnable example #algoliaSearchParty @bobylito > The user know what they get > They can copy it
  • 29. Documentation in the static website era > Generate usage in pseudo code > Non formal way of seeing the API Usage #algoliaSearchParty @bobylito
  • 30. Documentation in the static website era > Document framework specific concepts? > Add custom tags in the comments > Output them in the generated documentation Extend the semantic #algoliaSearchParty @bobylito
  • 32. Documentation in the static website era > Metalsmith is small and very easy to hack > Maybe other tools could fit too > Other languages could benefit from this approach Current stack #algoliaSearchParty @bobylito
  • 33. Documentation in the static website era > jsDoc is typing without verifications > documentation.js support flow as typing > Double bonus: Writing type once + checks Code semantics #algoliaSearchParty @bobylito
  • 34. Documentation in the static website era > Documentation is key for a successful library > You don’t have to rely on old stacks > Documentation is data, you can harness it Conclusion #algoliaSearchParty @bobylito
  • 35. Thank you Questions? Alexandre Stanislawski Software engineer / Algolia @bobylito bobylito
  • 36. Documentation in the static website era ● InstantSearch.js documentation ● react-instantsearch documentation Tools ● Documentation.js ● Metalsmith ● jsdoc-to-markdown ● jsdoc Some interesting blog post on the doc topic ● Making docs more inspiring ● In defense of jsDoc #algoliaSearchParty @bobylito Reference