1
0
Fork 0

Began adding inheritance chapter, which required getting images working within documentation

- Restructured portions of Makefile
closure/master
Mike Gerwitz 2011-03-19 19:35:21 -04:00
parent 2b5fb2e0eb
commit b48a703c24
5 changed files with 64 additions and 24 deletions

View File

@ -1,6 +1,6 @@
CWD=$(CURDIR) CWD=$(CURDIR)
PATH_BUILD=${CWD}/build PATH_BUILD=./build
PATH_TOOLS=${CWD}/tools PATH_TOOLS=${CWD}/tools
PATH_COMBINE_OUTPUT=${PATH_BUILD}/ease.js PATH_COMBINE_OUTPUT=${PATH_BUILD}/ease.js
PATH_COMBINE_OUTPUT_FULL=${PATH_BUILD}/ease-full.js PATH_COMBINE_OUTPUT_FULL=${PATH_BUILD}/ease-full.js
@ -10,15 +10,18 @@ PATH_PERF_TEST=${PATH_TEST}/perf
PERF_TESTS := $(shell find "$(PATH_PERF_TEST)" -name 'perf-*.js') PERF_TESTS := $(shell find "$(PATH_PERF_TEST)" -name 'perf-*.js')
PATH_DOC=${CWD}/doc PATH_DOC=./doc
PATH_DOC_OUTPUT=${PATH_BUILD}/doc PATH_DOC_OUTPUT=${PATH_BUILD}/doc
PATH_DOC_OUTPUT_INFO=${PATH_DOC_OUTPUT}/manual.info PATH_DOC_OUTPUT_INFO=${PATH_DOC_OUTPUT}/manual.info
PATH_DOC_OUTPUT_PLAIN=${PATH_DOC_OUTPUT}/manual.txt PATH_DOC_OUTPUT_PLAIN=${PATH_DOC_OUTPUT}/manual.txt
PATH_DOC_OUTPUT_HTML=${PATH_DOC_OUTPUT}/manual PATH_DOC_OUTPUT_HTML=${PATH_DOC_OUTPUT}/manual
PATH_DOC_OUTPUT_HTML1=${PATH_DOC_OUTPUT}/manual.html PATH_DOC_OUTPUT_HTML1=${PATH_DOC_OUTPUT}/manual.html
PATH_DOC_CSS=${PATH_DOC}/manual.css PATH_DOC_CSS=${PATH_DOC}/manual.css
PATH_DOC_IMG=${PATH_DOC}/img
PATH_MANUAL_TEXI=${PATH_DOC}/manual.texi PATH_MANUAL_TEXI=${PATH_DOC}/manual.texi
doc_imgs := $(patsubst %.dia, %.png, $(wildcard $(PATH_DOC_IMG)/*.dia))
COMBINE=${PATH_TOOLS}/combine COMBINE=${PATH_TOOLS}/combine
TESTS := $(shell find "$(PATH_TEST)" \ TESTS := $(shell find "$(PATH_TEST)" \
@ -36,7 +39,9 @@ all: combine doc
# create build dir # create build dir
mkbuild: mkbuild:
mkdir -p "${PATH_BUILD}" mkdir -p "$(PATH_BUILD)"
mkbuild-doc:
mkdir -p "$(PATH_DOC_OUTPUT)"
# combine all modules into easily redistributable ease.js file (intended for # combine all modules into easily redistributable ease.js file (intended for
# browser) # browser)
@ -62,26 +67,41 @@ perf-%.js: default
# files that were generated # files that were generated
# #
# generates: pdf, HTML (multiple pages), HTML (single page) # generates: pdf, HTML (multiple pages), HTML (single page)
doc: mkbuild doc-pdf doc-texi doc-plain doc-html doc: doc-pdf doc-texi doc-plain doc-html
doc-pdf:
pdftex -output-directory "${PATH_DOC}" "${PATH_MANUAL_TEXI}" doc-img: $(doc_imgs)
pdftex -output-directory "${PATH_DOC}" "${PATH_MANUAL_TEXI}"
doc/img/%.png: doc/img/%.dia
dia -e $@ -s 600x $<
doc-pdf: | mkbuild-doc doc-img
TEXINPUTS="$(PATH_DOC):" \
pdftex -output-directory "${PATH_DOC}" "${PATH_MANUAL_TEXI}" && \
TEXINPUTS="$(PATH_DOC):" \
pdftex -output-directory "${PATH_DOC}" "${PATH_MANUAL_TEXI}"
mv -f "${PATH_DOC}"/*.pdf "${PATH_DOC_OUTPUT}" mv -f "${PATH_DOC}"/*.pdf "${PATH_DOC_OUTPUT}"
cd "$(PATH_DOC)" && rm -f $(shell cat "$(PATH_DOC)/.gitignore") cd "$(PATH_DOC)" && rm -f $(shell cat "$(PATH_DOC)/.gitignore")
doc-texi:
cd "${PATH_DOC}" && \ doc-texi: | mkbuild-doc
makeinfo -o "${PATH_DOC_OUTPUT_INFO}" "${PATH_MANUAL_TEXI}"; makeinfo -I "$(PATH_DOC)" -o "${PATH_DOC_OUTPUT_INFO}" \
doc-plain: "${PATH_MANUAL_TEXI}";
cd "${PATH_DOC}" && \
makeinfo --plain "${PATH_MANUAL_TEXI}" > "${PATH_DOC_OUTPUT_PLAIN}"; doc-plain: | mkbuild-doc
doc-html: makeinfo --plain -I "$(PATH_DOC)" "${PATH_MANUAL_TEXI}" \
cd "${PATH_DOC}" && \ > "${PATH_DOC_OUTPUT_PLAIN}";
makeinfo --html --css-include="${PATH_DOC_CSS}" \
-o "${PATH_DOC_OUTPUT_HTML}" "${PATH_MANUAL_TEXI}"; \ doc-html: | mkbuild-doc doc-img
makeinfo --no-split --html --css-include="${PATH_DOC_CSS}" \ makeinfo --html --css-include="${PATH_DOC_CSS}" \
-o "${PATH_DOC_OUTPUT_HTML1}" "${PATH_MANUAL_TEXI}"; -I "$(PATH_DOC)" -o "${PATH_DOC_OUTPUT_HTML}" "${PATH_MANUAL_TEXI}"; \
makeinfo --no-split --html --css-include="${PATH_DOC_CSS}" \
-I "$(PATH_DOC)" -o "${PATH_DOC_OUTPUT_HTML1}" "${PATH_MANUAL_TEXI}";
mkdir -p "$(PATH_DOC_OUTPUT_HTML)/img"
cp "$(PATH_DOC_IMG)"/*.png "$(PATH_DOC_OUTPUT_HTML)/img"
ln -s manual/img "$(PATH_DOC_OUTPUT)/img"
# clean up build dir # clean up build dir
clean: clean:
rm -rf "${PATH_BUILD}" rm -rf "${PATH_BUILD}"
rm -rf $(PATH_DOC_IMG)/*.png

View File

@ -70,6 +70,7 @@ ease.js, until such a point where prototypes are no longer adequate.
@menu @menu
* Declaring Classes:: Learn how to declare a class with ease.js * Declaring Classes:: Learn how to declare a class with ease.js
* Inheritance:: Extending classes from another
* Member Visibility:: Encapsulation is a core concept of Object-Oriented * Member Visibility:: Encapsulation is a core concept of Object-Oriented
programming programming
@end menu @end menu
@ -291,6 +292,25 @@ declare static methods so that they may be accessed without the overhead of
creating a new class instance. creating a new class instance.
@node Inheritance
@section Inheritance
Inheritance is a touchy subject. It can be a powerful feature, but it can also
be easily abused. @dfn{Inheritance} is the term used to describe the process of
creating a @dfn{child} class that @dfn{extends} (inherits members from) another
@dfn{parent} class. The parent class is also referred to as the @dfn{supertype}
and the child is called the @dfn{subtype}. Let's consider the following example,
where we have a dog, lazy dog, and a dog that walks on two legs:
@float Figure, f:inheritance-ex
@image{img/inheritance-ex,,,,png}
@caption{Basic inheritance example}
@end float
In the above example, we would say that @var{LazyDog} and @var{TwoLeggedDog}
are @emph{subtypes} of @var{Dog}, and that @var{Dog} is the @emph{supertype}
of the other two.
@node Member Visibility @node Member Visibility
@section Member Visibility @section Member Visibility
One of the major hurdles ease.js aimed to address (indeed, one of the core One of the major hurdles ease.js aimed to address (indeed, one of the core

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -52,10 +52,10 @@ Free Documentation License".
@insertcopying @insertcopying
@end ifnottex @end ifnottex
@include ./about.texi @include about.texi
@include ./integration.texi @include integration.texi
@include ./classes.texi @include classes.texi
@include ./source-tree.texi @include source-tree.texi
@include ./license.texi @include license.texi
@bye @bye