DOCUMENTATION

Project Overview

The Plywood runtime library consists of four main modules and several higher-level libraries, each consisting of a single pair of .h and .cpp files. Whenever a Plywood .h file is included in a project, its corresponding .cpp file should also be compiled and linked in. Each module can be integrated separately depending on the needs of your project. Several sample applications are also included.

Main Modules:

Higher-Level Libraries:

Sample Applications:

  • agent: Command-line agent with built-in web UI.
  • agent-proxy: Protects API keys while working on agent.
  • test-suite: Automated tests to validate Plywood's API-correctness.
  • generate-docs: Generate the HTML version of Plywood's documentation.
  • serve-docs: Serve the HTML documentation locally.
  • banner-comment: Generate banner comments.

Directory Structure

The Plywood repository has the following directory structure. The build and bin folders are excluded from source control.

plywood/
├── src/                        # Library source code.
│   ├── ply-system.h
│   ├── ply-system.cpp
│   ├── ply-math.h
│   ├── ply-math.cpp
│   └── ...
├── docs/                       # Documentation.
│   ├── table-of-contents.md
│   ├── ...
│   └── build/                  # HTML output files written by generate-docs.
├── apps/                       # Sample applications.
│   ├── agent/
│   │   ├── main.cpp
│   │   ├── CMakeLists.txt
│   │   ├── build/              # Intermediate build folder.
│   │   └── ...
│   ├── test-suite/
│   ├── generate-docs/
│   ├── serve-docs/
│   └── banner-comment/
├── share/
│   ├── build-app.sh            # Sample build script.
│   ├── build-app.bat           # Sample build script (Windows).
│   └── ...
├── bin/                        # Output executables.
│   ├── agent[.exe]
│   └── ...
└── agent.json                  # Agent harness settings.

The ply Namespace

All Plywood functions and types are defined in the ply namespace. Some higher-level libraries define nested namespaces, such as ply::markdown. When possible, importing ply into the global namespace is a convenient way to simplify name lookup.

#include <ply-markdown.h>

using namespace ply;  // Import ply into global namespace.

Array<Owned<markdown::Block>> blocks = markdown::parse("Hello, *world!*");