Table of contents
1.
Introduction
2.
Documenting Cinder
2.1.
Docs Generation Process
2.2.
Docs File Structure
3.
Documenting Source Code
4.
External Documentation
4.1.
The <ci> tag
4.2.
Writing Guides
4.3.
The config file
5.
Frequently Asked Questions
5.1.
What is Cinder? 
5.2.
What is CinderBlocks? 
5.3.
What is TinderBox?
5.4.
What is the source pattern element used for?
5.5.
What language is Cinder?
6.
Conclusion
Last Updated: Mar 27, 2024

Documenting Cinder

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

To improve the capacity of the C++ language for advanced visualization, Cinder, an open-source library, was developed. In the spring of 2010, it was made generally available. It is comparable to the open Frameworks built on Cpp. While openFrameworks provides better control over its underlying libraries, Cinder uses more system-specific libraries to achieve higher performance.

Documenting Cinder

Cinder, as opposed to Flash and Silverlight, is frequently used outside of a browser. The speed provided by C++ makes the library more appropriate for more abstract applications like art installations, advertising campaigns, and other advanced animation tasks.

Documenting Cinder

The Cinder community encourages anyone interested in helping to document the library or writing tutorials to help other developers advance their understanding of the library as an open-source project. 

Cinder

This documentation can be contributed to in a variety of ways.

Docs Generation Process

A two-step process for creating Cinder documentation

  1. Exporting source code documentation
  2. HTML generation and integration with guides

Docs File Structure

This is a quick summary of the new directory layout. If you don't generate the documents, you won't see the names of the dynamically generated files and folders that are indicated in grey.

doxygen/ for doxygen related files and configuration
cinder.tag (generated by Doxywizard)  contains library source file data and relationships
Doxyfile Export configuration for Doxygen/DoxyWizard
html/ (generated by generateDocs.py) contains final HTML and asset files
htmlsrc/  contains all HTML source files, including CSS, JavaScript, Mustache templates, and images
_assets/ contains all CSS, images, and JavaScript files used throughout the docs
_docs/ contains all supplemental class documentation
_templates/  Mustache/HTML templates used by the Python script to generate docs with
guides/  source files for all guides
index.html markup for the index page
reference/ source files for reference pages
libs/  Python libraries used by generateDocs.py
stylesrc/  contains style source files, including Stylus (which is the preprocessor of choice) source files and a gulp config file.
- xml/ (generated by DoxyWizard) - all of the files containing data for each source file documentation page.

Documenting Source Code

The Doxygen export process converts all of the inline comments seen in the Cinder source code into documentation. For instance, you might notice block comments above each method that resemble this if you open a header file.

[from Surface.h]
/** \brief creates a Surface concurrently from photos located at a route. Returning the loaded Surface in a surface.
Use this technique if you want to create a Surface from an image that isn't in the WinRT Windows Store App folder.
**/

or simple remarks like this

//! Provides the Surface's width in pixels.

A portion of doxygen markdown is supported if you decide to contribute to the inline source documentation, including but not restricted to:

  • Adding inline links: [The link text](http://example.net/)
  • Code Block Indentation
  • \a <word> in italics
  • \p <word> for monospace font
  • \see { references }

Observe that not. It is strongly advised that you instead contribute to external documentation, as explained below if you want to accomplish anything complicated.

External Documentation

There is a different method for writing extra documentation and guides for the documents. It may be found in the htmlsrc/ directory and is all written in HTML. For further information, see the Docs File Structure. You will primarily be interested in the _docs and guidelines directories unless you are contributing to the markup of the entire documentation site. While the guides directory has all of the content for the Cinder guidelines, the _docs directory contains markup and other files for class descriptions. Let's examine the ci> tag first before getting into the mechanics of authoring each form of an external document.

The <ci> tag

We've developed a new ci> tag to help bridge the gap between the Cinder source reference sites and the additional HTML markup. This element is utilized to both offer a mechanism for reference pages to connect back to our guides and to specify any HTML material found in the supplemental documentation that needs to be linked to the source reference.

Use-Cases for the <ci> tag are:

  • The creation of a link to a source documentation page
  •  Providing a description for a particular class, interface, or struct
  • To connect a manual to a certain class reference page

Writing Guides

The steps below should be followed while writing a tutorial for the Cinder documentation:

  1. Within the docs/htmlsrc/guides directory, make a new directory. The directory's name must be succinct and informative (ex: audio, mac-setup, cinder-blocks, etc.)
  2. Copy the contents of the HTML file located at _start-here/start-here.html into a new index.html file that you create in your new directory. All of the CSS and JavaScript connections utilized in the resulting HTML directory are included in the file. Although not necessary, this will provide you with a precise glimpse of how your guide will seem after integration.
  3. Create your manual with HTML. If you'd like, you can use your own JavaScript and CSS.
  4. Make a configuration file if your site has many pages.
  5. Incorporate searchable meta keywords into the documents..
  6. Any classes that may be relevant should have any ci> see also tags added (That is also part of configuring multiple pages).
  7. Make a GitHub pull request.

The config file

If your guide has numerous pages, you can optionally include a config.json file for your convenience. Instead of having to specify meta keywords for every page in your guide, you can use this file to specify the pages that come into the guide for sub-navigation.

This is an example taken from the Path2d guide:

{
"data":{
// keywords for finding this guide via search
"metadata":
{
"keywords": ["path2d", "shape2d", "bezier", "curves", "path", "lines"]
},
// subnavigation for every page of the guide
"subnav":[
{
"label": "Part 1", // label for the subnav link
"link": "part1.html" // link for the subnav link
},
{
"label": "Part 2",
"link": "part2.html"
},
{
"label": "Part 3",
"link": "part3.html"
}
],
"seealso":
{
"label": "Path2d Guide", // label for the see also link(s)
"dox": ["ci::Path2d", "ci::Shape2d"] // classes to be linked from
}
}
}

Frequently Asked Questions

What is Cinder? 

The capabilities of the C++ language for sophisticated visualization were improved with the creation of an open-source package called Cinder. In many aspects, it can be thought of as a C++-based replacement for technologies such as the Java-based Processing library, Microsoft Silverlight, or Adobe Flash.

What is CinderBlocks? 

A CinderBlock is a pre-built set of code and libraries that executes a feature or provides a library in Cinder. This comprises bridges to packages like OpenCV and FMOD as well as standalone implementations of features like TUIO support. Built-in CinderBlocks that come by default with Cinder are QuickTime and the LocationManager. The source code, header files, libraries, and other components that a CinderBlock requires may be included. 

What is TinderBox?

Although using TinderBox, Cinder's application-building tool is the simplest way to use CinderBlocks. It is not essential to do so; a skilled C++ user can easily add a CinderBlock to a project.

What is the source pattern element used for?

With the syntax src/*.cpp, all files matching the pattern, including wildcards (*), are included as references.

What language is Cinder?

Cinder is in C++ language.

Conclusion

This article discussed all about documenting Cinder. Further we also discussed Docs Generation Process, Docs File Structure and External documentation for Cinder. To enhance your knowledge on Cinder, check these blogs-

Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc. Enroll in our courses and refer to the mock test and problems available; look at the Top 150 Interview Puzzles interview experiences, and interview bundle for placement preparations. Read our blogs on aptitudecompetitive programminginterview questionsIT certifications, and data structures and algorithms for the best practice.

Live masterclass