@thegetty/quire-cli 1.0.0-rc.37 → 1.0.0-rc.39

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.
Files changed (104) hide show
  1. package/package.json +5 -2
  2. package/src/commands/build.js +13 -6
  3. package/src/commands/clean.js +10 -2
  4. package/src/commands/clean.spec.js +10 -0
  5. package/src/commands/clean.test.js +122 -0
  6. package/src/commands/config.js +3 -1
  7. package/src/commands/config.test.js +42 -1
  8. package/src/commands/doctor.js +251 -0
  9. package/src/commands/doctor.spec.js +115 -0
  10. package/src/commands/doctor.test.js +1409 -0
  11. package/src/commands/epub.js +9 -2
  12. package/src/commands/help.js +60 -0
  13. package/src/commands/help.test.js +132 -0
  14. package/src/commands/info.js +79 -71
  15. package/src/commands/info.spec.js +8 -0
  16. package/src/commands/info.test.js +173 -76
  17. package/src/commands/pdf.js +10 -3
  18. package/src/commands/validate.js +39 -7
  19. package/src/commands/validate.spec.js +8 -0
  20. package/src/commands/validate.test.js +144 -0
  21. package/src/errors/help/help-topic-not-found-error.js +22 -0
  22. package/src/errors/help/index.js +8 -0
  23. package/src/errors/index.js +6 -0
  24. package/src/errors/input/index.js +8 -0
  25. package/src/errors/input/invalid-input-error.js +21 -0
  26. package/src/helpers/pager.js +59 -0
  27. package/src/helpers/pager.test.js +85 -0
  28. package/src/lib/README.md +77 -22
  29. package/src/lib/conf/README.md +6 -0
  30. package/src/lib/conf/build-status.js +103 -0
  31. package/src/lib/conf/build-status.test.js +247 -0
  32. package/src/lib/conf/defaults.js +14 -0
  33. package/src/lib/conf/format.js +1 -1
  34. package/src/lib/conf/schema.js +46 -1
  35. package/src/lib/constants.js +28 -0
  36. package/src/lib/doctor/README.md +667 -0
  37. package/src/lib/doctor/checks/environment/cli-version.js +62 -0
  38. package/src/lib/doctor/checks/environment/cli-version.test.js +132 -0
  39. package/src/lib/doctor/checks/environment/git-available.js +77 -0
  40. package/src/lib/doctor/checks/environment/git-available.test.js +52 -0
  41. package/src/lib/doctor/checks/environment/index.js +13 -0
  42. package/src/lib/doctor/checks/environment/node-version.js +66 -0
  43. package/src/lib/doctor/checks/environment/node-version.test.js +17 -0
  44. package/src/lib/doctor/checks/environment/npm-available.js +66 -0
  45. package/src/lib/doctor/checks/environment/npm-available.test.js +52 -0
  46. package/src/lib/doctor/checks/environment/os-info.js +48 -0
  47. package/src/lib/doctor/checks/environment/os-info.test.js +81 -0
  48. package/src/lib/doctor/checks/environment/runtime-info.js +51 -0
  49. package/src/lib/doctor/checks/environment/runtime-info.test.js +132 -0
  50. package/src/lib/doctor/checks/outputs/epub-output.js +119 -0
  51. package/src/lib/doctor/checks/outputs/epub-output.test.js +277 -0
  52. package/src/lib/doctor/checks/outputs/index.js +10 -0
  53. package/src/lib/doctor/checks/outputs/pdf-output.js +144 -0
  54. package/src/lib/doctor/checks/outputs/pdf-output.test.js +377 -0
  55. package/src/lib/doctor/checks/outputs/stale-build.js +122 -0
  56. package/src/lib/doctor/checks/outputs/stale-build.test.js +282 -0
  57. package/src/lib/doctor/checks/project/data-files.js +56 -0
  58. package/src/lib/doctor/checks/project/data-files.test.js +125 -0
  59. package/src/lib/doctor/checks/project/dependencies.js +53 -0
  60. package/src/lib/doctor/checks/project/dependencies.test.js +71 -0
  61. package/src/lib/doctor/checks/project/index.js +11 -0
  62. package/src/lib/doctor/checks/project/quire-11ty.js +98 -0
  63. package/src/lib/doctor/checks/project/quire-11ty.test.js +170 -0
  64. package/src/lib/doctor/checks/project/quire-project.js +38 -0
  65. package/src/lib/doctor/checks/project/quire-project.test.js +47 -0
  66. package/src/lib/doctor/checks/tools/index.js +10 -0
  67. package/src/lib/doctor/checks/tools/pandoc-available.js +82 -0
  68. package/src/lib/doctor/checks/tools/pandoc-available.test.js +73 -0
  69. package/src/lib/doctor/checks/tools/prince-available.js +81 -0
  70. package/src/lib/doctor/checks/tools/prince-available.test.js +73 -0
  71. package/src/lib/doctor/constants.js +39 -0
  72. package/src/lib/doctor/formatDuration.js +108 -0
  73. package/src/lib/doctor/formatDuration.test.js +76 -0
  74. package/src/lib/doctor/formatters/human.js +257 -0
  75. package/src/lib/doctor/formatters/human.test.js +463 -0
  76. package/src/lib/doctor/formatters/index.js +8 -0
  77. package/src/lib/doctor/formatters/json.js +78 -0
  78. package/src/lib/doctor/formatters/json.test.js +174 -0
  79. package/src/lib/doctor/formatters/shared.js +129 -0
  80. package/src/lib/doctor/formatters/shared.test.js +194 -0
  81. package/src/lib/doctor/index.js +271 -0
  82. package/src/lib/doctor/index.test.js +797 -0
  83. package/src/lib/help/frontmatter.js +77 -0
  84. package/src/lib/help/frontmatter.test.js +139 -0
  85. package/src/lib/help/index.js +135 -0
  86. package/src/lib/help/index.test.js +160 -0
  87. package/src/lib/help/topics/configuration.md +77 -0
  88. package/src/lib/help/topics/debugging.md +69 -0
  89. package/src/lib/help/topics/epub.md +74 -0
  90. package/src/lib/help/topics/pdf.md +74 -0
  91. package/src/lib/help/topics/publishing.md +80 -0
  92. package/src/lib/help/topics/workflows.md +50 -0
  93. package/src/lib/platform.js +95 -0
  94. package/src/lib/project/build.js +44 -25
  95. package/src/lib/project/build.test.js +30 -8
  96. package/src/lib/project/detect.js +16 -2
  97. package/src/lib/project/index.js +18 -2
  98. package/src/lib/project/output-paths.js +87 -0
  99. package/src/lib/project/output-paths.test.js +66 -0
  100. package/src/lib/project/paths.js +48 -0
  101. package/src/main.js +38 -3
  102. package/src/packageConfig.js +17 -0
  103. package/src/validators/validate-data-files.js +154 -0
  104. package/src/validators/validate-data-files.test.js +217 -0
@@ -0,0 +1,77 @@
1
+ /**
2
+ * YAML frontmatter parsing utilities
3
+ *
4
+ * Extracts and strips YAML frontmatter from markdown content.
5
+ * Frontmatter is delimited by `---` on its own line.
6
+ *
7
+ * @module lib/help/frontmatter
8
+ */
9
+ import yaml from 'js-yaml'
10
+
11
+ /** Regex to match YAML frontmatter block */
12
+ const FRONTMATTER_REGEX = /^---\n([\s\S]*?)\n---/
13
+
14
+ /**
15
+ * Extract YAML frontmatter from markdown content
16
+ *
17
+ * @param {string} content - Markdown content with optional frontmatter
18
+ * @returns {Object} Parsed frontmatter data or empty object if none/invalid
19
+ *
20
+ * @example
21
+ * const meta = extractFrontmatter(`---
22
+ * title: My Topic
23
+ * description: A description
24
+ * ---
25
+ * # Content`)
26
+ * // => { title: 'My Topic', description: 'A description' }
27
+ */
28
+ export function extractFrontmatter(content) {
29
+ const match = content.match(FRONTMATTER_REGEX)
30
+ if (!match) return {}
31
+
32
+ try {
33
+ return yaml.load(match[1]) || {}
34
+ } catch {
35
+ return {}
36
+ }
37
+ }
38
+
39
+ /**
40
+ * Strip YAML frontmatter from markdown content
41
+ *
42
+ * @param {string} content - Markdown content with optional frontmatter
43
+ * @returns {string} Content without frontmatter block
44
+ *
45
+ * @example
46
+ * const body = stripFrontmatter(`---
47
+ * title: My Topic
48
+ * ---
49
+ * # Content`)
50
+ * // => '# Content'
51
+ */
52
+ export function stripFrontmatter(content) {
53
+ return content.replace(/^---\n[\s\S]*?\n---\n?/, '')
54
+ }
55
+
56
+ /**
57
+ * Parse markdown content with frontmatter
58
+ *
59
+ * Convenience function that returns both metadata and content body.
60
+ *
61
+ * @param {string} content - Markdown content with optional frontmatter
62
+ * @returns {{ data: Object, content: string }} Parsed frontmatter and body
63
+ *
64
+ * @example
65
+ * const { data, content } = parseFrontmatter(`---
66
+ * title: My Topic
67
+ * ---
68
+ * # Content`)
69
+ * // data => { title: 'My Topic' }
70
+ * // content => '# Content'
71
+ */
72
+ export function parseFrontmatter(content) {
73
+ return {
74
+ data: extractFrontmatter(content),
75
+ content: stripFrontmatter(content)
76
+ }
77
+ }
@@ -0,0 +1,139 @@
1
+ import test from 'ava'
2
+
3
+ import {
4
+ extractFrontmatter,
5
+ stripFrontmatter,
6
+ parseFrontmatter
7
+ } from './frontmatter.js'
8
+
9
+ /**
10
+ * Frontmatter Parsing Tests
11
+ */
12
+
13
+ // extractFrontmatter tests
14
+
15
+ test('extractFrontmatter() returns parsed YAML data', (t) => {
16
+ const content = `---
17
+ title: Test Topic
18
+ description: A test description
19
+ ---
20
+ # Content`
21
+
22
+ const result = extractFrontmatter(content)
23
+
24
+ t.deepEqual(result, {
25
+ title: 'Test Topic',
26
+ description: 'A test description'
27
+ })
28
+ })
29
+
30
+ test('extractFrontmatter() returns empty object when no frontmatter', (t) => {
31
+ const content = '# Just Content\n\nNo frontmatter here.'
32
+
33
+ const result = extractFrontmatter(content)
34
+
35
+ t.deepEqual(result, {})
36
+ })
37
+
38
+ test('extractFrontmatter() returns empty object for invalid YAML', (t) => {
39
+ const content = `---
40
+ title: [invalid yaml
41
+ ---
42
+ # Content`
43
+
44
+ const result = extractFrontmatter(content)
45
+
46
+ t.deepEqual(result, {})
47
+ })
48
+
49
+ test('extractFrontmatter() handles values containing colons', (t) => {
50
+ const content = `---
51
+ url: https://example.com/path
52
+ title: "Part 1: Introduction"
53
+ ---
54
+ # Content`
55
+
56
+ const result = extractFrontmatter(content)
57
+
58
+ t.is(result.url, 'https://example.com/path')
59
+ t.is(result.title, 'Part 1: Introduction')
60
+ })
61
+
62
+ test('extractFrontmatter() handles arrays and nested objects', (t) => {
63
+ const content = `---
64
+ tags:
65
+ - one
66
+ - two
67
+ author:
68
+ name: Test
69
+ email: test@example.com
70
+ ---
71
+ # Content`
72
+
73
+ const result = extractFrontmatter(content)
74
+
75
+ t.deepEqual(result.tags, ['one', 'two'])
76
+ t.deepEqual(result.author, { name: 'Test', email: 'test@example.com' })
77
+ })
78
+
79
+ // stripFrontmatter tests
80
+
81
+ test('stripFrontmatter() removes frontmatter block', (t) => {
82
+ const content = `---
83
+ title: Test
84
+ ---
85
+ # Content
86
+
87
+ Body text.`
88
+
89
+ const result = stripFrontmatter(content)
90
+
91
+ t.is(result, '# Content\n\nBody text.')
92
+ })
93
+
94
+ test('stripFrontmatter() returns content unchanged when no frontmatter', (t) => {
95
+ const content = '# Just Content\n\nNo frontmatter.'
96
+
97
+ const result = stripFrontmatter(content)
98
+
99
+ t.is(result, content)
100
+ })
101
+
102
+ test('stripFrontmatter() handles frontmatter without trailing newline', (t) => {
103
+ const content = `---
104
+ title: Test
105
+ ---# Content`
106
+
107
+ const result = stripFrontmatter(content)
108
+
109
+ t.is(result, '# Content')
110
+ })
111
+
112
+ // parseFrontmatter tests
113
+
114
+ test('parseFrontmatter() returns both data and content', (t) => {
115
+ const content = `---
116
+ title: Test Topic
117
+ description: A description
118
+ ---
119
+ # Heading
120
+
121
+ Body content.`
122
+
123
+ const result = parseFrontmatter(content)
124
+
125
+ t.deepEqual(result.data, {
126
+ title: 'Test Topic',
127
+ description: 'A description'
128
+ })
129
+ t.is(result.content, '# Heading\n\nBody content.')
130
+ })
131
+
132
+ test('parseFrontmatter() returns empty data when no frontmatter', (t) => {
133
+ const content = '# Just Content'
134
+
135
+ const result = parseFrontmatter(content)
136
+
137
+ t.deepEqual(result.data, {})
138
+ t.is(result.content, '# Just Content')
139
+ })
@@ -0,0 +1,135 @@
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
+ * Load a help topic by name
64
+ * @param {string} name - Topic name (without .md extension)
65
+ * @returns {Promise<string>} Topic content
66
+ * @throws {HelpTopicNotFoundError} If topic does not exist
67
+ */
68
+ async function loadTopic(name) {
69
+ const filePath = path.join(TOPICS_DIR, `${name}.md`)
70
+
71
+ if (!await fs.pathExists(filePath)) {
72
+ throw new HelpTopicNotFoundError(name)
73
+ }
74
+
75
+ const content = await fs.readFile(filePath, 'utf-8')
76
+ return stripFrontmatter(content)
77
+ }
78
+
79
+ /**
80
+ * Render markdown content for terminal display
81
+ * @param {string} content - Markdown content
82
+ * @returns {string} Rendered content for terminal
83
+ */
84
+ function renderTopic(content) {
85
+ marked.use(markedTerminal())
86
+ return marked.parse(content).trimEnd()
87
+ }
88
+
89
+ /**
90
+ * Format topic list for display
91
+ * @param {TopicMeta[]} topics - Array of topic metadata
92
+ * @returns {string} Formatted topic list
93
+ */
94
+ function formatTopicList(topics) {
95
+ if (topics.length === 0) {
96
+ return 'No help topics available.'
97
+ }
98
+
99
+ const lines = ['Available help topics:\n']
100
+ topics.forEach(({ name, description }) => {
101
+ lines.push(` ${name.padEnd(16)} ${description}`)
102
+ })
103
+ lines.push('\nRun "quire help <topic>" for detailed information.')
104
+ lines.push('Run "quire <command> --help" for command-specific options.')
105
+
106
+ return lines.join('\n')
107
+ }
108
+
109
+ /**
110
+ * Get formatted list of available help topics
111
+ * @returns {Promise<string>} Formatted topic list for display
112
+ */
113
+ export async function getTopicList() {
114
+ const topics = await listTopics()
115
+ return formatTopicList(topics)
116
+ }
117
+
118
+ /**
119
+ * Get formatted help content for a topic
120
+ * @param {string} name - Topic name
121
+ * @returns {Promise<string>} Rendered topic content
122
+ * @throws {HelpTopicNotFoundError} If topic does not exist
123
+ */
124
+ export async function getTopicContent(name) {
125
+ const content = await loadTopic(name)
126
+ return renderTopic(content)
127
+ }
128
+
129
+ /**
130
+ * Get the topics directory path (for testing)
131
+ * @returns {string} Path to topics directory
132
+ */
133
+ export function getTopicsDir() {
134
+ return TOPICS_DIR
135
+ }
@@ -0,0 +1,160 @@
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().resolves(false)
138
+ }
139
+
140
+ const { getTopicContent } = await esmock('./index.js', {
141
+ 'fs-extra': mockFs
142
+ })
143
+
144
+ const error = await t.throwsAsync(
145
+ () => getTopicContent('nonexistent'),
146
+ { name: 'HelpTopicNotFoundError' }
147
+ )
148
+
149
+ t.is(error.code, 'HELP_TOPIC_NOT_FOUND')
150
+ t.is(error.topic, 'nonexistent')
151
+ })
152
+
153
+ test('getTopicsDir() returns the topics directory path', async (t) => {
154
+ const { getTopicsDir } = await import('./index.js')
155
+
156
+ const dir = getTopicsDir()
157
+
158
+ t.true(dir.endsWith('topics'))
159
+ t.true(dir.includes(`lib${path.sep}help`))
160
+ })
@@ -0,0 +1,77 @@
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/
@@ -0,0 +1,69 @@
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