usingBookmaker

Bookmaker

How to use the Bookmaker utility.

Broken Build

If the Housekeeper-PerCommit-Bookmaker bot is red, the bot has detected that the files in docs and include/core differ.

The bot output describes what changed.

To fix this, edit the docs file corresponding to the changed include file.

For instance, if the change was made to SkIRect, edit docs/SkIRect_Reference.bmh. Checking in the edited docs/SkIRect_Reference.bmh will fix the bot.

If the interface is deprecated, but still present in the interface, mark-up the documentation to be deprecated as well.

Use

if the change is soon to be deprecated.

To regenerate the documentation, follow the Installing and Regenerate steps below.

If the Housekeeper-Nightly-Bookmaker bot is red, one of several things may have gone wrong:

The bot output describes what changed, and includes the file and line where the error occurred.

To regenerate the documentation, follow the Installing and Regenerate steps below.

Editing Comments

Edit docs instead of include/core files to update comments if possible.

The Bookmaker bots do not complain if the docs file does not match the corresponding include comments. Running Bookmaker include generation will report when docs and includes comments do not match.

For instance, if include/core/SkSurface.h comments do not match docs/SkSurface_Reference.bmh, running:

generates

The updated SkSurface.h is written to the root to avoid subsequent runs of Bookmaker from recompiling. if SkSurface.h was not changed, it is not written, and Bookmaker will not generate any output.

Broken Example

An example may cause Bookmaker or a bot running Bookmaker to fail if it can't be compiled by fiddle. If the example cannot be fixed, it can be commented out by changing

to

. The disabled example can contain additional markup, which will be ignored.

Installing

Install Go if needed. Get the fiddle command line interface tool. By default this will appear in your home directory.

Build Bookmaker.

Regenerate

Complete rebuilding of all bookmaker output looks like:

New Documentation

Generate an starter Bookmaker file from an existing include.

If a method or function has an unnamed parameter, bookmaker generates an error:

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

.

Next, use your favorite editor to fill out

.

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. It's difficult to think of a meaningful example for class destructors. In cases like these, change the placeholder:

to:

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 or camel 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.

After editing is complete, searching for "" should fail, assuming "" is not the perfect word to use in a description or example!

Adding Documentation

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.

Once complete, run fiddlecli to generate the example hashes. Errors are contained by the output but aren't reported yet.

Generate 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.

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.

Generate an updated include header. Run:

to write the updated SkXXX.h to the current directory.

Once adding the file is complete, add the file to status.json in the Completed section. You may add it to the InProgress section during development, or leave status.json unchanged.

If the new file has been added to status.json, you can run any of the above commands with -a docs/status.json in place of -b docs or -i includes.

Bugs

Bookmaker bugs are tracked here .