[
  {
    "path": ".github/workflows/build.yml",
    "content": "name: build\n\non:\n    workflow_dispatch:\n    pull_request:\n    push:\n        branches: [main]\n        paths-ignore:\n            - 'example/**'\n\njobs:\n  build:\n    if: github.repository == 'mikepqr/resume-markdown'\n    runs-on: ${{ matrix.os }}\n    strategy:\n        fail-fast: false\n        matrix:\n            # os: [ubuntu-latest, macos-latest, windows-latest]\n            os: [ubuntu-latest, windows-latest]\n    steps:\n    - name: Check out repo\n      uses: actions/checkout@v4\n\n    - name: Set up uv\n      uses: astral-sh/setup-uv@v5\n\n    - name: Install package\n      run: uv tool install .\n\n    - name: Initialize resume templates\n      run: resume-markdown init\n\n    - name: Install mscorefonts (Linux)\n      if: runner.os == 'Linux'\n      run: |\n        echo \"ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true\" | sudo debconf-set-selections\n        sudo apt-get update\n        sudo apt-get install -y --no-install-recommends ttf-mscorefonts-installer fontconfig\n        sudo fc-cache -f -v\n\n    - name: Make resume\n      run: resume-markdown --debug build\n\n    - name: Rename output (Unix)\n      if: runner.os != 'Windows'\n      shell: bash\n      run: |\n          mv resume.pdf resume_${{ runner.os }}.pdf\n          mv resume.html resume_${{ runner.os }}.html\n\n    - name: Rename output (Windows)\n      if: runner.os == 'Windows'\n      shell: pwsh\n      run: |\n          Move-Item resume.pdf resume_Windows.pdf\n          Move-Item resume.html resume_Windows.html\n\n    - name: Upload artifacts\n      uses: actions/upload-artifact@v4\n      with:\n          name: resume-${{ runner.os }}\n          path: |\n              *.pdf\n              *.html\n\n  update-examples:\n    if: github.event_name == 'push' && github.ref == 'refs/heads/main'\n    runs-on: ubuntu-latest\n    needs: build\n    steps:\n    - name: Check out repo\n      uses: actions/checkout@v4\n\n    - name: Install ImageMagick\n      run: sudo apt-get update && sudo apt-get install -y imagemagick\n\n    - name: Download Windows artifacts\n      uses: actions/download-artifact@v4\n      with:\n          name: resume-Windows\n          path: artifacts\n\n    - name: Update example files\n      run: |\n          mv artifacts/resume_Windows.pdf example/resume.pdf\n          mv artifacts/resume_Windows.html example/resume.html\n          convert -density 300 example/resume.pdf[0] -background white -alpha remove \\\n            -crop 2550x1176+0+0 +repage \\\n            \\( -size 2550x196 gradient:none-white \\) \\\n            -gravity South -composite \\\n            -resize 1300x600 example/resume.png\n\n    - name: Commit changes\n      run: |\n          git config user.name \"github-actions[bot]\"\n          git config user.email \"github-actions[bot]@users.noreply.github.com\"\n          git add example/resume.pdf example/resume.html example/resume.png\n          git diff --staged --quiet || git commit -m \"Update example outputs\"\n          git push\n"
  },
  {
    "path": ".github/workflows/release.yml",
    "content": "name: Publish to PyPI\n\non:\n  release:\n    types: [published]\n\njobs:\n  build:\n    name: Build distribution\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n\n    - name: Set up Python\n      uses: actions/setup-python@v5\n      with:\n        python-version: \"3.x\"\n\n    - name: Install build dependencies\n      run: python -m pip install --upgrade build\n\n    - name: Build package\n      run: python -m build\n\n    - name: Upload distributions\n      uses: actions/upload-artifact@v4\n      with:\n        name: release-dists\n        path: dist/\n\n  publish:\n    name: Publish to PyPI\n    runs-on: ubuntu-latest\n    needs: build\n    environment:\n      name: pypi\n      url: https://pypi.org/p/resume-markdown\n    permissions:\n      id-token: write  # IMPORTANT: mandatory for trusted publishing\n    steps:\n    - name: Download distributions\n      uses: actions/download-artifact@v4\n      with:\n        name: release-dists\n        path: dist/\n\n    - name: Publish to PyPI\n      uses: pypa/gh-action-pypi-publish@release/v1\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2020 Mike Lee Williams\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# resume-markdown\n\n![Resume](https://raw.githubusercontent.com/mikepqr/resume-markdown/main/example/resume.png)\n\nWrite your resume in\n[Markdown](https://raw.githubusercontent.com/mikepqr/resume-markdown/main/src/resume_markdown/resume.md),\nstyle it with [CSS](src/resume_markdown/resume.css), output to [`resume.html`](example/resume.html) and\n[`resume.pdf`](example/resume.pdf).\n\n## Prerequisites\n\n - Python ≥ 3.9 or `uv`\n - Optional, required for PDF output: Google Chrome or Chromium\n\n## Installation\n\n### Using uv\n\nRun directly without installing:\n\n```bash\nuvx resume-markdown\n```\n\nOr install once:\n\n```bash\nuv tool install resume-markdown\n```\n\n### Using pip\n\n```bash\npip install resume-markdown\n```\n\n## Usage\n\n### Quick start\n\n 1. Create template files in your current directory:\n\n    ```bash\n    resume-markdown init\n    # or with uvx: uvx resume-markdown init\n    ```\n\n    This creates [`resume.md`](src/resume_markdown/resume.md) and [`resume.css`](src/resume_markdown/resume.css) in the current directory.\n\n 2. Edit your copy of `resume.md` with your resume content (the placeholder text is taken\n    with thanks from the [JSON Resume Project](https://jsonresume.org/themes/))\n\n 3. Build HTML and PDF output:\n\n    ```bash\n    resume-markdown build\n    # or with uvx: uvx resume-markdown build\n    ```\n\n### Build options\n\n - Use `--no-html` or `--no-pdf` to disable HTML or PDF output:\n   ```bash\n   resume-markdown build --no-pdf\n   ```\n\n - Use `--chrome-path=/path/to/chrome` if the tool cannot find your Chrome\n   or Chromium executable (needed for PDF output)\n   ```bash\n   resume-markdown build --chrome-path=/path/to/chrome\n   ```\n\n - Specify a custom input file:\n   ```bash\n   resume-markdown build myresume.md\n   ```\n\n## Customization\n\nEdit [`resume.css`](src/resume_markdown/resume.css) to change the appearance of your resume. The\ndefault style is extremely generic, which is perhaps what you want in a resume,\nbut CSS gives you a lot of flexibility. See, e.g. [The Tech Resume\nInside-Out](https://www.thetechinterview.com/) for good advice about what a\nresume should look like (and what it should say).\n\nChange the appearance of the PDF version (without affecting the HTML version) by\nadding rules under the `@media print` CSS selector.\n\nChange the margins and paper size of the PDF version by editing the [`@page` CSS\nrule](https://developer.mozilla.org/en-US/docs/Web/CSS/%40page/size).\n"
  },
  {
    "path": "example/resume.html",
    "content": "<html lang=\"en\">\r\n<head>\r\n<meta charset=\"UTF-8\">\r\n<title>Richard Hendricks</title>\r\n<style>\r\nbody {\r\n    color: #000000;\r\n    background: #EEEEEE;\r\n    font: 1.1em \"Times New Roman\";\r\n    line-height: 1.2;\r\n    margin: 40px 0;\r\n}\r\n#resume {\r\n    margin: 0 auto;\r\n    max-width: 800px;\r\n    padding: 40px 60px;\r\n    background: #FFFFFF;\r\n    border: 1px solid #CCCCCC;\r\n    box-shadow: 2px 2px 4px #AAAAAA;\r\n    -webkit-box-shadow: 2px 2px 4px #AAAAAA;\r\n}\r\nh1 {\r\n    text-transform: uppercase;\r\n    text-align: center;\r\n    font-size: 200%;\r\n    margin: 0;\r\n    padding: 0;\r\n}\r\nh2 {\r\n    border-bottom: 1px solid #000000;\r\n    text-transform: uppercase;\r\n    font-size: 130%;\r\n    margin: 1em 0 0 0;\r\n    padding: 0;\r\n}\r\nh3 {\r\n    font-size: 100%;\r\n    margin: 0.8em 0 0.3em 0;\r\n    padding: 0;\r\n    display: flex;\r\n    justify-content: space-between;\r\n}\r\np {\r\n    margin: 0 0 0.5em 0;\r\n    padding: 0;\r\n    }\r\nul {\r\n    padding: 0;\r\n    margin: 0 1.5em;\r\n    }\r\n/* ul immediately after h1 = contact list */\r\nh1 + ul {\r\n    text-align: center;\r\n    margin: 0;\r\n    padding: 0;\r\n    }\r\nh1 + ul > li {\r\n    display: inline;\r\n    white-space: pre;\r\n    list-style-type: none;\r\n}\r\nh1 + ul > li:after {\r\n    content: \"  \\2022  \";\r\n}\r\nh1 + ul > li:last-child:after {\r\n    content: \"\";\r\n}\r\n/* p immediately after contact list = summary */\r\nh1 + ul + p {\r\n    margin: 1em 0;\r\n}\r\n@media print {\r\n    body {\r\n        font-size: 10pt;\r\n        margin: 0;\r\n        padding: 0;\r\n        background: none;\r\n    }\r\n    #resume {\r\n        margin: 0;\r\n        padding: 0;\r\n        border: 0px;\r\n        background: none;\r\n        box-shadow: none;\r\n        -webkit-box-shadow: none;\r\n    }\r\n    /* Do not underline abbr tags in PDF */\r\n    abbr {\r\n        text-decoration: none;\r\n        font-variant: none;\r\n    }\r\n    /* Make links black in PDF */\r\n    /* Move this outside the print block to apply this in HTML too */\r\n    a, a:link, a:visited, a:hover {\r\n        color: #000000;\r\n        text-decoration: underline;\r\n    }\r\n}\r\n@page {\r\n    /* Change margins and paper size of PDF */\r\n    /* https://developer.mozilla.org/en-US/docs/Web/CSS/@page */\r\n    size: letter;\r\n    margin: 0.5in 0.8in;\r\n}\r\n@media screen and (max-width: 800px) {\r\n    body {\r\n        font-size: 16pt;\r\n        margin: 0;\r\n        padding: 0;\r\n        background: #FFFFFF !important;\r\n    }\r\n    #resume {\r\n        margin: 0;\r\n        padding: 1em;\r\n        border: 0px;\r\n        background: none;\r\n        box-shadow: none;\r\n        -webkit-box-shadow: none;\r\n    }\r\n}\r\n\r\n</style>\r\n</head>\r\n<body>\r\n<div id=\"resume\">\r\n<!-- The (first) h1 will be used as the <title> of the HTML page -->\r\n<h1>Richard Hendricks</h1>\r\n<!-- The unordered list immediately after the h1 will be formatted on a single\r\nline. It is intended to be used for contact details -->\r\n<ul>\r\n<li><a href=\"&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#114;&#105;&#99;&#104;&#97;&#114;&#100;&#46;&#104;&#101;&#110;&#100;&#114;&#105;&#107;&#115;&#64;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;\">&#114;&#105;&#99;&#104;&#97;&#114;&#100;&#46;&#104;&#101;&#110;&#100;&#114;&#105;&#107;&#115;&#64;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;</a></li>\r\n<li>(912) 555-4321</li>\r\n<li><a href=\"http://richardhendricks.example.com\">richardhendricks.example.com</a></li>\r\n<li>San Francisco, CA</li>\r\n</ul>\r\n<!-- The paragraph after the h1 and ul and before the first h2 is optional. It\r\nis intended to be used for a short summary. -->\r\n<p>CEO and Software Engineer with knowledge of applied information theory,\r\nincluding optimizing lossless compression schema of both the length-limited and\r\nadaptive variants.</p>\r\n<h2>Experience</h2>\r\n<!-- You have to wrap the \"left\" and \"right\" half of these headings in spans by\r\nhand -->\r\n<h3><span>CEO/President, Pied Piper</span> <span>Dec 2013 &ndash; Dec 2014</span></h3>\r\n<p>Pied Piper is a multi-platform technology based on a proprietary universal\r\ncompression algorithm that has consistently fielded high Weisman Scores™ that\r\nare not merely competitive, but approach the theoretical limit of lossless\r\ncompression.</p>\r\n<ul>\r\n<li>Build an algorithm for artist to detect if their music was violating\r\n   copyright infringement laws</li>\r\n<li>Successfully won Techcrunch Disrupt</li>\r\n<li>Optimized an algorithm that holds the current world record for Weisman Scores</li>\r\n</ul>\r\n<h3><span>Teacher, CoderDojo</span> <span>July 2013 &ndash; Dec 2013</span></h3>\r\n<p>Global movement of free coding clubs for young people.</p>\r\n<ul>\r\n<li>Awarded &lsquo;Teacher of the Month&rsquo;</li>\r\n</ul>\r\n<h2>Projects</h2>\r\n<h3><span>Miss Direction</span> <span>Aug 2016</span></h3>\r\n<p>A mapping engine that misguides you:</p>\r\n<ul>\r\n<li>Won award at AIHacks 2016</li>\r\n<li>Built by all women team of newbie programmers</li>\r\n<li>Using modern technologies such as GoogleMaps, Chrome Extension and Javascript</li>\r\n</ul>\r\n<h2>Education</h2>\r\n<h3><span>University of Oklahoma, BA Information Technology</span> <span>2011 &ndash; 2014</span></h3>\r\n<ul>\r\n<li>GPA 4.0</li>\r\n<li>DB1101 - Basic SQL</li>\r\n<li>CS2011 - Java Introduction</li>\r\n</ul>\r\n<h2>Skills</h2>\r\n<ul>\r\n<li>Web development: HTML, CSS, JavaScript</li>\r\n<li>Compression: Mpeg, MP4, GIF</li>\r\n</ul></div>\r\n</body>\r\n</html>\r\n"
  },
  {
    "path": "pyproject.toml",
    "content": "[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n\n[project]\nname = \"resume-markdown\"\nversion = \"1.0.1\"\ndescription = \"Convert Markdown resumes to HTML and PDF\"\nreadme = \"README.md\"\nlicense = {text = \"MIT\"}\nauthors = [\n    {name = \"Mike Lee Williams\", email = \"mike@mike.place\"}\n]\nrequires-python = \">=3.9\"\ndependencies = [\n    \"markdown>=3.0\",\n]\nclassifiers = [\n    \"Development Status :: 5 - Production/Stable\",\n    \"Intended Audience :: End Users/Desktop\",\n    \"License :: OSI Approved :: MIT License\",\n    \"Programming Language :: Python :: 3\",\n    \"Programming Language :: Python :: 3.9\",\n    \"Programming Language :: Python :: 3.10\",\n    \"Programming Language :: Python :: 3.11\",\n    \"Programming Language :: Python :: 3.12\",\n    \"Topic :: Text Processing :: Markup :: Markdown\",\n]\n\n[project.urls]\nHomepage = \"https://github.com/mikepqr/resume-markdown\"\nRepository = \"https://github.com/mikepqr/resume-markdown\"\nIssues = \"https://github.com/mikepqr/resume-markdown/issues\"\n\n[project.scripts]\nresume-markdown = \"resume_markdown:main\"\n"
  },
  {
    "path": "src/resume_markdown/__init__.py",
    "content": "\"\"\"Convert Markdown resumes to HTML and PDF.\"\"\"\n\n__version__ = \"1.0.1\"\n\nfrom resume_markdown.__main__ import main\n\n__all__ = [\"main\"]\n"
  },
  {
    "path": "src/resume_markdown/__main__.py",
    "content": "#!/usr/bin/env python3\nimport argparse\nimport base64\nimport itertools\nimport logging\nimport os\nimport re\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\nfrom importlib.resources import files\n\nimport markdown\n\npreamble = \"\"\"\\\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>{title}</title>\n<style>\n{css}\n</style>\n</head>\n<body>\n<div id=\"resume\">\n\"\"\"\n\npostamble = \"\"\"\\\n</div>\n</body>\n</html>\n\"\"\"\n\nCHROME_GUESSES_MACOS = (\n    \"/Applications/Chromium.app/Contents/MacOS/Chromium\",\n    \"/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary\",\n    \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\",\n)\n\n# https://stackoverflow.com/a/40674915/409879\nCHROME_GUESSES_WINDOWS = (\n    # Windows 10\n    os.path.expandvars(r\"%ProgramFiles(x86)%\\Google\\Chrome\\Application\\chrome.exe\"),\n    os.path.expandvars(r\"%ProgramFiles%\\Google\\Chrome\\Application\\chrome.exe\"),\n    os.path.expandvars(r\"%LocalAppData%\\Google\\Chrome\\Application\\chrome.exe\"),\n    # Windows 7\n    r\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\",\n    r\"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe\",\n    # Vista\n    r\"C:\\Users\\UserName\\AppDataLocal\\Google\\Chrome\",\n    # XP\n    r\"C:\\Documents and Settings\\UserName\\Local Settings\\Application Data\\Google\\Chrome\",\n)\n\n# https://unix.stackexchange.com/a/439956/20079\nCHROME_GUESSES_LINUX = [\n    \"/\".join((path, executable))\n    for path, executable in itertools.product(\n        (\n            \"/usr/local/sbin\",\n            \"/usr/local/bin\",\n            \"/usr/sbin\",\n            \"/usr/bin\",\n            \"/sbin\",\n            \"/bin\",\n            \"/opt/google/chrome\",\n        ),\n        (\"google-chrome\", \"chrome\", \"chromium\", \"chromium-browser\"),\n    )\n]\n\n\ndef guess_chrome_path() -> str:\n    if sys.platform == \"darwin\":\n        guesses = CHROME_GUESSES_MACOS\n    elif sys.platform == \"win32\":\n        guesses = CHROME_GUESSES_WINDOWS\n    else:\n        guesses = CHROME_GUESSES_LINUX\n    for guess in guesses:\n        if os.path.exists(guess):\n            logging.info(\"Found Chrome or Chromium at \" + guess)\n            return guess\n    raise ValueError(\"Could not find Chrome. Please set --chrome-path.\")\n\n\ndef title(md: str) -> str:\n    \"\"\"\n    Return the contents of the first markdown heading in md, which we\n    assume to be the title of the document.\n    \"\"\"\n    for line in md.splitlines():\n        if re.match(\"^#[^#]\", line):  # starts with exactly one '#'\n            return line.lstrip(\"#\").strip()\n    raise ValueError(\n        \"Cannot find any lines that look like markdown h1 headings to use as the title\"\n    )\n\n\ndef make_html(md: str, prefix: str = \"resume\") -> str:\n    \"\"\"\n    Compile md to HTML and prepend/append preamble/postamble.\n\n    Insert <prefix>.css if it exists.\n    \"\"\"\n    try:\n        with open(prefix + \".css\") as cssfp:\n            css = cssfp.read()\n    except FileNotFoundError:\n        print(prefix + \".css not found. Output will by unstyled.\")\n        css = \"\"\n    return \"\".join(\n        (\n            preamble.format(title=title(md), css=css),\n            markdown.markdown(md, extensions=[\"smarty\", \"abbr\"]),\n            postamble,\n        )\n    )\n\n\ndef init_resume(directory: str = \".\") -> None:\n    \"\"\"\n    Write template resume.md and resume.css files to the specified directory.\n    \"\"\"\n    package_files = files(\"resume_markdown\")\n\n    for filename in [\"resume.md\", \"resume.css\"]:\n        dest_path = os.path.join(directory, filename)\n        if os.path.exists(dest_path):\n            logging.warning(f\"{dest_path} already exists, skipping\")\n            continue\n\n        template_content = (package_files / filename).read_text(encoding=\"utf-8\")\n        with open(dest_path, \"w\", encoding=\"utf-8\") as f:\n            f.write(template_content)\n        logging.info(f\"Wrote {dest_path}\")\n\n\ndef write_pdf(html: str, prefix: str = \"resume\", chrome: str = \"\") -> None:\n    \"\"\"\n    Write html to prefix.pdf\n    \"\"\"\n    chrome = chrome or guess_chrome_path()\n    html64 = base64.b64encode(html.encode(\"utf-8\"))\n    options = [\n        \"--no-sandbox\",\n        \"--headless\",\n        \"--print-to-pdf-no-header\",\n        # Keep both versions of this option for backwards compatibility\n        # https://developer.chrome.com/docs/chromium/new-headless.\n        \"--no-pdf-header-footer\",\n        \"--enable-logging=stderr\",\n        \"--log-level=2\",\n        \"--in-process-gpu\",\n        \"--disable-gpu\",\n    ]\n\n    # Ideally we'd use tempfile.TemporaryDirectory here. We can't because\n    # attempts to delete the tmpdir fail on Windows because Chrome creates a\n    # file the python process does not have permission to delete. See\n    # https://github.com/puppeteer/puppeteer/issues/2778,\n    # https://github.com/puppeteer/puppeteer/issues/298, and\n    # https://bugs.python.org/issue26660. If we ever drop Python 3.9 support we\n    # can use TemporaryDirectory with ignore_cleanup_errors=True as a context\n    # manager.\n    tmpdir = tempfile.mkdtemp(prefix=\"resume.md_\")\n    options.append(f\"--crash-dumps-dir={tmpdir}\")\n    options.append(f\"--user-data-dir={tmpdir}\")\n\n    try:\n        subprocess.run(\n            [\n                chrome,\n                *options,\n                f\"--print-to-pdf={prefix}.pdf\",\n                \"data:text/html;base64,\" + html64.decode(\"utf-8\"),\n            ],\n            check=True,\n        )\n        logging.info(f\"Wrote {prefix}.pdf\")\n    except subprocess.CalledProcessError as exc:\n        if exc.returncode == -6:\n            logging.warning(\n                \"Chrome died with <Signals.SIGABRT: 6> \"\n                f\"but you may find {prefix}.pdf was created successfully.\"\n            )\n        else:\n            raise exc\n    finally:\n        shutil.rmtree(tmpdir, ignore_errors=True)\n        if os.path.isdir(tmpdir):\n            logging.debug(f\"Could not delete {tmpdir}\")\n\n\ndef main():\n    parser = argparse.ArgumentParser(\n        description=\"Convert Markdown resumes to HTML and PDF\"\n    )\n    parser.add_argument(\"-q\", \"--quiet\", action=\"store_true\")\n    parser.add_argument(\"--debug\", action=\"store_true\")\n\n    subparsers = parser.add_subparsers(dest=\"command\", help=\"Available commands\")\n\n    # init command\n    init_parser = subparsers.add_parser(\n        \"init\",\n        help=\"Create resume.md and resume.css template files\"\n    )\n\n    # build command\n    build_parser = subparsers.add_parser(\n        \"build\",\n        help=\"Build HTML and PDF from Markdown resume\"\n    )\n    build_parser.add_argument(\n        \"file\",\n        help=\"markdown input file [resume.md]\",\n        default=\"resume.md\",\n        nargs=\"?\",\n    )\n    build_parser.add_argument(\n        \"--no-html\",\n        help=\"Do not write html output\",\n        action=\"store_true\",\n    )\n    build_parser.add_argument(\n        \"--no-pdf\",\n        help=\"Do not write pdf output\",\n        action=\"store_true\",\n    )\n    build_parser.add_argument(\n        \"--chrome-path\",\n        help=\"Path to Chrome or Chromium executable\",\n    )\n\n    args = parser.parse_args()\n\n    if args.quiet:\n        logging.basicConfig(level=logging.WARN, format=\"%(message)s\")\n    elif args.debug:\n        logging.basicConfig(level=logging.DEBUG, format=\"%(message)s\")\n    else:\n        logging.basicConfig(level=logging.INFO, format=\"%(message)s\")\n\n    if args.command == \"init\":\n        init_resume()\n    elif args.command == \"build\":\n        prefix, _ = os.path.splitext(os.path.abspath(args.file))\n\n        with open(args.file, encoding=\"utf-8\") as mdfp:\n            md = mdfp.read()\n        html = make_html(md, prefix=prefix)\n\n        if not args.no_html:\n            with open(prefix + \".html\", \"w\", encoding=\"utf-8\") as htmlfp:\n                htmlfp.write(html)\n                logging.info(f\"Wrote {htmlfp.name}\")\n\n        if not args.no_pdf:\n            write_pdf(html, prefix=prefix, chrome=args.chrome_path)\n    else:\n        parser.print_help()\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "src/resume_markdown/resume.css",
    "content": "body {\n    color: #000000;\n    background: #EEEEEE;\n    font: 1.1em \"Times New Roman\";\n    line-height: 1.2;\n    margin: 40px 0;\n}\n#resume {\n    margin: 0 auto;\n    max-width: 800px;\n    padding: 40px 60px;\n    background: #FFFFFF;\n    border: 1px solid #CCCCCC;\n    box-shadow: 2px 2px 4px #AAAAAA;\n    -webkit-box-shadow: 2px 2px 4px #AAAAAA;\n}\nh1 {\n    text-transform: uppercase;\n    text-align: center;\n    font-size: 200%;\n    margin: 0;\n    padding: 0;\n}\nh2 {\n    border-bottom: 1px solid #000000;\n    text-transform: uppercase;\n    font-size: 130%;\n    margin: 1em 0 0 0;\n    padding: 0;\n}\nh3 {\n    font-size: 100%;\n    margin: 0.8em 0 0.3em 0;\n    padding: 0;\n    display: flex;\n    justify-content: space-between;\n}\np {\n    margin: 0 0 0.5em 0;\n    padding: 0;\n    }\nul {\n    padding: 0;\n    margin: 0 1.5em;\n    }\n/* ul immediately after h1 = contact list */\nh1 + ul {\n    text-align: center;\n    margin: 0;\n    padding: 0;\n    }\nh1 + ul > li {\n    display: inline;\n    white-space: pre;\n    list-style-type: none;\n}\nh1 + ul > li:after {\n    content: \"  \\2022  \";\n}\nh1 + ul > li:last-child:after {\n    content: \"\";\n}\n/* p immediately after contact list = summary */\nh1 + ul + p {\n    margin: 1em 0;\n}\n@media print {\n    body {\n        font-size: 10pt;\n        margin: 0;\n        padding: 0;\n        background: none;\n    }\n    #resume {\n        margin: 0;\n        padding: 0;\n        border: 0px;\n        background: none;\n        box-shadow: none;\n        -webkit-box-shadow: none;\n    }\n    /* Do not underline abbr tags in PDF */\n    abbr {\n        text-decoration: none;\n        font-variant: none;\n    }\n    /* Make links black in PDF */\n    /* Move this outside the print block to apply this in HTML too */\n    a, a:link, a:visited, a:hover {\n        color: #000000;\n        text-decoration: underline;\n    }\n}\n@page {\n    /* Change margins and paper size of PDF */\n    /* https://developer.mozilla.org/en-US/docs/Web/CSS/@page */\n    size: letter;\n    margin: 0.5in 0.8in;\n}\n@media screen and (max-width: 800px) {\n    body {\n        font-size: 16pt;\n        margin: 0;\n        padding: 0;\n        background: #FFFFFF !important;\n    }\n    #resume {\n        margin: 0;\n        padding: 1em;\n        border: 0px;\n        background: none;\n        box-shadow: none;\n        -webkit-box-shadow: none;\n    }\n}\n"
  },
  {
    "path": "src/resume_markdown/resume.md",
    "content": "<!-- The (first) h1 will be used as the <title> of the HTML page -->\n# Richard Hendricks\n\n<!-- The unordered list immediately after the h1 will be formatted on a single\nline. It is intended to be used for contact details -->\n- <richard.hendriks@mail.com>\n- (912) 555-4321\n- [richardhendricks.example.com](http://richardhendricks.example.com)\n- San Francisco, CA\n\n<!-- The paragraph after the h1 and ul and before the first h2 is optional. It\nis intended to be used for a short summary. -->\nCEO and Software Engineer with knowledge of applied information theory,\nincluding optimizing lossless compression schema of both the length-limited and\nadaptive variants.\n\n## Experience\n\n<!-- You have to wrap the \"left\" and \"right\" half of these headings in spans by\nhand -->\n### <span>CEO/President, Pied Piper</span> <span>Dec 2013 -- Dec 2014</span>\n\nPied Piper is a multi-platform technology based on a proprietary universal\ncompression algorithm that has consistently fielded high Weisman Scores™ that\nare not merely competitive, but approach the theoretical limit of lossless\ncompression.\n\n - Build an algorithm for artist to detect if their music was violating\n   copyright infringement laws\n - Successfully won Techcrunch Disrupt\n - Optimized an algorithm that holds the current world record for Weisman Scores\n\n### <span>Teacher, CoderDojo</span> <span>July 2013 -- Dec 2013</span>\n\nGlobal movement of free coding clubs for young people.\n\n - Awarded 'Teacher of the Month'\n\n## Projects\n\n### <span>Miss Direction</span> <span>Aug 2016</span>\n\nA mapping engine that misguides you:\n\n   - Won award at AIHacks 2016\n   - Built by all women team of newbie programmers\n   - Using modern technologies such as GoogleMaps, Chrome Extension and Javascript\n\n## Education\n\n### <span>University of Oklahoma, BA Information Technology</span> <span>2011 -- 2014</span>\n\n  - GPA 4.0\n  - DB1101 - Basic SQL\n  - CS2011 - Java Introduction\n\n## Skills\n\n - Web development: HTML, CSS, JavaScript\n - Compression: Mpeg, MP4, GIF\n"
  }
]