1.0.1 • Published 8 months ago

chancellor-cli v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

Chancellor - CLI

A command line interface for the Chancellor content management system with potential to integrate with other systems.

Installation

It is recommended to install Chancellor globally to use the CLI from any directory.

npm install -g chancellor-cli

This will install the chancellor command globally.

Usage

Core Workflows

Render .md to .html

Step 1: Initialse a new Chancellor project in a folder.

chancellor init

This will create a .chancellor folder containing some configuration and template files (some json, css and html).

Step 2: Register one or multiple .md files with Chancellor.

chancellor page --track path/to/file.md

Or, to register all .md files in a folder (and its subfolders):

chancellor page --track path/to/folder

Step 3: Render the .md files to .html.

chancellor run render

The rendered .html files will be located next to the corresponding .md files.

Registering Modules

Assumption: Step 1 and Step 2 from the Render .md to .html workflow have been completed.

Step 1: Create a new Chancellor module

chancellor module --new "Module Name"

Step 2: Add pages to the module

chancellor module "Module Name" --add-page ./path/to/page.md

It is also possible to add all tracked pages in a folder to a module:

chancellor module "Module Name" --add-page ./path/to/folder

Canvas Workflows

Deploying tracked pages to Canvas

The following workflow will deploy all tracked pages to Canvas, but they will not be displayed in any modules unless added to one (see above).

Assumption: Step 1 and Step 2 from the Basic Workflow have been completed, and you have a Token and URL for the Canvas API.

!IMPORTANT

Configure your Canvas API URL and Token

Before using the CLI, you must configure your Canvas API URL and Token using chancellor config:

chancellor config --url <url> --token <token>

To verify that the configuration is correct, run:

chancellor config

This will display the current url and token values.

Step 1: Initialise the Canvas integration with Chancellor.

chancellor canvas-init --course <course_id>

Step 2: Link Canvas pages to Chancellor pages

chancellor canvas-link ./path/to/page.md <canvas_page_url>

Repeat this step for all pages that should be linked. Chancellor pages without links will be uploaded to Canvas as new pages (and automatically linked).

One Canvas page can be linked to only one Chancellor page, but one Chancellor page can be linked to multiple Canvas pages.

Step 3: Run the workflow

chancellor run canvas-deploy

This will upload all Chancellor pages to Canvas and link them to the corresponding Canvas pages. Modules will be created in Canvas if they do not exist.

Examples

The following commands will update the first 3 modules of CAB432 to Canvas:

  1. Initialise a chancellor project in the current directory.
  2. Track all markdown files, and create modules for each folder.
  3. Initialise a Canvas course linked to the ID 909.
  4. Upload all pages to Canvas.
chancellor init
chancellor page --track .
chancellor module --new "Week 0: Accessing the Cloud" --add-page "module_0"
chancellor module --new "Week 1: Introduction to Cloud Computing" --add-page "module_1"
chancellor module --new "Week 2: Docker and Containers" --add-page "module_2"
chancellor canvas-init --course 909
chancellor run canvas-deploy