diff --git a/pandoc/README.md b/pandoc/README.md index 3b8eeca..4140aec 100644 --- a/pandoc/README.md +++ b/pandoc/README.md @@ -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 diff --git a/pandoc/convert b/pandoc/convert index 932173d..be4e75e 100644 --- a/pandoc/convert +++ b/pandoc/convert @@ -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 diff --git a/pandoc/index.sh b/pandoc/index.sh index 4f31986..1907449 100644 --- a/pandoc/index.sh +++ b/pandoc/index.sh @@ -13,11 +13,6 @@ set -e -cleanup() { - unset latest_files -} -trap cleanup EXIT - # Default output directory OUTPUT_DIR=".archive"