Skip to content

Generating HTML Documentation

Mark Millard edited this page Apr 22, 2024 · 15 revisions

These instructions describe how to construct documentation for browsing the glTF Schema.

Installation Instructions for Json Schema For Humans

This section provides information on how to generate HTML documentation for the glTF 1.0 and glTF 2.0 specifications using the Open Source tool, Json Schema for Humans.

Dependencies

  1. Ubuntu 22.04 64-bit Linux
  2. Python3
  3. pip
  4. json-schema-for-humans

Install Python

Instructions for installing python3 can be found at Python Development Environment.

Retrieve glTF 1.0 JSON schema

git clone https://github.com/KhronosGroup/glTF.git`

Copy the 1.0 schema files ('*.schema.json' files located under 'specifications/1.0/schema' directory) to a working directory in the QtglTFTest project. For example:

cd QtglTFTest
mkdir -p doc/json-schema-for-humans/glTF-1.0-schema
cp <glTF project dir>/specifications/1.0/schema/*.schema.json doc/json-schema-for-humans/glTF-1.0-schema

Install and Configure Json Schema for Humans

Use the Python "pip" command to install Json Schema for Humans:

pip install json-schema-for-humans

The json-scema-for-humans programs will be installed to '$HOME/.local/bin'. Add this directory to your PATH:

export PATH=$HOME/.local/bin:$PATH

Run Json Schema for Humans

Instructions for running Json Schema for humans can be found at this pypi.org web site

Basically, do the following in the QtglTFTest project:

mkdir -p doc/json-schema-for-humans/html
cd doc/json-schema-for-humans/html
generate-schema-doc ../glTF-1.0-schema

Installation Instructions for matic [Deprecated]

Note

This use to work, but it now appears to be broken due to a Pug error.

This section provides information on how to generate HTML documentation for the glTF 1.0 specification using the Open Source tool, matic.

Dependencies

  1. Node.js, version 0.10.25
  2. Matic (https://github.com/mattyod/matic)
  3. Pug https://www.npmjs.com/package/pug) - formally known as Jade

Install Node.js

To install Node.js, type the following command in your terminal:

$ sudo apt-get install nodejs

Then install the Node package manager, npm:

$ sudo apt-get install npm

Create a symbolic link for node, as many Node.js tools use this name to execute.

$ sudo ln -s /usr/bin/nodejs /usr/bin/node

Now you should have both the Node and npm commands working:

$ node -v  
v12.22.9
$ npm -v  
8.5.1

Retrieve glTF 1.0 JSON schema

$ git clone https://github.com/KhronosGroup/glTF.git

Copy the 1.0 schema files ('*.schema.json' files located under '1.0/schema' directory) to a working directory.

Install and Configure Matic

Matic is a build tool for generating HTML documentation from JSON schemas

Install the Node.js matic package:

$ sudo npm install -g matic

Install Pug (Jade)

$ sudo npm install -g pug

Run Matic

In the working directory, do

matic