| OLD | NEW |
| (Empty) |
| 1 #!/bin/bash | |
| 2 | |
| 3 # This generates the reference documentation for the core libraries that come | |
| 4 # with dartdoc. It is built on top of dartdoc, which is a general-purpose | |
| 5 # library for generating docs from any Dart code. This library extends that to | |
| 6 # include additional information and styling specific to our corelib. | |
| 7 # | |
| 8 # Usage: | |
| 9 # | |
| 10 # $ ./apidoc | |
| 11 # | |
| 12 # Pretty simple. :) | |
| 13 | |
| 14 # TODO(rnystrom): This script is more or less a copy of the one in dartdoc but | |
| 15 # tweaked to output stuff to here instead of inside dartdoc/docs. That's pretty | |
| 16 # gross. Ideally, we'd write the whole thing in Dart an ditch the shell | |
| 17 # but right now we can't even copy binary files using Dart. | |
| 18 | |
| 19 # Run from apidoc directory to get correct relative paths. | |
| 20 pushd `dirname "$0"` >>/dev/null | |
| 21 | |
| 22 compileToJs() { | |
| 23 if [ "../../lib/dartdoc/$1.dart" -nt "../../lib/dartdoc/static/$1.js" ] | |
| 24 then | |
| 25 ../../frog/minfrog --libdir=../../frog/lib \ | |
| 26 --out=../../lib/dartdoc/static/$1.js --compile-only \ | |
| 27 ../../lib/dartdoc/$1.dart | |
| 28 echo "Compiled $1.dart." | |
| 29 fi | |
| 30 } | |
| 31 | |
| 32 # Generate the client-side .js files if needed. | |
| 33 compileToJs "client-static" | |
| 34 compileToJs "client-live-nav" | |
| 35 | |
| 36 # Generate the user's docs. | |
| 37 dart apidoc.dart $@ | |
| 38 | |
| 39 popd >>/dev/null | |
| OLD | NEW |