Transcript
Page 1: TiConf NYC - Documenting Your Titanium Applications

TiConf NYC 2014: Documenting Your Titanium

Applications JAMIL HASSAN SPAIN, @JAMILSPAIN

Page 2: TiConf NYC - Documenting Your Titanium Applications

Little  Bit  About  me  

!   NC  based  Software  Engineer,  big  linux  fan.  

!   Started  with  PHP  in  early  days  3.x  or  PHP  F/I  

!   Started  with  AppC  in  2011  as  Trainer  for  Certification  Programs  

!   Currently  Architect  with  Solutions  Engineering  Group  

Page 3: TiConf NYC - Documenting Your Titanium Applications

Little  History  on  This  Topic  

!   Built  my  first  large  scale  project  in  03/04.  Online  Admissions  Web  Application  for  school.    Really  became  a  stickler  for  this  process.  

!   PHP  4/5,  LAMP  stack,  Fedora  Linux  as  base.  !   Ran  into  2  different  schools  of  thought  

!   Code  should  be  written  to  be  readable    !   Document  regardless  to  explain  code  logic  

!   My  philosophy  merges  the  two,  PhpDocumentor  was  the  cure  

Page 4: TiConf NYC - Documenting Your Titanium Applications

Documentation  for  Titanium  Mobile  Applications  

!   No  standards  existed  for  documentation,  been  a  find  your  own  flavor.    

!   #appcelerator  uses  it  for  our  own  SDK  documentation.  !   About  a  year  ago  internally,  after  discussion  with  Rick  Blalock  mentioned  he  had  some  success  using  JSDuck.    After  playing  around  with  it,  we  agreed  this  could  be  a  good  standard  to  recommend    

!   I  began  the  R&D  on  the  best  way  to  implement  this  as  easy  to  use  for  general  public  use.  

Page 5: TiConf NYC - Documenting Your Titanium Applications

A  NPM  was  born  

!   Roughly  about  6  months  ago.  

!   First  initial  versions  are  out,  still  young  in  usage.  Glad  to  be  here  to  introduce  it  officially  to  the  community.  

Page 6: TiConf NYC - Documenting Your Titanium Applications

One  requirement  is  JS  Duck  

!   JS  Doc  Generator  supported  by  Sencha  labs    !   I  have  always  been  a  fan  from  Ext.JS  days  !   Required  for  this  npm  package  to  work.  

!   gem  install  jsduck  

Page 7: TiConf NYC - Documenting Your Titanium Applications

Features  for  Titanium-­‐JSDuck  

!   Installable  through  npm  install    !   CLI  options  to  automate  the  setup  in  your  mobile  applications  

!   Injects  itself  on  every  compile  to  simulator/device  (alloy.jmk  post:compile  )  

!   Options  to  generate  documentation  without  compiling  

Page 8: TiConf NYC - Documenting Your Titanium Applications

How  to  Install      

!   From  command,  do  a  global  install  for  the  titanium-­‐jsduck  npm  module,  Version  1.2  is  the  latest  

!   URL  to  package  is:  https://www.npmjs.org/package/titanium-­‐jsduck  

 

Page 9: TiConf NYC - Documenting Your Titanium Applications

Verify  Installation  

!   Run  titanium-­‐jsduck  from  command  line,  will  return  this  help  screen  

Page 10: TiConf NYC - Documenting Your Titanium Applications

Activating  your  Mobile  Project  

!   Open  terminal  to  the  root  of  your  titanium  project  !   Type  the  following  command:  

Page 11: TiConf NYC - Documenting Your Titanium Applications

You’re  Done  

!   You’re  all  set  from  there!!!  Start  documenting.  !   A  few  things  will  change  after  install  

!   If  alloy.jmk  does  not  exist,  we  create  it  !   If  does,  we  back  it  up  (alloy.jmk.txt)  to  preserve  any  existing  config  

!   Docs  folder  will  appear  (  source  for  JS  Duck  to  use  )  

Page 12: TiConf NYC - Documenting Your Titanium Applications

Document  Your  Code  to  Integrate  

!   Please  view  Sencha  Labs  Documentation  for  Convention  @  https://github.com/senchalabs/jsduck/wiki      

! Jsduck  will  scan  your  /app  JS  files  for  doc  syntax  !   Controller  files  !   Lib  folder  contents  

Page 13: TiConf NYC - Documenting Your Titanium Applications

How  do  I  View  the  Documentation  

!   3  options  exist  via  CLI  

!   Detects  to  see  if  Browsers  are  installed  in  Applications  folder  

Page 14: TiConf NYC - Documenting Your Titanium Applications

Typical  Dev  Workflow  

!   Create  Mobile  Project  &  Install  NPM  !   titanium-­‐jsduck  install  

!   Code  &  Document  your  project  !   docs  self  generate  on  compilation,  no  need  to  check  into  source  control  

!   Open  Browser  to  View  Documentation  as  you  code  !   titanium-­‐jsduck  open  (  first  time  )  !   titanium-­‐jsduck  run  (  subsequent  +  refresh  browser  )  

Page 15: TiConf NYC - Documenting Your Titanium Applications

Hello  World  Demo  TITANIUM-­‐JSDUCK  NPM  MODULE  

Page 16: TiConf NYC - Documenting Your Titanium Applications

Roadmap  

!   Additional  command  line  arguments  to  configure  looks  and  feel  of  documentation  site  

!   Another  install  option  for  deluxe  documentation  to  include  (  test  plans,  version  release  notes,  etc  )  

!   Testing  for  compatibility  with  Windows  8.1  !   Compatibility  with  Platino  in  development  !   Open  for  more  suggestions  on  more  improvements  

Page 17: TiConf NYC - Documenting Your Titanium Applications

Thank  You  JAMIL  HASSAN  SPAIN  @jamilspain