@thegetty/quire-cli 1.0.0-rc.45 → 1.0.0-rc.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -36
- package/README.md +0 -9
- package/bin/cli.js +1 -46
- package/package.json +10 -27
- package/src/Command.js +6 -26
- package/src/commands/README.md +122 -213
- package/src/commands/build.js +37 -45
- package/src/commands/clean.js +19 -33
- package/src/commands/conf.js +43 -0
- package/src/commands/create.js +14 -42
- package/src/commands/epub.js +31 -67
- package/src/commands/index.js +2 -9
- package/src/commands/info.js +86 -88
- package/src/commands/pdf.js +82 -63
- package/src/commands/preview.js +31 -32
- package/src/commands/validate.js +20 -64
- package/src/commands/version.js +43 -0
- package/src/errors/validation/validation-error.js +11 -20
- package/src/helpers/clean.js +1 -1
- package/src/helpers/is-quire.js +31 -0
- package/src/helpers/test-cwd.js +6 -5
- package/src/helpers/which.js +4 -10
- package/src/lib/11ty/README.md +19 -135
- package/src/lib/11ty/api.js +93 -235
- package/src/lib/11ty/cli.js +37 -112
- package/src/lib/11ty/index.js +5 -64
- package/src/lib/11ty/paths.js +103 -0
- package/src/lib/README.md +0 -330
- package/src/lib/conf/README.md +69 -86
- package/src/lib/conf/config.js +3 -5
- package/src/lib/conf/defaults.js +0 -65
- package/src/lib/conf/schema.js +9 -103
- package/src/lib/epub/README.md +2 -133
- package/src/lib/epub/epub.js +11 -36
- package/src/lib/epub/index.js +21 -111
- package/src/lib/epub/pandoc.js +4 -33
- package/src/lib/git/README.md +2 -151
- package/src/lib/git/index.js +13 -217
- package/src/lib/i18n/README.md +3 -0
- package/src/lib/i18n/config.js +53 -0
- package/src/lib/i18n/index.js +43 -0
- package/src/lib/i18n/localeService.js +58 -0
- package/src/lib/pdf/README.md +0 -131
- package/src/lib/pdf/index.js +21 -124
- package/src/lib/pdf/paged.js +52 -100
- package/src/lib/pdf/prince.js +37 -115
- package/src/lib/pdf/split.js +33 -61
- package/src/lib/quire/README.md +19 -0
- package/src/lib/quire/index.js +353 -0
- package/src/lib/reporter/README.md +2 -211
- package/src/lib/reporter/index.js +0 -607
- package/src/main.js +48 -221
- package/src/packageConfig.js +0 -17
- package/src/validators/utils.js +1 -2
- package/man/quire.1 +0 -341
- package/man/quire.1.md +0 -232
- package/schemas/config.schema.json +0 -194
- package/schemas/figures.schema.json +0 -56
- package/schemas/layout.schema.json +0 -5
- package/schemas/objects.schema.json +0 -62
- package/schemas/publication.schema.json +0 -140
- package/schemas/references.schema.json +0 -29
- package/src/Command.spec.js +0 -99
- package/src/commands/build.spec.js +0 -113
- package/src/commands/build.test.js +0 -397
- package/src/commands/clean.spec.js +0 -118
- package/src/commands/clean.test.js +0 -382
- package/src/commands/config.js +0 -238
- package/src/commands/config.spec.js +0 -107
- package/src/commands/config.test.js +0 -845
- package/src/commands/create.spec.js +0 -112
- package/src/commands/create.test.js +0 -415
- package/src/commands/doctor.js +0 -251
- package/src/commands/doctor.spec.js +0 -115
- package/src/commands/doctor.test.js +0 -1409
- package/src/commands/epub.spec.js +0 -114
- package/src/commands/epub.test.js +0 -503
- package/src/commands/help.js +0 -60
- package/src/commands/help.test.js +0 -132
- package/src/commands/info.spec.js +0 -72
- package/src/commands/info.test.js +0 -512
- package/src/commands/pdf.spec.js +0 -114
- package/src/commands/pdf.test.js +0 -464
- package/src/commands/preview.spec.js +0 -97
- package/src/commands/preview.test.js +0 -250
- package/src/commands/use.js +0 -56
- package/src/commands/use.spec.js +0 -61
- package/src/commands/use.test.js +0 -280
- package/src/commands/validate.spec.js +0 -90
- package/src/commands/validate.test.js +0 -378
- package/src/commands/workflows.js +0 -70
- package/src/errors/build/build-failed-error.js +0 -19
- package/src/errors/build/config-field-missing-error.js +0 -20
- package/src/errors/build/config-file-not-found-error.js +0 -20
- package/src/errors/build/index.js +0 -11
- package/src/errors/help/help-topic-not-found-error.js +0 -30
- package/src/errors/help/index.js +0 -8
- package/src/errors/index.js +0 -58
- package/src/errors/input/index.js +0 -8
- package/src/errors/input/invalid-input-error.js +0 -21
- package/src/errors/install/dependency-install-error.js +0 -19
- package/src/errors/install/directory-not-empty-error.js +0 -25
- package/src/errors/install/index.js +0 -12
- package/src/errors/install/invalid-path-error.js +0 -31
- package/src/errors/install/invalid-starter-error.js +0 -27
- package/src/errors/install/version-not-found-error.js +0 -35
- package/src/errors/output/epub-generation-error.js +0 -19
- package/src/errors/output/index.js +0 -14
- package/src/errors/output/invalid-epub-library-error.js +0 -20
- package/src/errors/output/invalid-pdf-library-error.js +0 -20
- package/src/errors/output/missing-build-output-error.js +0 -21
- package/src/errors/output/pdf-generation-error.js +0 -24
- package/src/errors/output/tool-not-found-error.js +0 -37
- package/src/errors/project/index.js +0 -10
- package/src/errors/project/not-in-project-error.js +0 -20
- package/src/errors/project/project-create-error.js +0 -21
- package/src/errors/quire-error.js +0 -27
- package/src/errors/validation/index.js +0 -3
- package/src/errors/validation/unknown-config-key-error.js +0 -27
- package/src/errors/validation/unknown-config-operation-error.js +0 -24
- package/src/helpers/docs-url.js +0 -32
- package/src/helpers/pager.js +0 -59
- package/src/helpers/pager.test.js +0 -85
- package/src/helpers/suggest-similar.js +0 -124
- package/src/helpers/suggest-similar.test.js +0 -108
- package/src/helpers/test-cwd.test.js +0 -192
- package/src/lib/11ty/index.test.js +0 -655
- package/src/lib/commander/index.js +0 -103
- package/src/lib/commander/index.test.js +0 -86
- package/src/lib/commander/options.js +0 -237
- package/src/lib/commander/options.test.js +0 -205
- package/src/lib/conf/build-status.js +0 -103
- package/src/lib/conf/build-status.test.js +0 -247
- package/src/lib/conf/config.test.js +0 -281
- package/src/lib/conf/format.js +0 -60
- package/src/lib/conf/format.test.js +0 -106
- package/src/lib/conf/helpers.js +0 -91
- package/src/lib/conf/helpers.test.js +0 -136
- package/src/lib/conf/index.js +0 -22
- package/src/lib/constants.js +0 -28
- package/src/lib/doctor/README.md +0 -667
- package/src/lib/doctor/checks/environment/cli-version.js +0 -62
- package/src/lib/doctor/checks/environment/cli-version.test.js +0 -132
- package/src/lib/doctor/checks/environment/git-available.js +0 -77
- package/src/lib/doctor/checks/environment/git-available.test.js +0 -52
- package/src/lib/doctor/checks/environment/index.js +0 -13
- package/src/lib/doctor/checks/environment/node-version.js +0 -66
- package/src/lib/doctor/checks/environment/node-version.test.js +0 -17
- package/src/lib/doctor/checks/environment/npm-available.js +0 -66
- package/src/lib/doctor/checks/environment/npm-available.test.js +0 -52
- package/src/lib/doctor/checks/environment/os-info.js +0 -48
- package/src/lib/doctor/checks/environment/os-info.test.js +0 -81
- package/src/lib/doctor/checks/environment/runtime-info.js +0 -51
- package/src/lib/doctor/checks/environment/runtime-info.test.js +0 -132
- package/src/lib/doctor/checks/outputs/epub-output.js +0 -119
- package/src/lib/doctor/checks/outputs/epub-output.test.js +0 -277
- package/src/lib/doctor/checks/outputs/index.js +0 -10
- package/src/lib/doctor/checks/outputs/pdf-output.js +0 -144
- package/src/lib/doctor/checks/outputs/pdf-output.test.js +0 -377
- package/src/lib/doctor/checks/outputs/stale-build.js +0 -122
- package/src/lib/doctor/checks/outputs/stale-build.test.js +0 -282
- package/src/lib/doctor/checks/project/data-files.js +0 -56
- package/src/lib/doctor/checks/project/data-files.test.js +0 -125
- package/src/lib/doctor/checks/project/dependencies.js +0 -53
- package/src/lib/doctor/checks/project/dependencies.test.js +0 -71
- package/src/lib/doctor/checks/project/index.js +0 -11
- package/src/lib/doctor/checks/project/quire-11ty.js +0 -98
- package/src/lib/doctor/checks/project/quire-11ty.test.js +0 -170
- package/src/lib/doctor/checks/project/quire-project.js +0 -38
- package/src/lib/doctor/checks/project/quire-project.test.js +0 -47
- package/src/lib/doctor/checks/tools/index.js +0 -10
- package/src/lib/doctor/checks/tools/pandoc-available.js +0 -82
- package/src/lib/doctor/checks/tools/pandoc-available.test.js +0 -73
- package/src/lib/doctor/checks/tools/prince-available.js +0 -81
- package/src/lib/doctor/checks/tools/prince-available.test.js +0 -73
- package/src/lib/doctor/constants.js +0 -39
- package/src/lib/doctor/formatDuration.js +0 -108
- package/src/lib/doctor/formatDuration.test.js +0 -76
- package/src/lib/doctor/formatters/human.js +0 -257
- package/src/lib/doctor/formatters/human.test.js +0 -463
- package/src/lib/doctor/formatters/index.js +0 -8
- package/src/lib/doctor/formatters/json.js +0 -78
- package/src/lib/doctor/formatters/json.test.js +0 -174
- package/src/lib/doctor/formatters/shared.js +0 -129
- package/src/lib/doctor/formatters/shared.test.js +0 -194
- package/src/lib/doctor/index.js +0 -271
- package/src/lib/doctor/index.test.js +0 -797
- package/src/lib/epub/engines.js +0 -46
- package/src/lib/epub/index.test.js +0 -518
- package/src/lib/epub/pandoc.test.js +0 -122
- package/src/lib/epub/schema.js +0 -21
- package/src/lib/error/README.md +0 -170
- package/src/lib/error/handler.js +0 -107
- package/src/lib/git/index.spec.js +0 -80
- package/src/lib/git/index.test.js +0 -453
- package/src/lib/help/frontmatter.js +0 -77
- package/src/lib/help/frontmatter.test.js +0 -139
- package/src/lib/help/index.js +0 -146
- package/src/lib/help/index.test.js +0 -188
- package/src/lib/help/topics/configuration.md +0 -77
- package/src/lib/help/topics/debugging.md +0 -69
- package/src/lib/help/topics/epub.md +0 -74
- package/src/lib/help/topics/pdf.md +0 -74
- package/src/lib/help/topics/publishing.md +0 -80
- package/src/lib/help/topics/workflows.md +0 -50
- package/src/lib/installer/index.js +0 -309
- package/src/lib/installer/index.spec.js +0 -83
- package/src/lib/installer/index.test.js +0 -545
- package/src/lib/logger/README.md +0 -424
- package/src/lib/logger/debug.js +0 -132
- package/src/lib/logger/debug.spec.js +0 -130
- package/src/lib/logger/debug.test.js +0 -128
- package/src/lib/logger/index.js +0 -228
- package/src/lib/logger/index.spec.js +0 -131
- package/src/lib/logger/index.test.js +0 -578
- package/src/lib/npm/README.md +0 -127
- package/src/lib/npm/index.js +0 -198
- package/src/lib/npm/index.spec.js +0 -60
- package/src/lib/npm/index.test.js +0 -355
- package/src/lib/pdf/engines.js +0 -46
- package/src/lib/pdf/index.test.js +0 -708
- package/src/lib/pdf/paged.test.js +0 -366
- package/src/lib/pdf/prince.test.js +0 -202
- package/src/lib/pdf/schema.js +0 -21
- package/src/lib/pdf/split.test.js +0 -445
- package/src/lib/platform.js +0 -95
- package/src/lib/process/manager.js +0 -110
- package/src/lib/process/manager.test.js +0 -55
- package/src/lib/project/build.js +0 -162
- package/src/lib/project/build.test.js +0 -275
- package/src/lib/project/config.js +0 -48
- package/src/lib/project/config.test.js +0 -134
- package/src/lib/project/detect.js +0 -47
- package/src/lib/project/detect.test.js +0 -157
- package/src/lib/project/index.js +0 -56
- package/src/lib/project/output-paths.js +0 -87
- package/src/lib/project/output-paths.test.js +0 -66
- package/src/lib/project/paths.js +0 -272
- package/src/lib/project/version.js +0 -110
- package/src/lib/project/version.test.js +0 -350
- package/src/lib/reporter/index.test.js +0 -862
- package/src/main.spec.js +0 -61
- package/src/main.test.js +0 -347
- package/src/validators/validate-data-files.js +0 -154
- package/src/validators/validate-data-files.test.js +0 -217
package/src/lib/help/index.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Help topics module
|
|
3
|
-
*
|
|
4
|
-
* Provides loading and rendering of help topics from markdown files.
|
|
5
|
-
* Topics are stored in the topics/ directory as markdown files with
|
|
6
|
-
* YAML frontmatter for metadata.
|
|
7
|
-
*
|
|
8
|
-
* @module lib/help
|
|
9
|
-
*/
|
|
10
|
-
import fs from 'fs-extra'
|
|
11
|
-
import { marked } from 'marked'
|
|
12
|
-
import { markedTerminal } from 'marked-terminal'
|
|
13
|
-
import path from 'node:path'
|
|
14
|
-
import { fileURLToPath } from 'node:url'
|
|
15
|
-
import { HelpTopicNotFoundError } from '#src/errors/index.js'
|
|
16
|
-
import { extractFrontmatter, stripFrontmatter } from './frontmatter.js'
|
|
17
|
-
|
|
18
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
19
|
-
const __dirname = path.dirname(__filename)
|
|
20
|
-
|
|
21
|
-
// Nota bene: env var override for development/testing only, not user-configurable
|
|
22
|
-
const TOPICS_DIR =
|
|
23
|
-
process.env.QUIRE_HELP_TOPICS_DIR || path.join(__dirname, 'topics');
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Topic metadata extracted from markdown frontmatter
|
|
27
|
-
* @typedef {Object} TopicMeta
|
|
28
|
-
* @property {string} name - Topic identifier (filename without .md)
|
|
29
|
-
* @property {string} title - Display title
|
|
30
|
-
* @property {string} description - Brief description for listing
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* List all available help topics
|
|
35
|
-
* @returns {Promise<TopicMeta[]>} Array of topic metadata sorted by name
|
|
36
|
-
*/
|
|
37
|
-
async function listTopics() {
|
|
38
|
-
if (!await fs.pathExists(TOPICS_DIR)) {
|
|
39
|
-
return []
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const files = await fs.readdir(TOPICS_DIR)
|
|
43
|
-
const topics = []
|
|
44
|
-
|
|
45
|
-
for (const file of files) {
|
|
46
|
-
if (!file.endsWith('.md')) continue
|
|
47
|
-
|
|
48
|
-
const name = path.basename(file, '.md')
|
|
49
|
-
const content = await fs.readFile(path.join(TOPICS_DIR, file), 'utf-8')
|
|
50
|
-
const meta = extractFrontmatter(content)
|
|
51
|
-
|
|
52
|
-
topics.push({
|
|
53
|
-
name,
|
|
54
|
-
title: meta.title || name,
|
|
55
|
-
description: meta.description || ''
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return topics.sort((a, b) => a.name.localeCompare(b.name))
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Get available topic names from the topics directory
|
|
64
|
-
* @returns {Promise<string[]>} Topic names (filenames without .md)
|
|
65
|
-
*/
|
|
66
|
-
async function getTopicNames() {
|
|
67
|
-
if (!await fs.pathExists(TOPICS_DIR)) return []
|
|
68
|
-
const files = await fs.readdir(TOPICS_DIR)
|
|
69
|
-
return files.filter((f) => f.endsWith('.md')).map((f) => path.basename(f, '.md'))
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Load a help topic by name
|
|
74
|
-
* @param {string} name - Topic name (without .md extension)
|
|
75
|
-
* @returns {Promise<string>} Topic content
|
|
76
|
-
* @throws {HelpTopicNotFoundError} If topic does not exist
|
|
77
|
-
*/
|
|
78
|
-
async function loadTopic(name) {
|
|
79
|
-
const filePath = path.join(TOPICS_DIR, `${name}.md`)
|
|
80
|
-
|
|
81
|
-
if (!await fs.pathExists(filePath)) {
|
|
82
|
-
const validTopics = await getTopicNames()
|
|
83
|
-
throw new HelpTopicNotFoundError(name, validTopics)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const content = await fs.readFile(filePath, 'utf-8')
|
|
87
|
-
return stripFrontmatter(content)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Render markdown content for terminal display
|
|
92
|
-
* @param {string} content - Markdown content
|
|
93
|
-
* @returns {string} Rendered content for terminal
|
|
94
|
-
*/
|
|
95
|
-
function renderTopic(content) {
|
|
96
|
-
marked.use(markedTerminal())
|
|
97
|
-
return marked.parse(content).trimEnd()
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Format topic list for display
|
|
102
|
-
* @param {TopicMeta[]} topics - Array of topic metadata
|
|
103
|
-
* @returns {string} Formatted topic list
|
|
104
|
-
*/
|
|
105
|
-
function formatTopicList(topics) {
|
|
106
|
-
if (topics.length === 0) {
|
|
107
|
-
return 'No help topics available.'
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const lines = ['Available help topics:\n']
|
|
111
|
-
topics.forEach(({ name, description }) => {
|
|
112
|
-
lines.push(` ${name.padEnd(16)} ${description}`)
|
|
113
|
-
})
|
|
114
|
-
lines.push('\nRun "quire help <topic>" for detailed information.')
|
|
115
|
-
lines.push('Run "quire <command> --help" for command-specific options.')
|
|
116
|
-
|
|
117
|
-
return lines.join('\n')
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Get formatted list of available help topics
|
|
122
|
-
* @returns {Promise<string>} Formatted topic list for display
|
|
123
|
-
*/
|
|
124
|
-
export async function getTopicList() {
|
|
125
|
-
const topics = await listTopics()
|
|
126
|
-
return formatTopicList(topics)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Get formatted help content for a topic
|
|
131
|
-
* @param {string} name - Topic name
|
|
132
|
-
* @returns {Promise<string>} Rendered topic content
|
|
133
|
-
* @throws {HelpTopicNotFoundError} If topic does not exist
|
|
134
|
-
*/
|
|
135
|
-
export async function getTopicContent(name) {
|
|
136
|
-
const content = await loadTopic(name)
|
|
137
|
-
return renderTopic(content)
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Get the topics directory path (for testing)
|
|
142
|
-
* @returns {string} Path to topics directory
|
|
143
|
-
*/
|
|
144
|
-
export function getTopicsDir() {
|
|
145
|
-
return TOPICS_DIR
|
|
146
|
-
}
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import esmock from 'esmock'
|
|
2
|
-
import path from 'node:path'
|
|
3
|
-
import sinon from 'sinon'
|
|
4
|
-
import test from 'ava'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Help Topics Library Tests
|
|
8
|
-
*
|
|
9
|
-
* Tests the help topics public API.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
test.beforeEach((t) => {
|
|
13
|
-
t.context.sandbox = sinon.createSandbox()
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
test.afterEach.always((t) => {
|
|
17
|
-
t.context.sandbox.restore()
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
test('getTopicList() returns formatted list of topics', async (t) => {
|
|
21
|
-
const { sandbox } = t.context
|
|
22
|
-
|
|
23
|
-
const mockFs = {
|
|
24
|
-
pathExists: sandbox.stub().resolves(true),
|
|
25
|
-
readdir: sandbox.stub().resolves(['workflows.md', 'debugging.md']),
|
|
26
|
-
readFile: sandbox.stub()
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
mockFs.readFile.withArgs(sinon.match(/workflows\.md/), 'utf-8').resolves(`---
|
|
30
|
-
title: Common Workflows
|
|
31
|
-
description: Step-by-step guides
|
|
32
|
-
---
|
|
33
|
-
# Workflows`)
|
|
34
|
-
|
|
35
|
-
mockFs.readFile.withArgs(sinon.match(/debugging\.md/), 'utf-8').resolves(`---
|
|
36
|
-
title: Debugging
|
|
37
|
-
description: Troubleshooting help
|
|
38
|
-
---
|
|
39
|
-
# Debugging`)
|
|
40
|
-
|
|
41
|
-
const { getTopicList } = await esmock('./index.js', {
|
|
42
|
-
'fs-extra': mockFs
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
const output = await getTopicList()
|
|
46
|
-
|
|
47
|
-
t.true(output.includes('Available help topics:'))
|
|
48
|
-
t.true(output.includes('debugging'))
|
|
49
|
-
t.true(output.includes('Troubleshooting help'))
|
|
50
|
-
t.true(output.includes('workflows'))
|
|
51
|
-
t.true(output.includes('Step-by-step guides'))
|
|
52
|
-
t.true(output.includes('Run "quire help <topic>"'))
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
test('getTopicList() returns message when no topics available', async (t) => {
|
|
56
|
-
const { sandbox } = t.context
|
|
57
|
-
|
|
58
|
-
const mockFs = {
|
|
59
|
-
pathExists: sandbox.stub().resolves(false)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const { getTopicList } = await esmock('./index.js', {
|
|
63
|
-
'fs-extra': mockFs
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
const output = await getTopicList()
|
|
67
|
-
|
|
68
|
-
t.is(output, 'No help topics available.')
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
test('getTopicList() returns message when topics directory is empty', async (t) => {
|
|
72
|
-
const { sandbox } = t.context
|
|
73
|
-
|
|
74
|
-
const mockFs = {
|
|
75
|
-
pathExists: sandbox.stub().resolves(true),
|
|
76
|
-
readdir: sandbox.stub().resolves([])
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const { getTopicList } = await esmock('./index.js', {
|
|
80
|
-
'fs-extra': mockFs
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
const output = await getTopicList()
|
|
84
|
-
|
|
85
|
-
t.is(output, 'No help topics available.')
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
test('getTopicContent() loads and renders topic', async (t) => {
|
|
89
|
-
const { sandbox } = t.context
|
|
90
|
-
|
|
91
|
-
const mockFs = {
|
|
92
|
-
pathExists: sandbox.stub().resolves(true),
|
|
93
|
-
readFile: sandbox.stub().resolves('# Test\n\nContent here.')
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const { getTopicContent } = await esmock('./index.js', {
|
|
97
|
-
'fs-extra': mockFs
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
const content = await getTopicContent('test')
|
|
101
|
-
|
|
102
|
-
t.is(typeof content, 'string')
|
|
103
|
-
t.true(content.includes('Test'))
|
|
104
|
-
t.true(content.includes('Content here'))
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
test('getTopicContent() strips frontmatter from content', async (t) => {
|
|
108
|
-
const { sandbox } = t.context
|
|
109
|
-
|
|
110
|
-
const mockFs = {
|
|
111
|
-
pathExists: sandbox.stub().resolves(true),
|
|
112
|
-
readFile: sandbox.stub().resolves(`---
|
|
113
|
-
title: Test Topic
|
|
114
|
-
description: A test
|
|
115
|
-
---
|
|
116
|
-
# Test Topic
|
|
117
|
-
|
|
118
|
-
This is the content.`)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const { getTopicContent } = await esmock('./index.js', {
|
|
122
|
-
'fs-extra': mockFs
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
const content = await getTopicContent('test')
|
|
126
|
-
|
|
127
|
-
t.true(content.includes('Test Topic'))
|
|
128
|
-
t.true(content.includes('This is the content'))
|
|
129
|
-
t.false(content.includes('---'))
|
|
130
|
-
t.false(content.includes('title:'))
|
|
131
|
-
})
|
|
132
|
-
|
|
133
|
-
test('getTopicContent() throws HelpTopicNotFoundError for missing topic', async (t) => {
|
|
134
|
-
const { sandbox } = t.context
|
|
135
|
-
|
|
136
|
-
const mockFs = {
|
|
137
|
-
pathExists: sandbox.stub()
|
|
138
|
-
.onFirstCall().resolves(false) // topic file does not exist
|
|
139
|
-
.onSecondCall().resolves(true), // topics directory exists
|
|
140
|
-
readdir: sandbox.stub().resolves(['epub.md', 'pdf.md', 'debugging.md'])
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const { getTopicContent } = await esmock('./index.js', {
|
|
144
|
-
'fs-extra': mockFs
|
|
145
|
-
})
|
|
146
|
-
|
|
147
|
-
const error = await t.throwsAsync(
|
|
148
|
-
() => getTopicContent('nonexistent'),
|
|
149
|
-
{ name: 'HelpTopicNotFoundError' }
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
t.is(error.code, 'HELP_TOPIC_NOT_FOUND')
|
|
153
|
-
t.is(error.topic, 'nonexistent')
|
|
154
|
-
})
|
|
155
|
-
|
|
156
|
-
test('getTopicContent() suggests similar topic for typo', async (t) => {
|
|
157
|
-
const { sandbox } = t.context
|
|
158
|
-
|
|
159
|
-
const mockFs = {
|
|
160
|
-
pathExists: sandbox.stub()
|
|
161
|
-
.onFirstCall().resolves(false)
|
|
162
|
-
.onSecondCall().resolves(true),
|
|
163
|
-
readdir: sandbox.stub().resolves([
|
|
164
|
-
'configuration.md', 'debugging.md', 'epub.md',
|
|
165
|
-
'pdf.md', 'publishing.md', 'workflows.md'
|
|
166
|
-
])
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const { getTopicContent } = await esmock('./index.js', {
|
|
170
|
-
'fs-extra': mockFs
|
|
171
|
-
})
|
|
172
|
-
|
|
173
|
-
const error = await t.throwsAsync(
|
|
174
|
-
() => getTopicContent('edub'),
|
|
175
|
-
{ name: 'HelpTopicNotFoundError' }
|
|
176
|
-
)
|
|
177
|
-
|
|
178
|
-
t.is(error.suggestion, 'Did you mean: epub?')
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
test('getTopicsDir() returns the topics directory path', async (t) => {
|
|
182
|
-
const { getTopicsDir } = await import('./index.js')
|
|
183
|
-
|
|
184
|
-
const dir = getTopicsDir()
|
|
185
|
-
|
|
186
|
-
t.true(dir.endsWith('topics'))
|
|
187
|
-
t.true(dir.includes(`lib${path.sep}help`))
|
|
188
|
-
})
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Configuration
|
|
3
|
-
description: Project and CLI configuration options
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Configuration
|
|
7
|
-
|
|
8
|
-
## Project Configuration
|
|
9
|
-
|
|
10
|
-
The `content/_data/publication.yaml` file contains publication settings:
|
|
11
|
-
|
|
12
|
-
```yaml
|
|
13
|
-
title: My Publication
|
|
14
|
-
subtitle: A Quire Book
|
|
15
|
-
contributor:
|
|
16
|
-
- type: primary
|
|
17
|
-
first_name: Jane
|
|
18
|
-
last_name: Doe
|
|
19
|
-
|
|
20
|
-
url: https://my-publication.example.com
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Common Settings
|
|
24
|
-
|
|
25
|
-
### Publication Metadata
|
|
26
|
-
|
|
27
|
-
```yaml
|
|
28
|
-
title: Publication Title
|
|
29
|
-
subtitle: Optional Subtitle
|
|
30
|
-
reading_line: Additional context
|
|
31
|
-
pub_date: 2024-01-15
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Output Configuration
|
|
35
|
-
|
|
36
|
-
```yaml
|
|
37
|
-
pdf:
|
|
38
|
-
output: _site/downloads/publication.pdf
|
|
39
|
-
|
|
40
|
-
epub:
|
|
41
|
-
output: _site/downloads/publication.epub
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Build Options
|
|
45
|
-
|
|
46
|
-
```yaml
|
|
47
|
-
debug: false
|
|
48
|
-
verbose: false
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## CLI Configuration
|
|
52
|
-
|
|
53
|
-
The CLI stores user preferences separately from project settings.
|
|
54
|
-
|
|
55
|
-
### View Configuration
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
quire config # Show all settings
|
|
59
|
-
quire config path # Show config file location
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Configuration File Location
|
|
63
|
-
|
|
64
|
-
- **macOS:** `~/Library/Preferences/quire-cli-nodejs/config.json`
|
|
65
|
-
- **Linux:** `~/.config/quire-cli-nodejs/config.json`
|
|
66
|
-
- **Windows:** `%APPDATA%\quire-cli-nodejs\config.json`
|
|
67
|
-
|
|
68
|
-
## Environment Variables
|
|
69
|
-
|
|
70
|
-
Override settings via environment variables:
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
DEBUG=quire:* quire build # Enable debug output
|
|
74
|
-
QUIRE_LOG_LEVEL=debug quire preview # Set log level
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
See full documentation: https://quire.getty.edu/docs-v1/configuration/
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Debugging
|
|
3
|
-
description: Troubleshooting common issues
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Debugging Quire Projects
|
|
7
|
-
|
|
8
|
-
## Debug Output
|
|
9
|
-
|
|
10
|
-
Enable debug output to see detailed information:
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
quire build --debug # Enable debug mode
|
|
14
|
-
DEBUG=quire:* quire build # Enable all debug namespaces
|
|
15
|
-
DEBUG=quire:lib:pdf quire pdf # Debug PDF module only
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Common Issues
|
|
19
|
-
|
|
20
|
-
### Build Fails with YAML Errors
|
|
21
|
-
|
|
22
|
-
Run validation to identify syntax issues:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
quire validate
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Common YAML problems:
|
|
29
|
-
- Missing colons after keys
|
|
30
|
-
- Incorrect indentation (use spaces, not tabs)
|
|
31
|
-
- Unquoted special characters
|
|
32
|
-
- Missing closing quotes
|
|
33
|
-
|
|
34
|
-
### PDF Generation Fails
|
|
35
|
-
|
|
36
|
-
1. Check that build output exists: `quire build`
|
|
37
|
-
2. Run with debug: `quire pdf --debug`
|
|
38
|
-
3. Verify the PDF engine is installed
|
|
39
|
-
|
|
40
|
-
### EPUB Generation Fails
|
|
41
|
-
|
|
42
|
-
1. Ensure the build is complete: `quire build`
|
|
43
|
-
2. Check for missing images or broken links
|
|
44
|
-
3. Run with debug: `quire epub --debug`
|
|
45
|
-
|
|
46
|
-
### Preview Not Updating
|
|
47
|
-
|
|
48
|
-
Try a clean build:
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
quire clean && quire preview
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### "Not in a Quire project" Error
|
|
55
|
-
|
|
56
|
-
Make sure you're in a directory containing:
|
|
57
|
-
- `content/` directory
|
|
58
|
-
- An Eleventy configuration file (`.eleventy.js` or `eleventy.config.js`)
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
cd your-project-name
|
|
62
|
-
quire preview
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Getting Help
|
|
66
|
-
|
|
67
|
-
- Documentation: https://quire.getty.edu/docs-v1/
|
|
68
|
-
- Community Forum: https://github.com/thegetty/quire/discussions
|
|
69
|
-
- Issue Tracker: https://github.com/thegetty/quire/issues
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: EPUB Generation
|
|
3
|
-
description: Creating e-book publications
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# EPUB Generation
|
|
7
|
-
|
|
8
|
-
## Quick Start
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
quire epub --build # Build and generate EPUB
|
|
12
|
-
quire epub --build --open # Build, generate, and open EPUB
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## EPUB Engines
|
|
16
|
-
|
|
17
|
-
Quire supports two EPUB engines:
|
|
18
|
-
|
|
19
|
-
### epubjs (Default)
|
|
20
|
-
|
|
21
|
-
JavaScript-based EPUB generation.
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
quire epub # Uses epubjs by default
|
|
25
|
-
quire epub --lib epubjs # Explicit epubjs
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Pandoc
|
|
29
|
-
|
|
30
|
-
Universal document converter with EPUB support. Requires separate installation.
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
quire epub --lib pandoc # Use Pandoc
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Configuration
|
|
37
|
-
|
|
38
|
-
EPUB settings in `content/_data/config.yaml`:
|
|
39
|
-
|
|
40
|
-
```yaml
|
|
41
|
-
epub:
|
|
42
|
-
output: _site/downloads/my-publication.epub
|
|
43
|
-
# Additional EPUB-specific settings
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Troubleshooting
|
|
47
|
-
|
|
48
|
-
### EPUB fails validation
|
|
49
|
-
|
|
50
|
-
Common issues:
|
|
51
|
-
- Missing required metadata in `content/_data/publication.yaml`
|
|
52
|
-
- Invalid image formats (use JPEG or PNG)
|
|
53
|
-
- Broken internal links
|
|
54
|
-
|
|
55
|
-
### Images not appearing
|
|
56
|
-
|
|
57
|
-
1. Check image paths are relative
|
|
58
|
-
2. Ensure images are in supported formats
|
|
59
|
-
3. Verify images exist in the build output
|
|
60
|
-
|
|
61
|
-
### EPUB not opening in reader
|
|
62
|
-
|
|
63
|
-
1. Validate the EPUB file structure
|
|
64
|
-
2. Check for malformed HTML in content
|
|
65
|
-
3. Ensure all required files are included
|
|
66
|
-
|
|
67
|
-
## Testing Your EPUB
|
|
68
|
-
|
|
69
|
-
Open in different readers to verify:
|
|
70
|
-
- Apple Books (macOS/iOS)
|
|
71
|
-
- Calibre (cross-platform)
|
|
72
|
-
- Adobe Digital Editions
|
|
73
|
-
|
|
74
|
-
See full documentation: https://quire.getty.edu/docs-v1/epub-output/
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: PDF Generation
|
|
3
|
-
description: Creating print-ready PDF publications
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# PDF Generation
|
|
7
|
-
|
|
8
|
-
## Quick Start
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
quire pdf --build # Build and generate PDF
|
|
12
|
-
quire pdf --build --open # Build, generate, and open PDF
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## PDF Engines
|
|
16
|
-
|
|
17
|
-
Quire supports two PDF engines:
|
|
18
|
-
|
|
19
|
-
### Paged.js (Default)
|
|
20
|
-
|
|
21
|
-
Open-source, browser-based PDF generation. No additional installation required.
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
quire pdf # Uses Paged.js by default
|
|
25
|
-
quire pdf --lib pagedjs # Explicit Paged.js
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### PrinceXML
|
|
29
|
-
|
|
30
|
-
Commercial PDF engine with advanced typography features. Requires separate installation.
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
quire pdf --lib prince # Use PrinceXML
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
**When to use PrinceXML:**
|
|
37
|
-
- Complex typography requirements
|
|
38
|
-
- Specific print production needs
|
|
39
|
-
- Advanced CSS paged media features
|
|
40
|
-
|
|
41
|
-
## Configuration
|
|
42
|
-
|
|
43
|
-
PDF settings in `content/_data/config.yaml`:
|
|
44
|
-
|
|
45
|
-
```yaml
|
|
46
|
-
pdf:
|
|
47
|
-
output: _site/downloads/my-publication.pdf
|
|
48
|
-
# Additional PDF-specific settings
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Troubleshooting
|
|
52
|
-
|
|
53
|
-
### PDF is blank or missing content
|
|
54
|
-
|
|
55
|
-
1. Ensure build completed successfully: `quire build`
|
|
56
|
-
2. Check that `_site/pdf.html` exists
|
|
57
|
-
3. Run with debug: `quire pdf --debug`
|
|
58
|
-
|
|
59
|
-
### Fonts not rendering correctly
|
|
60
|
-
|
|
61
|
-
- Ensure fonts are properly installed or embedded
|
|
62
|
-
- Check font paths in your CSS
|
|
63
|
-
|
|
64
|
-
### Page breaks in wrong places
|
|
65
|
-
|
|
66
|
-
Use CSS page break properties:
|
|
67
|
-
|
|
68
|
-
```css
|
|
69
|
-
.chapter {
|
|
70
|
-
page-break-before: always;
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
See full documentation: https://quire.getty.edu/docs-v1/pdf-output/
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Publishing
|
|
3
|
-
description: Deploying your Quire publication
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Publishing Your Publication
|
|
7
|
-
|
|
8
|
-
## Build for Production
|
|
9
|
-
|
|
10
|
-
Always use a clean build for production:
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
quire clean && quire build
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
This ensures all files are freshly generated without stale artifacts.
|
|
17
|
-
|
|
18
|
-
## Output Formats
|
|
19
|
-
|
|
20
|
-
### Web (HTML)
|
|
21
|
-
|
|
22
|
-
The default `quire build` generates a static HTML site in `_site/`:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
quire build
|
|
26
|
-
# Output: _site/
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Deploy the `_site/` directory to any static hosting service.
|
|
30
|
-
|
|
31
|
-
### PDF
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
quire pdf --build
|
|
35
|
-
# Output: _site/downloads/*.pdf
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### EPUB
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
quire epub --build
|
|
42
|
-
# Output: _site/downloads/*.epub
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Complete Publication Workflow
|
|
46
|
-
|
|
47
|
-
Generate all formats in one sequence:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
quire clean && quire build && quire pdf && quire epub
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Deployment Options
|
|
54
|
-
|
|
55
|
-
### GitHub Pages
|
|
56
|
-
|
|
57
|
-
1. Push `_site/` to a `gh-pages` branch
|
|
58
|
-
2. Configure GitHub Pages in repository settings
|
|
59
|
-
3. Access at `https://username.github.io/repo-name/`
|
|
60
|
-
|
|
61
|
-
### Netlify / Vercel
|
|
62
|
-
|
|
63
|
-
1. Connect your repository
|
|
64
|
-
2. Set build command: `quire build`
|
|
65
|
-
3. Set publish directory: `_site`
|
|
66
|
-
|
|
67
|
-
### Traditional Hosting
|
|
68
|
-
|
|
69
|
-
Upload the contents of `_site/` to your web server via FTP/SFTP.
|
|
70
|
-
|
|
71
|
-
## Pre-Publication Checklist
|
|
72
|
-
|
|
73
|
-
- [ ] Run `quire validate` to check for errors
|
|
74
|
-
- [ ] Review all content for accuracy
|
|
75
|
-
- [ ] Test links and navigation
|
|
76
|
-
- [ ] Verify images display correctly
|
|
77
|
-
- [ ] Check PDF and EPUB in multiple readers
|
|
78
|
-
- [ ] Test on different devices and browsers
|
|
79
|
-
|
|
80
|
-
See full documentation: https://quire.getty.edu/docs-v1/site-deploy/
|