2017-07-28 15:04:54 +00:00
|
|
|
#External
|
|
|
|
SkXXX
|
|
|
|
bmh_SkXXX
|
|
|
|
CL
|
2017-08-30 12:58:10 +00:00
|
|
|
Go
|
2017-07-28 15:04:54 +00:00
|
|
|
Visual_Studio
|
|
|
|
##
|
|
|
|
|
|
|
|
#Topic Bookmaker
|
|
|
|
|
|
|
|
How to use the Bookmaker utility.
|
|
|
|
|
2017-09-21 16:31:06 +00:00
|
|
|
Install
|
|
|
|
#A Go # https://golang.org/doc/install ##
|
|
|
|
if needed.
|
2017-07-28 15:04:54 +00:00
|
|
|
Get the fiddle command line interface tool.
|
2017-08-30 12:58:10 +00:00
|
|
|
By default this will appear in your home directory.
|
2017-07-28 15:04:54 +00:00
|
|
|
|
|
|
|
#Code
|
|
|
|
$ go get go.skia.org/infra/fiddle/go/fiddlecli
|
|
|
|
##
|
|
|
|
|
2017-08-03 21:14:08 +00:00
|
|
|
Build Bookmaker.
|
2017-07-28 15:04:54 +00:00
|
|
|
|
|
|
|
#Code
|
|
|
|
$ ninja -C out/dir bookmaker
|
|
|
|
##
|
|
|
|
|
|
|
|
Generate an starter Bookmaker file from an existing include.
|
|
|
|
|
|
|
|
#Code
|
2017-09-14 15:25:39 +00:00
|
|
|
$ ./out/dir/bookmaker -i include/core/SkXXX.h -t docs
|
2017-07-28 15:04:54 +00:00
|
|
|
##
|
|
|
|
|
2017-09-14 15:25:39 +00:00
|
|
|
If a method or function has an unnamed parameter, bookmaker generates an error:
|
|
|
|
|
|
|
|
#Code
|
|
|
|
###$
|
|
|
|
C:/puregit/include/core/SkPixmap.h(208): error: #Method missing param name
|
|
|
|
bool erase(const SkColor4f&, const SkIRect* subset = nullptr) const
|
|
|
|
^
|
|
|
|
$$$#
|
|
|
|
##
|
|
|
|
|
|
|
|
All parameters require names to allow markdown and doxygen documents to refer to
|
|
|
|
them. After naming all parameters, check in the include before continuing.
|
|
|
|
|
|
|
|
A successful run generates
|
|
|
|
#Code
|
|
|
|
docs/SkXXX_Reference.bmh
|
|
|
|
##
|
|
|
|
.
|
|
|
|
|
|
|
|
Next, use your favorite editor to fill out
|
|
|
|
#Code
|
|
|
|
docs/SkXXX_Reference.bmh
|
|
|
|
##
|
|
|
|
.
|
2017-07-28 15:04:54 +00:00
|
|
|
|
2017-08-30 12:58:10 +00:00
|
|
|
#Subtopic Style
|
|
|
|
|
|
|
|
Documentation consists of cross references, descriptions, and examples.
|
|
|
|
All structs, classes, enums, their members and methods, functions, and so on,
|
|
|
|
require descriptions. Most also require examples.
|
|
|
|
|
|
|
|
All methods and functions should include examples if practical.
|
|
|
|
|
|
|
|
Descriptions start with an active verb. Descriptions are complete, punctuated
|
|
|
|
sentences unless they describe parameters or return values. Parameters and
|
|
|
|
returned values are described by phrases that start lower case and do not
|
|
|
|
include trailing punctuation.
|
|
|
|
|
|
|
|
Descriptions are not self-referential; they do not include the thing they
|
|
|
|
describe. Descriptions may contain upper case references to definitions
|
|
|
|
but otherwise should be free of jargon.
|
|
|
|
|
|
|
|
Descriptions may contain code and formulas, each bracketed by markup.
|
|
|
|
|
|
|
|
Similar items may be grouped into topics. Topics may include subtopics.
|
|
|
|
|
|
|
|
Each document begins with one or more indices that include the contents of
|
|
|
|
that file. A class reference includes an index listing contained topics,
|
|
|
|
a separate listing for constructors, one for methods, and so on.
|
|
|
|
|
|
|
|
Class methods contain a description, any parameters, any return value,
|
|
|
|
an example, and any cross references.
|
|
|
|
|
|
|
|
Each method must contain either one or more examples or markup indicating
|
|
|
|
that there is no example.
|
|
|
|
|
|
|
|
##
|
|
|
|
|
2017-07-28 15:04:54 +00:00
|
|
|
Generate fiddle.json from all examples, including the ones you just wrote.
|
|
|
|
Error checking is syntatic: starting keywords are closed, keywords have the
|
|
|
|
correct parents.
|
|
|
|
If you run Bookmaker inside Visual_Studio, you can click on errors and it
|
|
|
|
will take you to the source line in question.
|
|
|
|
|
|
|
|
#Code
|
2017-08-03 21:14:08 +00:00
|
|
|
$ ./out/dir/bookmaker -e fiddle.json -b docs
|
2017-07-28 15:04:54 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
Once complete, run fiddlecli to generate the example hashes.
|
|
|
|
Errors are contained by the output but aren't reported yet.
|
|
|
|
|
|
|
|
#Code
|
|
|
|
$ $GOPATH/bin/fiddlecli --input fiddle.json --output fiddleout.json
|
|
|
|
##
|
|
|
|
|
|
|
|
Generate bmh_SkXXX.md from SkXXX.bmh and fiddleout.json.
|
|
|
|
Error checking includes: undefined references, fiddle compiler errors,
|
|
|
|
missing or mismatched printf output.
|
|
|
|
Again, you can click on any errors inside Visual_Studio.
|
|
|
|
|
|
|
|
#Code
|
2017-08-03 21:14:08 +00:00
|
|
|
$ ./out/dir/bookmaker -r site/user/api -b docs -f fiddleout.json
|
2017-07-28 15:04:54 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
The original include may have changed since you started creating the markdown.
|
|
|
|
Check to see if it is up to date.
|
|
|
|
This reports if a method no longer exists or its parameters have changed.
|
|
|
|
|
|
|
|
#Code
|
2017-08-03 21:14:08 +00:00
|
|
|
$ ./out/dir/bookmaker -x -b docs/SkXXX.bmh -i include/core/SkXXX.h
|
2017-07-28 15:04:54 +00:00
|
|
|
##
|
|
|
|
|
2017-09-14 15:25:39 +00:00
|
|
|
Generate an updated include header. Run:
|
2017-07-28 15:04:54 +00:00
|
|
|
|
2017-08-03 21:14:08 +00:00
|
|
|
#Code
|
|
|
|
$ ./out/dir/bookmaker -p -b docs -i include/core/SkXXX.h
|
2017-07-28 15:04:54 +00:00
|
|
|
##
|
2017-08-03 21:14:08 +00:00
|
|
|
|
2017-09-14 15:25:39 +00:00
|
|
|
to write the updated SkXXX.h to the current directory.
|
|
|
|
|
2017-08-03 21:14:08 +00:00
|
|
|
#Subtopic Bugs
|
|
|
|
|
2017-09-21 16:31:06 +00:00
|
|
|
Bookmaker bugs are tracked
|
|
|
|
#A here # bug.skia.org/6898 ##
|
|
|
|
.
|
2017-08-03 21:14:08 +00:00
|
|
|
|
2017-07-28 15:04:54 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
#Topic Bookmaker ##
|