The goal of the chapter is to get you familiarized with certain terms and keywords that we will use throughout the book and how to use the UI.
Navigating through the book
We have designed the book in a way that it is user-friendly and navigating
through the book is extremely easy. Let's talk about the
Table of contents
first. It contains a list of all the chapters along with the sub-sections in
each of the chapters.
If you look in the picture below, you can see that each item in the list contains the title of the chapter along with a list of all the sub-sections inside the chapter. Clicking on a title will take you to the respective chapter and clicking on a sub-section item will take you directly to that particular section in the chapter.
You can also press
cmd + f or
ctrl +f keys to search for keywords inside the
table of contents.
Searching within the book
You can search for keywords within the book. If you navigate to the top-right corner of the book you will notice a search bar present. Clicking on it will open a search dialog box.
Type in the keywords you wish to search and you will get a list of items matching search parameters. You can click on any of the search items and you will be directed to the relevant section within the book.
You can also use the
cmd + k or
ctrl + k shortcut keys to open the search
dialog box. To navigate through the search results, you can either use the mouse
down arrow keys. When you press the
enter key on one of
the results, you will be taken to the exact paragraph within the book which
contains that keyword.
To close the search dialog box, you can either click on the
close icon on
top-right corner of the dialog box or press the
What is an example?
There are two types of code-snippets in this book. One which the reader is supposed to copy and paste to their project and the other category is examples.
Examples are merely there to explain a concept and an example code is not a part
of the application code. There might be instances where the examples are taken
Granite application itself.
Do not copy and paste an example code-snippet to your project as it might lead to unexpected errors and bugs in the application.
It is explicitly mentioned inside the book for each code-snippet if it is supposed to be copied to your project or if it is an example.
The following is an example of the type of code that we DON'T want you to copy-paste into the application codebase:
But if we have explicitly mentioned to add to the codebase, then you should add it. The following is an example for the type of code we want you to copy-paste into the application:
How to copy and paste code?
There are two ways to copy a code-snippet from this book and paste it inside your application.
One way is to manually drag and select the code to be copied and then paste it into the respective file within the project.
Or you can hover on the top-right corner of the code enclosing block and a copy icon will appear. Clicking on that icon will copy the code, which you can then paste into the desired file within the project.
When to copy-paste code?
As mentioned previously in this chapter, do not copy and paste a code snippet unless it is explicitly mentioned to do so in the surrounding sentences. Doing otherwise can lead to errors and bugs in your application.