pandoc-10-batch-conversion-scripts

Sub-skill of pandoc: 10. Batch Conversion Scripts.

5 stars

Best use case

pandoc-10-batch-conversion-scripts is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Sub-skill of pandoc: 10. Batch Conversion Scripts.

Teams using pandoc-10-batch-conversion-scripts should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/10-batch-conversion-scripts/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/_archive/development/documentation/pandoc/10-batch-conversion-scripts/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/10-batch-conversion-scripts/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pandoc-10-batch-conversion-scripts Compares

Feature / Agentpandoc-10-batch-conversion-scriptsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Sub-skill of pandoc: 10. Batch Conversion Scripts.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 10. Batch Conversion Scripts

## 10. Batch Conversion Scripts


```bash
#!/bin/bash
# scripts/batch-convert.sh
# Convert all Markdown files to PDF

set -euo pipefail

# Configuration
INPUT_DIR="${1:-./docs}"
OUTPUT_DIR="${2:-./output}"
TEMPLATE="${3:-}"

# Create output directory
mkdir -p "$OUTPUT_DIR"

# Find and convert all markdown files
find "$INPUT_DIR" -name "*.md" -type f | while read -r file; do
    # Get relative path and create output path
    relative="${file#$INPUT_DIR/}"
    output_file="$OUTPUT_DIR/${relative%.md}.pdf"
    output_dir=$(dirname "$output_file")

    # Create output subdirectory
    mkdir -p "$output_dir"

    echo "Converting: $file -> $output_file"

    # Build pandoc command
    cmd=(pandoc "$file" -o "$output_file"
        --pdf-engine=xelatex
        --toc
        --number-sections
        --highlight-style=tango)

    # Add template if specified
    if [[ -n "$TEMPLATE" ]]; then
        cmd+=(--template="$TEMPLATE")
    fi

    # Execute conversion
    "${cmd[@]}"
done

echo "Batch conversion complete!"
echo "Output: $OUTPUT_DIR"
```

```bash
#!/bin/bash
# scripts/convert-to-all-formats.sh
# Convert a document to multiple formats

set -euo pipefail

INPUT_FILE="${1:?Usage: $0 <input.md>}"
BASE_NAME="${INPUT_FILE%.md}"

echo "Converting $INPUT_FILE to multiple formats..."

# PDF
echo "  -> PDF"
pandoc "$INPUT_FILE" -o "${BASE_NAME}.pdf" \
    --pdf-engine=xelatex \
    --toc \
    --number-sections

# DOCX
echo "  -> DOCX"
pandoc "$INPUT_FILE" -o "${BASE_NAME}.docx" \
    --toc

# HTML
echo "  -> HTML"
pandoc "$INPUT_FILE" -o "${BASE_NAME}.html" \
    --standalone \
    --toc \
    --embed-resources

# LaTeX
echo "  -> LaTeX"
pandoc "$INPUT_FILE" -o "${BASE_NAME}.tex"

# EPUB
echo "  -> EPUB"
pandoc "$INPUT_FILE" -o "${BASE_NAME}.epub" \
    --toc

echo "Done! Created:"
ls -la "${BASE_NAME}".*
```

```python
#!/usr/bin/env python3
"""
scripts/smart_convert.py
Smart document converter with configuration file support.
"""

import subprocess
import sys
from pathlib import Path
import yaml


def load_config(config_path: Path) -> dict:
    """Load conversion configuration from YAML."""
    with open(config_path) as f:
        return yaml.safe_load(f)


def convert_document(
    input_file: Path,
    output_file: Path,
    config: dict
) -> bool:
    """Convert a single document using pandoc."""
    cmd = ['pandoc', str(input_file), '-o', str(output_file)]

    # Add common options
    if config.get('toc'):
        cmd.append('--toc')
        if toc_depth := config.get('toc_depth'):
            cmd.extend(['--toc-depth', str(toc_depth)])

    if config.get('number_sections'):
        cmd.append('--number-sections')

    if template := config.get('template'):
        cmd.extend(['--template', template])

    if pdf_engine := config.get('pdf_engine'):
        cmd.extend(['--pdf-engine', pdf_engine])

    if highlight := config.get('highlight_style'):
        cmd.extend(['--highlight-style', highlight])

    if bibliography := config.get('bibliography'):
        cmd.append('--citeproc')
        cmd.extend(['--bibliography', bibliography])

    if csl := config.get('csl'):
        cmd.extend(['--csl', csl])

    # Add variables
    for key, value in config.get('variables', {}).items():
        cmd.extend(['-V', f'{key}={value}'])

    # Add filters
    for filter_name in config.get('filters', []):
        if filter_name.endswith('.lua'):
            cmd.extend(['--lua-filter', filter_name])
        else:
            cmd.extend(['--filter', filter_name])

    print(f"Running: {' '.join(cmd)}")

    result = subprocess.run(cmd, capture_output=True, text=True)

    if result.returncode != 0:
        print(f"Error: {result.stderr}", file=sys.stderr)
        return False

    return True


def main():
    if len(sys.argv) < 3:
        print(f"Usage: {sys.argv[0]} <input.md> <output.pdf> [config.yaml]")
        sys.exit(1)

    input_file = Path(sys.argv[1])
    output_file = Path(sys.argv[2])
    config_file = Path(sys.argv[3]) if len(sys.argv) > 3 else None

    config = {}
    if config_file and config_file.exists():
        config = load_config(config_file)

    success = convert_document(input_file, output_file, config)
    sys.exit(0 if success else 1)


if __name__ == '__main__':
    main()

*Content truncated — see parent skill for full reference.*

Related Skills

batch-syntax-repair-from-injection-errors

5
from vamseeachanta/workspace-hub

Detect and fix systematic syntax errors caused by line-injection scripts that split multiline constructs

batch-syntax-fix-with-regex-line-based-fallback

5
from vamseeachanta/workspace-hub

Fix repeated syntax errors across many files using regex, then fall back to line-based parsing when regex fails

batch-syntax-fix-regex-iteration

5
from vamseeachanta/workspace-hub

Iteratively fix widespread syntax errors across many files using regex refinement when initial patterns fail

batch-syntax-fix-pattern

5
from vamseeachanta/workspace-hub

Identify and repair cascading import/syntax errors across multiple files using regex-based line-scanning and verification

batch-regex-fix-import-syntax

5
from vamseeachanta/workspace-hub

Detect and fix mid-import blank-line syntax breaks across multiple files using line-based regex

overnight-verify-close-and-blocker-conversion

5
from vamseeachanta/workspace-hub

Use overnight Codex lanes to clear stale-open GitHub issues by verification-first closure, and convert blocked PR-repair attempts into dedicated blocker issues instead of speculative edits.

closure-first-overnight-batch

5
from vamseeachanta/workspace-hub

Run a high-leverage overnight batch by clearing stale-open approved issues first, converting shared blockers into tracked issues, and reserving only one lane for true implementation.

workspace-hub-batch-issue-execution

5
from vamseeachanta/workspace-hub

Deprecated alias for gh-work-execution.

overnight-verify-close-batch

5
from vamseeachanta/workspace-hub

Build overnight parallel batches that close stale-open GitHub issues by proving landed work already satisfies the issue, instead of wasting implementation lanes on redoing completed work.

orcaflex-file-conversion

5
from vamseeachanta/workspace-hub

Convert OrcaFlex files between formats (.dat, .yml, .sim) for digital analysis and automation. Supports bidirectional conversion, batch processing, and format standardization.

orcaflex-batch-manager

5
from vamseeachanta/workspace-hub

Manage large-scale OrcaFlex batch processing with parallel execution, adaptive worker scaling, memory optimization, and progress tracking for efficient simulation campaigns.

aqwa-batch-execution

5
from vamseeachanta/workspace-hub

Run ANSYS AQWA analyses in batch/headless mode on Linux. Covers CLI execution, DAT input file structure, multi-stage analysis chaining, output file parsing, failure diagnosis, and HPC job scheduling.