chancellor-cli v1.0.1
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-cliThis will install the chancellor command globally.
Usage
Core Workflows
Render .md to .html
Step 1: Initialse a new Chancellor project in a folder.
chancellor initThis 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.mdOr, to register all .md files in a folder (and its subfolders):
chancellor page --track path/to/folderStep 3: Render the .md files to .html.
chancellor run renderThe 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.mdIt is also possible to add all tracked pages in a folder to a module:
chancellor module "Module Name" --add-page ./path/to/folderCanvas 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.
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 configThis will display the current
urlandtokenvalues.
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-deployThis 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:
- Initialise a
chancellorproject in the current directory. - Track all markdown files, and create modules for each folder.
- Initialise a Canvas course linked to the ID
909. - 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