chore(pandoc): remove cruft from convert tools
- convert: drop --standalone from the DOCX→MD pandoc call. It emitted its own YAML title block, which collided with the frontmatter the script prepends (a ZDDC docx with title metadata produced two stacked --- blocks). Matches the HTML→MD path, which already omits it. - index.sh: remove the no-op cleanup()/trap EXIT — unsetting a global as the process exits does nothing; the per-folder `unset latest_files` is the real reset. - README: trim the generic Advanced Usage / Performance / "Perfect for" filler, and fix the Troubleshooting note that wrongly pointed at a zddc.conf template key (template is -T / auto-discovery). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d10cd23076
commit
9513ea3a07
3 changed files with 2 additions and 59 deletions
|
|
@ -134,36 +134,6 @@ your-project/
|
|||
- **Tablet**: Collapsible sidebar with overlay
|
||||
- **Mobile**: Hamburger menu with full-screen TOC overlay
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
### Custom Templates
|
||||
You can customize the viewer template by:
|
||||
1. Copying `viewer-template.html` to your project
|
||||
2. Modifying the CSS and HTML structure
|
||||
3. Updating `zddc.conf` to point to your custom template
|
||||
|
||||
### Batch Processing
|
||||
For large document sets:
|
||||
```bash
|
||||
# Process all markdown files recursively
|
||||
find . -name "*.md" -exec ./convert -f -o rendered/ {} +
|
||||
|
||||
# Process specific document types
|
||||
./convert -f -o rendered/ *-SOW-*.md *-DBD-*.md
|
||||
```
|
||||
|
||||
### Integration with Build Systems
|
||||
The convert tool returns proper exit codes and can be integrated into CI/CD pipelines:
|
||||
```bash
|
||||
# In a build script
|
||||
if ./convert -f -o dist/ *.md; then
|
||||
echo "Documentation built successfully"
|
||||
else
|
||||
echo "Documentation build failed"
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
## File Types Supported
|
||||
|
||||
- **Input**: Markdown (`.md`), DOCX (`.docx`), and HTML (`.html`/`.htm`) files
|
||||
|
|
@ -183,29 +153,7 @@ fi
|
|||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
1. **Template not found**: Ensure `zddc.conf` points to correct template path
|
||||
1. **Template not found**: Keep `viewer-template.html` beside the script (or input), or pass `-T /path/to/template.html`
|
||||
2. **Permission errors**: Make sure `convert` script is executable (`chmod +x convert`)
|
||||
3. **Missing output**: Check that output directory exists or use `-o` to create it
|
||||
4. **Print issues**: Use "Print to PDF" in browser for best results
|
||||
|
||||
### Performance
|
||||
- Large documents (>1000 pages) may take longer to render
|
||||
- Consider splitting very large documents into sections
|
||||
- Use batch processing for multiple files
|
||||
|
||||
## Examples
|
||||
|
||||
### Engineering Documentation
|
||||
Perfect for:
|
||||
- Design basis documents
|
||||
- Specifications and standards
|
||||
- Project requirements
|
||||
- Technical procedures
|
||||
- Quality documentation
|
||||
|
||||
### Features Optimized For
|
||||
- **Professional appearance**: Clean, corporate styling
|
||||
- **Technical content**: Tables, diagrams, code blocks
|
||||
- **Print output**: PDF generation with proper formatting
|
||||
- **Navigation**: Easy browsing of long documents
|
||||
- **Sharing**: URL fragments for referencing specific sections
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ convert_docx_to_md() {
|
|||
local FILENAME_NO_EXT="$6"
|
||||
|
||||
# Convert using pandoc with proper extension stripping to temp file first
|
||||
if pandoc -f docx -t gfm --markdown-headings=atx --extract-media="$MEDIA_DIR" --wrap=none --standalone "$INPUT" -o "$TEMP_FILE"; then
|
||||
if pandoc -f docx -t gfm --markdown-headings=atx --extract-media="$MEDIA_DIR" --wrap=none "$INPUT" -o "$TEMP_FILE"; then
|
||||
|
||||
# Parse ZDDC filename pattern: trackingNumber_revision (status) - title.extension
|
||||
if parse_zddc_filename "$FILENAME_NO_EXT"; then
|
||||
|
|
|
|||
|
|
@ -13,11 +13,6 @@
|
|||
|
||||
set -e
|
||||
|
||||
cleanup() {
|
||||
unset latest_files
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
# Default output directory
|
||||
OUTPUT_DIR=".archive"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue