Composer CMS: Content Make System

Gary B. Genett

v3.1 (2024-07-03)

Composer CMS

Composer Icon “Creating Made Simple.”
Composer CMS v3.1 License: GPL
Gary B. Genett composer@garybgenett.net

– Formats: webpage / html / pdf / epub / revealjs.html / docx

Overview

Composer is a simple but powerful CMS based on [Pandoc], [Bootstrap] and [GNU Make]. It is a document and website build system that processes directories or individual files in [Markdown] format.

Traditionally, CMS stands for Content Management System. Composer is designed to be a Content Make System. Written content is vastly easier to manage as plain text, which can be crafted with simple editors and tracked with revision control. However, professional documentation, publications, and websites require formatting that is dynamic and feature-rich.

[Pandoc] is an extremely powerful document conversion tool, and is a widely used standard for processing [Markdown] into other formats. While it has reasonable defaults, there are a large number of options, and additional tools are required for some formats and features.

Composer consolidates all the necessary components, simplifies the options, and prettifies the output formats, all in one place. It also serves as a build system, so that large repositories can be managed as documentation archives or published as [Static Websites].

Composer Screenshot

Quick Start

Use make help to get started:

make [-f .../Makefile] [variables] <filename>.<extension>
make [-f .../Makefile] [variables] <target>

Create documents from source [Markdown] files (see Formatting Variables):

make README.html
make Composer-v3.1.Manual.html c_list="README.md LICENSE.md"

Save a persistent configuration (see [Recommended Workflow] and [Configuration Settings]):

make template >.composer.mk
$EDITOR .composer.mk
    override COMPOSER_TARGETS := .targets Composer-v3.1.Manual.html
    override Composer-v3.1.Manual.html := README.md LICENSE.md
make clean
make all

Recursively install and build an entire directory tree (see [Recommended Workflow]):

cd .../documents
mv .../composer .Composer
make -f .Composer/Makefile install-all
make all-all

See help-all for full details and additional targets.

Principles

The guiding principles of Composer:

  • All source files in readable plain text
  • Professional output, suitable for publication
  • Minimal dependencies, and entirely command-line driven
  • Separate content and formatting; writing and publishing are independent
  • Inheritance and dependencies; global, tree, directory and file overrides
  • Fast; both to initiate commands and for processing to complete

Direct support for key document types (see [Document Formatting]):

  • [Static Websites]
  • [HTML]
  • [PDF]
  • [EPUB]
  • [Reveal.js Presentations]
  • [Microsoft Word & PowerPoint]

Requirements

Composer has almost no external dependencies. All needed components are integrated directly into the repository, including [Pandoc] and [YQ]. Composer does require a minimal command-line environment based on [GNU] tools, particularly [GNU Make], which is standard for all [GNU/Linux] systems. The [Windows Subsystem for Linux] for Windows and [MacPorts] for macOS both provide suitable environments.

The one large external requirement is [TeX Live], and it can be installed using the package managers of each of the above systems. It is only necessary for creating [PDF] files.

Below are the versions of the components in the repository, and the tested versions of external tools for this iteration of Composer. Use [check] to validate your system.

Repository Commit License
[Pandoc] 2.18 GPL
[YQ] v4.24.2 MIT
[Bootstrap] v5.1.3 MIT
[Bootlint] v1.1.0 MIT
[Bootswatch] v5.1.3 MIT
[Font Awesome] 6.1.2 MIT / CC-BY
[Water.css] d950cbc9f8607521587f MIT
[Markdown Viewer] 3bd40d84c071379440b3 MIT
[Markdown Themes] 6b3643d0f703727d8472 None
[Reveal.js] 4.3.1 MIT
[Google Firebase] v12.4.7 MIT
Project Composer Version
[GNU Bash] 5.1.16
– [GNU Coreutils] 8.32
– [GNU Findutils] 4.9.0
– [GNU Sed] 4.8
[GNU Make] 4.3
– [Pandoc] 2.18
– [YQ] 4.24.2
– [TeX Live] [PDF] 2021 3.141592653-2.6-1.40.22
Supporting Tools:
– [Git SCM] 2.37.4
– [GNU Diffutils] 3.8
– [Rsync] 3.2.4

[Markdown Viewer] is included both for its CSS stylesheets, and for real-time rendering of [Markdown] files as they are being written. To install, follow the instructions in the README.md.

[Google Firebase] is only necessary for uploading via the [export-all] and [export-force] targets. Binaries are included in the repository, but do not seem to work with all versions of their respective operating systems. If the included binary fails, use +update-firebase-tools to build a local version (see [+update-*]).

The versions of the integrated repositories can be changed, if desired (see [Repository Versions]).

Composer CMS v3.1 :: Help

make [-f .../Makefile] [variables] <filename>.<extension>
make [-f .../Makefile] [variables] <target>

Composer Variables

Formatting Variables

Variable Purpose Value
[c_site] ~ S Enable [Static Websites]
[c_type] ~ T Desired output format html
[c_base] ~ B Base of output file
[c_list] ~ L List of input files(s)
[c_lang] ~ a Language for document headers en-US
[c_logo] ~ g Logo image ([HTML] formats) logo.img
[c_icon] ~ i Icon image ([HTML] formats) icon.img
[c_css] ~ c Location of CSS file theme.html-default.css
[c_toc] ~ t Table of contents depth
[c_level] ~ l Chapter/slide header level 2
[c_margin] ~ m Size of margins ([PDF]) 0.8in
[c_options] ~ o Custom Pandoc options
Values ([c_type]) Format Extension
html HyperText Markup Language *.html
pdf Portable Document Format *.pdf
epub Electronic Publication *.epub
revealjs Reveal.js Presentation *.revealjs.html
docx Microsoft Word *.docx
pptx Microsoft PowerPoint *.pptx
text Plain Text (well-formatted) *.txt
markdown Markdown (for testing) *.md.txt
  • Other [c_type] values will be passed directly to [Pandoc]
  • Special [c_css] values:
    • css_alt = Use the alternate default stylesheet
    • 0 = Revert to the [Pandoc] default
  • Special [c_toc] value: 0 = List all headers, and number sections
  • Special [c_level] value: 0 = Varies by [c_type] (see [c_level])
  • An empty [c_margin] value enables individual margins:
    • c_margin_top ~ mt
    • c_margin_bottom ~ mb
    • c_margin_left ~ ml
    • c_margin_right ~ mr

Control Variables

Variable Purpose Value
[MAKEJOBS] Parallel processing threads 1 (makejobs)
[COMPOSER_DEBUGIT] Use verbose output (debugit)
[COMPOSER_DOCOLOR] Enable title/color sequences (boolean)
[COMPOSER_INCLUDE] Include all: .composer.mk 1 (boolean)
[COMPOSER_DEPENDS] Sub-directories first: [all] (boolean)
[COMPOSER_KEEPING] Log entries / cache files 100 (keeping)
[COMPOSER_LOG] Timestamped command log .composer.log
[COMPOSER_EXT] Markdown file extension .md
[COMPOSER_TARGETS] See: [all]/[clean] [config]/[targets]
[COMPOSER_SUBDIRS] See: [all]/[clean]/[install] [config]/[targets]
[COMPOSER_EXPORTS] See: [c_site]/[export] [config]
[COMPOSER_IGNORES] See: [c_site]/[export] [config]
  • [MAKEJOBS] ~ c_jobs ~ J
  • [COMPOSER_DEBUGIT] ~ c_debug ~ V
  • [COMPOSER_DOCOLOR] ~ c_color ~ C
  • (makejobs) = empty is disabled / number of threads / 0 is no limit
  • (debugit) = empty is disabled / any value enables / 0 is full tracing
  • (keeping) = empty is none / number to keep / 0 is no limit
  • (boolean) = empty is disabled / any value enables

Helper Variables

Variable Purpose Value
[CURDIR] [GNU Make] current directory $PWD :: make
[COMPOSER_CURDIR] Detects [COMPOSER_INCLUDE] [CURDIR] :: .composer.mk
[COMPOSER_DIR] Location of Composer …/composer
[COMPOSER_ROOT] Topmost level of current tree …/composer
[COMPOSER_EXPORT] Target: [export] [COMPOSER_ROOT]/+Composer (mk)
[COMPOSER_LIBRARY] Target: [site]/[site-library] (yml)
[COMPOSER_SRC] Repositories and downloads [COMPOSER_DIR]/.sources
[COMPOSER_ART] Composer supporting files [COMPOSER_DIR]/artifacts
[COMPOSER_DAT] [Pandoc] supporting files [COMPOSER_ART]/pandoc
[COMPOSER_TMP] Cache and working directory [CURDIR]/.composer.tmp
  • (mk) = configurable in .composer.mk
  • (yml) = configurable in .composer.yml

Composer Targets

Primary Targets

Target Purpose
[help] Basic help overview (default)
[help-all] Console version of README.md (no reference sections)
[template] Print settings template: .composer.mk
[template.yml] Print settings template: .composer.yml
[template.md] Print markdown file template
[compose] Document creation engine (see [c_type])
[site] Build [HTML] files as [Static Websites] (see [c_site])
[site-all] Do [site] recursively: [COMPOSER_SUBDIRS]
[site-force] Do [site] recursively: including [COMPOSER_LIBRARY]
[site-clean] Remove [c_site] only: [COMPOSER_LIBRARY]/[COMPOSER_TMP]
[install] Current directory initialization: Makefile
[install-all] Do [install] recursively (no overwrite)
[install-force] Recursively force overwrite of Makefile files
[clean] Remove output files: [COMPOSER_TARGETS] :: [*-clean]
[clean-all] Do [clean] recursively: [COMPOSER_SUBDIRS]
[*-clean] Any targets named this way will also be run by [clean]
[all] Create output files: [COMPOSER_TARGETS] :: [*-all]
[all-all] Do [all] recursively: [COMPOSER_SUBDIRS]
[*-all] Any targets named this way will also be run by [all]
[list] Show updated files: *[COMPOSER_EXT] >> [COMPOSER_LOG]

Additional Targets

Target Purpose
[+release] Upgrade all tools and supporting files to next versions
[+release-all] Also make README.* files and [Static Websites]
[+update] Update all included components (see Requirements)
[+update-all] Additionally perform all source code builds
[+update-list] Show changes made to each (see [Repository Versions])
[+update-*] Complete fetch and build for a specific component
[+debug] Diagnostics, tests targets list in [COMPOSER_DEBUGIT]
[+debug-file] Export [+debug] results to a plain text file
[check] List system packages and versions (see Requirements)
[check-all] Complete [check] package list, and system information
[config] Show values of all Composer Variables
[config-all] Complete [config], including environment variables
[config.*] Export individual Composer Variables values
[config.yml] JSON export of .composer.yml configuration
[targets] List all available targets for the current directory
[init] Create and link a .Composer in current directory
[init-force] Completely reset and relink an existing .Composer
[commit] [Git] commit of current directory tree or [c_list]
[commit-all] Automatic [commit], without $EDITOR step
[export] Synchronize +Composer export of [COMPOSER_ROOT]
[export-all] Also publish to upstream hosting providers
[export-force] Publish only, without synchronizing first
[*-export] Any targets named this way will also be run by [export]
[site-library] Build or update the [COMPOSER_LIBRARY]
[site-list] [COMPOSER_LIBRARY] for current directory or [c_list]
[site-list-all] Do [site-list] for current directory tree
[site-list-list] All metadata fields and values, sorted by most used
[site-list-null] List files which are missing metadata fields
[site-list.*] Direct export of metadata or index, [c_list] searchable

Final Notes

Command Examples

Create documents from source [Markdown] files (see Formatting Variables):

make README.html
make Composer-v3.1.Manual.html c_list="README.md LICENSE.md"

Save a persistent configuration (see [Recommended Workflow] and [Configuration Settings]):

make template >.composer.mk
$EDITOR .composer.mk
    override COMPOSER_TARGETS := .targets Composer-v3.1.Manual.html
    override Composer-v3.1.Manual.html := README.md LICENSE.md
make clean
make all

Recursively install and build an entire directory tree (see [Recommended Workflow]):

cd .../documents
mv .../composer .Composer
make -f .Composer/Makefile install-all
make all-all

See help-all for full details and additional targets.

Go Make A Thing

Happy Making!