0.9.6 • Published 7 years ago

mcargo-checklist-processor v0.9.6

Weekly downloads
13
License
SEE LICENSE IN LI...
Repository
gitlab
Last release
7 years ago

mcargo-checklist-processor

ODS moscow-cargo checklists army knife

Functions

  • Reads source ODS files, which contains checklist chapters, questions and Form controls,
  • Move controls vertically,
  • Takes "Description/Comments" document property as checklist json declaration,
  • Fetches and analyzes form controls as question answers and text fields, pretty prints, show duplicates,
  • Processes 1- and multi-column checklists,
  • Saves result ODS file,
  • Exports as PDF form using Libreoffice export,
  • Patches PDF file input controls (texts and multiline) to enable desired font and cyrillic input using Acrofixer utility (pdf-font-injector subfolder),
  • Upserts checklist (insert or refresh) in desired database,
  • Supports either multi-stage processing or one-shot (ods -> database).

ODS structure

  • Looks for "YES" columns to detect answers checkboxes column index,
  • All chapters and questions starts at -2 (minus 2) column offset from "YES",
  • All 2-column spanned cells detected as chapter headers,
  • Caps-lock chapters are level-1 chapters, Non-caps-lock are level-2,
  • Question is one label column and one text column,
  • Question text and chapter text follows criteria: English text and next Russian text, optional / or // between,
  • Any other cells (wider than 2 columns or starting in wrong offsets) traced but ignored in checklist,
  • Russian text starts at //, any russian letter or «, which comes first (leading / and // trimmed then),
  • Multiquestion (quasi-question) is a question but with no answers, any followed questions with label "–" are inner questions,
  • Empty chapters and questions will be ignored.

Prerequisites

Need node.js, npm, localc (Libreoffice Calc) to work.

Installation

npm i mcargo-checklist-processor or npm i mcargo-checklist-processor -g

Run

mcargo-checklist-processor.js --help

See examples and argument keys description.