{"id":48844115,"url":"https://github.com/vinatorul/md-pdf-builder","last_synced_at":"2026-04-15T04:01:57.105Z","repository":{"id":349514460,"uuid":"1202648033","full_name":"Vinatorul/md-pdf-builder","owner":"Vinatorul","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-06T09:06:31.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-06T11:14:41.897Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vinatorul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-06T08:50:24.000Z","updated_at":"2026-04-06T09:06:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Vinatorul/md-pdf-builder","commit_stats":null,"previous_names":["vinatorul/md-pdf-builder"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Vinatorul/md-pdf-builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vinatorul%2Fmd-pdf-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vinatorul%2Fmd-pdf-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vinatorul%2Fmd-pdf-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vinatorul%2Fmd-pdf-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vinatorul","download_url":"https://codeload.github.com/Vinatorul/md-pdf-builder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vinatorul%2Fmd-pdf-builder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31825515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-15T04:01:53.748Z","updated_at":"2026-04-15T04:01:57.092Z","avatar_url":"https://github.com/Vinatorul.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Document Builder\n\nThis repository contains tools for building PDF documents from Markdown sources with Mermaid diagram support.\n\n## Prerequisites\n\n### Required Dependencies\n\n1. **Pandoc** (version 3.0+)\n   - macOS: `brew install pandoc`\n   - Linux: `apt-get install pandoc` or download from [pandoc.org](https://pandoc.org/installing.html)\n\n2. **LaTeX Distribution** (for PDF generation)\n   - macOS: `brew install --cask mactex-no-gui` or `brew install basictex`\n   - Linux: `apt-get install texlive-xetex texlive-fonts-recommended`\n\n3. **Mermaid Filter** (for diagram rendering)\n\n   ```bash\n   npm install -g mermaid-filter\n   ```\n\n   Or using yarn:\n\n   ```bash\n   yarn global add mermaid-filter\n   ```\n\n4. **Puppeteer dependencies** (required by mermaid-filter)\n   - macOS: Usually works out of the box\n   - Linux: May need additional packages\n\n     ```bash\n     apt-get install -y chromium-browser\n     ```\n\n### Verify Installation\n\n```bash\npandoc --version\nxelatex --version  # or pdflatex --version\nmermaid-filter --version\n```\n\n## Usage\n\n### Building Documents\n\nUse the Makefile to build documents:\n\n```bash\n# Build organizational structure document\nmake org\n```\n\n### Output\n\nGenerated files are placed in the `build/` subdirectory of each document folder:\n\n- `build/*.md` - Combined markdown file\n- `build/*.pdf` - Final PDF document\n\n## Creating a New Document Set\n\n### Step 1: Create Directory Structure\n\n```bash\nmkdir my-document\n```\n\n### Step 2: Create Source Files\n\nCreate your markdown files in the document directory:\n\n```bash\ntouch my-document/intro.md\ntouch my-document/chapter-1.md\ntouch my-document/conclusion.md\n```\n\n### Step 3: Create Manifest File\n\nCreate `my-document/manifest.txt` listing source files in order:\n\n```\nintro.md\nchapter-1.md\nconclusion.md\n```\n\n### Step 4: Create Metadata File\n\nCreate `my-document/metadata.yaml` with PDF settings:\n\n```yaml\nlang: ru-RU\ntoc: false\ntoc-depth: 2\nnumber-sections: false\ncolorlinks: false\ngeometry:\n  - margin=1in\nfontsize: 11pt\nmainfont: Arial Unicode MS\nmonofont: Arial Unicode MS\nheader-includes:\n  - |\n    ```{=latex}\n    \\pagestyle{plain}\n    ```\ninclude-before:\n  - |\n    \\begin{titlepage}\n    \\centering\n    \\vspace*{3cm}\n    {\\Huge\\bfseries My Document Title\\par}\n    \\vspace{1cm}\n    {\\Large Subtitle\\par}\n    \\vfill\n    \\end{titlepage}\n    \\tableofcontents\n    \\newpage\n```\n\n### Step 5: Create Build Script\n\nCreate `my-document/build.sh`:\n\n```bash\n#!/bin/zsh\nset -euo pipefail\n\nSCRIPT_DIR=\"${0:A:h}\"\nMANIFEST=\"$SCRIPT_DIR/manifest.txt\"\nMETADATA=\"$SCRIPT_DIR/metadata.yaml\"\nOUTPUT_DIR=\"$SCRIPT_DIR/build\"\nOUTPUT_FILE=\"$OUTPUT_DIR/document.pdf\"\nTMP_FILE=\"$OUTPUT_DIR/document.md\"\n\nmkdir -p \"$OUTPUT_DIR\"\n\nif ! command -v pandoc \u003e/dev/null 2\u003e\u00261; then\n  echo \"pandoc is not installed\" \u003e\u00262\n  exit 1\nfi\n\nPDF_ENGINE=\"\"\nif command -v xelatex \u003e/dev/null 2\u003e\u00261; then\n  PDF_ENGINE=\"xelatex\"\nelif command -v pdflatex \u003e/dev/null 2\u003e\u00261; then\n  PDF_ENGINE=\"pdflatex\"\nelse\n  echo \"No LaTeX PDF engine found. Install xelatex or pdflatex.\" \u003e\u00262\n  exit 1\nfi\n\n: \u003e \"$TMP_FILE\"\n\nwhile IFS= read -r file || [[ -n \"$file\" ]]; do\n  [[ -z \"$file\" ]] \u0026\u0026 continue\n  SOURCE_FILE=\"$SCRIPT_DIR/$file\"\n  if [[ ! -f \"$SOURCE_FILE\" ]]; then\n    echo \"Missing file from manifest: $SOURCE_FILE\" \u003e\u00262\n    exit 1\n  fi\n\n  cat \"$SOURCE_FILE\" \u003e\u003e \"$TMP_FILE\"\n  printf '\\n\\n\\\\newpage\\n\\n' \u003e\u003e \"$TMP_FILE\"\ndone \u003c \"$MANIFEST\"\n\npandoc \\\n  --from markdown \\\n  --metadata-file \"$METADATA\" \\\n  --pdf-engine=\"$PDF_ENGINE\" \\\n  --filter mermaid-filter \\\n  --output \"$OUTPUT_FILE\" \\\n  \"$TMP_FILE\"\n\necho \"Generated $OUTPUT_FILE\"\n```\n\nMake it executable:\n\n```bash\nchmod +x my-document/build.sh\n```\n\n### Step 6: Add to Makefile\n\nAdd a new target to the root `Makefile`:\n\n```makefile\n.PHONY: my-document\n\nmy-document:\n\t./my-document/build.sh\n```\n\n**Note:** `.PHONY` declares that `my-document` is not a file target, so Make will always run the command even if a file named `my-document` exists.\n\n### Step 7: Build\n\n```bash\nmake my-document\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinatorul%2Fmd-pdf-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinatorul%2Fmd-pdf-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinatorul%2Fmd-pdf-builder/lists"}