SlideShare a Scribd company logo
Dynamic Documentation
Making documentation friendly
& fun
$GREETINGS
G’DAY
{{NAME}}
Daniel
<<COMPANY>>
Linkedin
The problem
I
am
lazy
The lazy me
● things are hard
The lazy me
● things are hard
● once only once
The lazy me
● things are hard
● once only once
● copy and paste everything
I
am
lazy
I
am
lazy
and
forget
things
The forgetful me
● juggles too many things at once
The forgetful me
● juggles too many things at once
● systems are complex
The forgetful me
● juggles too many things at once
● systems are complex
● systems are not all the same
I
am
lazy
and
forget
things
The problem (cont.)
I run a project that
triggers all SRE and DEV
to make changes to their
systems.
Upgrading libs
Fixing up security issues
Monitoring coverage
Checking capacity
Latency
Etc. etc.
I want to make it as
easy
as possible
for everyone
to fix problems.
small
defined
problems
get fixed.
documentation
is the answer.
We have a page for
every type change
that is required.
Ideally we would have a
page for
every type for every
service.
However that would be
over 50,000 pages.
I know what you’re
thinking.
SHELL STYLE
$HOSTNAME
${NODENAME}
SHIFT STYLE
<<NODE-ID>>
TEST STYLE
[[FQDN]]
“double curly brace” STYLE
{IPv4}
{{IPv6}}
MUSTACHE STYLE
{IPv4}
{{IPv6}}
OTHER STYLE
(NODE)
((HOST))
{%IP%}
Too many styles
& I can’t copy and paste any* of them
SHELL STYLE (C&P)
HOSTNAME=$(hostname)
$HOSTNAME
We settled on {{mustache}} style.
1. It’s fun to say
2. it has some other advantages.
39
40
41
It’s not too bad.. but
42
Wouldn’t it be nice if we
had a templating engine?
43
{{service_name}}
into
jobs-server
44
45
46
AngularJS
image: CC BY 4.0 https://angular.io/presskit.html (2017)
Enter
47
Our wiki
is missing
this feature
48
Our wiki
was missing
this feature
49
How ?
50
querystrings
51
http://wiki/page?service=jobs-server
52
You can’t just add a <script> tag to
load javascript
53
{html}
<script src=”https://cdn/angularjs.js”>
</script>
{html}
54
Thanks {html} tag
55
Back to looking at the query string
http://wiki/page?service=jobs-server
56
var query = $location.search();
var service_name = query[‘service’];
$scope.service_name = service_name;
var url = ‘https://api/’ + service_name;
$http.get(url).success(
function(ctx) {
$scope.ctx = ctx;
}
);
57
var query = $location.search();
var service_name = query[‘service’];
$scope.service_name = service_name;
var url = ‘https://api/’ + service_name;
$http.get(url).success(
function(ctx) {
$scope.ctx = ctx;
}
);
58
var query = $location.search();
var service_name = query[‘service’];
$scope.service_name = service_name;
var url = ‘https://api/’ + service_name;
$http.get(url).success(
function(ctx) {
$scope.ctx = ctx;
}
);
59
var query = $location.search();
var service_name = query[‘service’];
$scope.service_name = service_name;
var url = ‘https://api/’ + service_name;
$http.get(url).success(
function(ctx) {
$scope.ctx = ctx;
}
);
60
That is all we need to use
{{service}}
61
We are not stopping here.
62
That project I talked about before.
also collections
A LOT
of interesting information
We can use that information
We just need to fetch it
65
var query = $location.search();
var service_name = query[‘service’];
var url = ‘https://api/’ + service_name;
$http.get(url).success(
function(ctx) {
$scope.ctx = ctx;
}
);
66
var query = $location.search();
var service_name = query[‘service’];
var url = ‘https://api/’ + service_name;
$http.get(url).success(
function(ctx) {
$scope.ctx = ctx;
}
);
67
var query = $location.search();
var service_name = query[‘service’];
var url = ‘https://api/’ + service_name;
$http.get(url).success(
function(ctx) {
$scope.ctx = ctx;
}
);
68
{{ctx.sre_group}}
becomes
jobs-team
69
{{ctx.current_oncall}}
becomes
Daniel Lawrence
70
{{ctx.ownership.owner_eng}}
{{ctx.number_of_hosts}}
{{ctx.product.lib.jetty.version}}
{{ctx.hosts.hostnames}}
{{ctx.is_deployed_in_prod}}
{{ctx.commits.last_commit}}
71
AngularJS
image: CC BY 4.0 https://angular.io/presskit.html (2017)
show / hide data
73
prompt for more info
Dynamic documentation - SRECON 2017
Loops
<ul>
<li
ng-repeat="hostname in ctx.hosts">
{{hostname}}
</li>
</ul>
Figure out commands
Dynamic documentation - SRECON 2017
/daniellawrence/ddoc
Where to go from here
images: https://about.gitlab.com/press/ & https://github.com/logos
Thanks
/daniellawrence/ddoc
images: https://about.gitlab.com/press/ & https://github.com/logos

More Related Content

What's hot (20)

PDF
Responsive Design with WordPress
Joe Casabona
 
PDF
Real World Web components
Jarrod Overson
 
PPTX
Harness jQuery Templates and Data Link
BorisMoore
 
PDF
Mojolicious, real-time web framework
taggg
 
PDF
Vue.js for beginners
Julio Bitencourt
 
PPTX
jQuery Performance Tips and Tricks
Valerii Iatsko
 
PDF
Jquery for post a form
Rakesh Kumar
 
PPTX
Upstate CSCI 450 WebDev Chapter 4
DanWooster1
 
PDF
Railsbridge javascript
p4geoff
 
PPTX
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Dotan Dimet
 
PDF
Case study: Carleton University – managing 600+ single installs
Michael Corkum
 
PPT
Presentation
Testled
 
PDF
The Onion
Jörn Zaefferer
 
KEY
New Perspectives on Performance
mennovanslooten
 
PDF
The Beauty and the Beast - Modern Javascript Development with AngularJS and P...
Timo Stollenwerk
 
PPT
jQuery For Beginners - jQuery Conference 2009
Ralph Whitbeck
 
PPT
Responsive Design with WordPress (WCPHX)
Joe Casabona
 
PPTX
Client Web
Markiyan Matsekh
 
PDF
Secure Coding with WordPress - WordCamp SF 2008
Mark Jaquith
 
PDF
DockerGrunn 10 intro talk
Tijmen Klein
 
Responsive Design with WordPress
Joe Casabona
 
Real World Web components
Jarrod Overson
 
Harness jQuery Templates and Data Link
BorisMoore
 
Mojolicious, real-time web framework
taggg
 
Vue.js for beginners
Julio Bitencourt
 
jQuery Performance Tips and Tricks
Valerii Iatsko
 
Jquery for post a form
Rakesh Kumar
 
Upstate CSCI 450 WebDev Chapter 4
DanWooster1
 
Railsbridge javascript
p4geoff
 
Mojolicious - Perl Framework for the Real-Time Web (Lightning Talk)
Dotan Dimet
 
Case study: Carleton University – managing 600+ single installs
Michael Corkum
 
Presentation
Testled
 
The Onion
Jörn Zaefferer
 
New Perspectives on Performance
mennovanslooten
 
The Beauty and the Beast - Modern Javascript Development with AngularJS and P...
Timo Stollenwerk
 
jQuery For Beginners - jQuery Conference 2009
Ralph Whitbeck
 
Responsive Design with WordPress (WCPHX)
Joe Casabona
 
Client Web
Markiyan Matsekh
 
Secure Coding with WordPress - WordCamp SF 2008
Mark Jaquith
 
DockerGrunn 10 intro talk
Tijmen Klein
 

Similar to Dynamic documentation - SRECON 2017 (20)

PDF
AngularJS for Web and Mobile
Rocket Software
 
PDF
Angular js gtg-27feb2013
Nitya Narasimhan
 
KEY
Javascript Frameworks for Well Architected, Immersive Web Apps
dnelson-cs
 
PDF
Beginner workshop to angularjs presentation at Google
Ari Lerner
 
PPTX
The future of web development write once, run everywhere with angular.js and ...
Mark Roden
 
PDF
The future of web development write once, run everywhere with angular js an...
Mark Leusink
 
PDF
Introduction to AngularJS
Jussi Pohjolainen
 
PDF
AngularJS best-practices
Henry Tao
 
PPTX
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
All Things Open
 
PDF
Testdrive AngularJS with Spring 4
Oliver Wahlen
 
PPTX
Getting Started with Angular JS
Akshay Mathur
 
PDF
Introduction to angular js july 6th 2014
Simona Clapan
 
PPTX
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
POSSCON
 
KEY
Future of PHP
Richard McIntyre
 
ZIP
Grown-up javascript with AngularJS
Mykhailo Kotsur
 
KEY
Palm Developer Day PhoneGap
Brian LeRoux
 
PPTX
Html5 and web technology update
Doug Domeny
 
PDF
Pengenalan AngularJS
Edi Santoso
 
PDF
javascript_service_tutorial
tutorialsruby
 
PDF
javascript_service_tutorial
tutorialsruby
 
AngularJS for Web and Mobile
Rocket Software
 
Angular js gtg-27feb2013
Nitya Narasimhan
 
Javascript Frameworks for Well Architected, Immersive Web Apps
dnelson-cs
 
Beginner workshop to angularjs presentation at Google
Ari Lerner
 
The future of web development write once, run everywhere with angular.js and ...
Mark Roden
 
The future of web development write once, run everywhere with angular js an...
Mark Leusink
 
Introduction to AngularJS
Jussi Pohjolainen
 
AngularJS best-practices
Henry Tao
 
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
All Things Open
 
Testdrive AngularJS with Spring 4
Oliver Wahlen
 
Getting Started with Angular JS
Akshay Mathur
 
Introduction to angular js july 6th 2014
Simona Clapan
 
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
POSSCON
 
Future of PHP
Richard McIntyre
 
Grown-up javascript with AngularJS
Mykhailo Kotsur
 
Palm Developer Day PhoneGap
Brian LeRoux
 
Html5 and web technology update
Doug Domeny
 
Pengenalan AngularJS
Edi Santoso
 
javascript_service_tutorial
tutorialsruby
 
javascript_service_tutorial
tutorialsruby
 
Ad

Recently uploaded (20)

PPTX
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
PPTX
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
PPTX
Orchestrating things in Angular application
Peter Abraham
 
PDF
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
PPTX
ZARA-Case.pptx djdkkdjnddkdoodkdxjidjdnhdjjdjx
RonnelPineda2
 
PPTX
英国假毕业证诺森比亚大学成绩单GPA修改UNN学生卡网上可查学历成绩单
Taqyea
 
PPTX
一比一原版(LaTech毕业证)路易斯安那理工大学毕业证如何办理
Taqyea
 
PDF
Web Hosting for Shopify WooCommerce etc.
Harry_Phoneix Harry_Phoneix
 
PPTX
原版西班牙莱昂大学毕业证(León毕业证书)如何办理
Taqyea
 
PPT
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
PPTX
internet básico presentacion es una red global
70965857
 
PPTX
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 
PPTX
ONLINE BIRTH CERTIFICATE APPLICATION SYSYTEM PPT.pptx
ShyamasreeDutta
 
PPTX
sajflsajfljsdfljslfjslfsdfas;fdsfksadfjlsdflkjslgfs;lfjlsajfl;sajfasfd.pptx
theknightme
 
PDF
Apple_Environmental_Progress_Report_2025.pdf
yiukwong
 
PPTX
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
PPTX
PM200.pptxghjgfhjghjghjghjghjghjghjghjghjghj
breadpaan921
 
PPT
introductio to computers by arthur janry
RamananMuthukrishnan
 
PPT
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
PDF
DevOps Design for different deployment options
henrymails
 
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
Orchestrating things in Angular application
Peter Abraham
 
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
ZARA-Case.pptx djdkkdjnddkdoodkdxjidjdnhdjjdjx
RonnelPineda2
 
英国假毕业证诺森比亚大学成绩单GPA修改UNN学生卡网上可查学历成绩单
Taqyea
 
一比一原版(LaTech毕业证)路易斯安那理工大学毕业证如何办理
Taqyea
 
Web Hosting for Shopify WooCommerce etc.
Harry_Phoneix Harry_Phoneix
 
原版西班牙莱昂大学毕业证(León毕业证书)如何办理
Taqyea
 
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
internet básico presentacion es una red global
70965857
 
PE introd.pptxfrgfgfdgfdgfgrtretrt44t444
nepmithibai2024
 
ONLINE BIRTH CERTIFICATE APPLICATION SYSYTEM PPT.pptx
ShyamasreeDutta
 
sajflsajfljsdfljslfjslfsdfas;fdsfksadfjlsdflkjslgfs;lfjlsajfl;sajfasfd.pptx
theknightme
 
Apple_Environmental_Progress_Report_2025.pdf
yiukwong
 
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
PM200.pptxghjgfhjghjghjghjghjghjghjghjghjghj
breadpaan921
 
introductio to computers by arthur janry
RamananMuthukrishnan
 
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
DevOps Design for different deployment options
henrymails
 
Ad

Dynamic documentation - SRECON 2017