{"id":18403584,"url":"https://github.com/judy2k/doc-to-md","last_synced_at":"2026-04-30T10:07:25.882Z","repository":{"id":213548474,"uuid":"734386079","full_name":"judy2k/doc-to-md","owner":"judy2k","description":"Create clean Markdown (including code blocks!) from exported Google Docs.","archived":false,"fork":false,"pushed_at":"2024-05-24T15:07:45.000Z","size":3001,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-27T22:30:09.895Z","etag":null,"topics":["contentstack","markdown","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/judy2k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-12-21T14:51:34.000Z","updated_at":"2024-05-24T15:07:49.000Z","dependencies_parsed_at":"2023-12-21T17:08:17.794Z","dependency_job_id":"62045a32-344f-42cf-83a9-3ed66611581b","html_url":"https://github.com/judy2k/doc-to-md","commit_stats":null,"previous_names":["judy2k/doc-to-md"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/judy2k/doc-to-md","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judy2k%2Fdoc-to-md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judy2k%2Fdoc-to-md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judy2k%2Fdoc-to-md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judy2k%2Fdoc-to-md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/judy2k","download_url":"https://codeload.github.com/judy2k/doc-to-md/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/judy2k%2Fdoc-to-md/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32460884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"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":["contentstack","markdown","python"],"created_at":"2024-11-06T02:47:31.807Z","updated_at":"2026-04-30T10:07:25.844Z","avatar_url":"https://github.com/judy2k.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Doc-to-Markdown\n\nThis is a small command-line utility for converting Google Docs documents to\nMarkdown that's suitable for pasting into ContentStack.\n\n## What does it actually do?\n\n`doc2md` can convert HTML exported from Google Docs into clean Markdown documents for pasting into ContentStack, with the following features:\n\n- Code!\n  - Firstly, the script will identify any code blocks (formatted using Fira Code, Roboto Mono, Source Code Pro, or Courier New) and will mark them as code blocks in the resulting Markdown.\n  - Some basic heuristics are used to annotate code blocks as python code\n  - Inline code can be correctly identified using backticks (the same as Markdown itself) or formatting (any spans marked with a code font).\n  - **Code building blocks** are now supported!\n- Empty paragraphs are removed\n- Hyperlinks are correctly extracted from Google's nasty tracking links.\n- Bold and italic formatting is maintained where possible.\n- Hide (optionally?) CSS parse warnings.\n- Supports tables!\n\n## Not (currently) Supported\n\n- Images - I can't currently think of a good way to make image upload into ContentStack more seamless, without API access to ContentStack itself. \n- See the [To Do](#to-do) section.\n\n## Installation\n\n```\npython -m pip install --upgrade git+https://github.com/judy2k/doc-to-md.git\n\n# Check that it worked:\ndoc2md --help\n```\n\n## Usage\n\nThe tool doesn't have many options, so using it is relatively straightforward.\n\nFirst, download your Google Doc as a Web Page.\n\n![A screenshot of the Export as Web Page menu item in Google Docs.](images/export_screenshot.png)\n\nUnzip the archive, and then in the command-line, run something like the following:\n\n```\n# Create a new Markdown file from an existing Google Docs HTML file:\ndoc2md /PATH/TO/INPUT.HTML /PATH/TO/OUTPUT.MD\n```\n\nThis should produce a clean, formatted Markdown file, suitable for copying into ContentStack.\nYou will, sadly, still have to import all your images and insert them in the correct locations yourself.\n\n### Tables\n\nTables are supported by doc2md, and are exported to GFM table format.\nThis hasn't been _widely_ tested.\n\nIf your table doesn't have a header row, then a blank one will be inserted,\nwhich is probably not what you want.\nTo mark a header row in Google Docs,\nhover over the row and click on the pin icon that appears to the left.\n\n![Marking a header row in Google Docs.](images/mark_header_row.png)\n\n## To-Do\n- Improve the code that identifies and merges code blocks. ([#3](https://github.com/judy2k/doc-to-md/issues/3)).\n- ContentStack doesn't support `--` and `---` so replace them (outside of code blocks!) with n-dash and m-dash characters.\n- Resulting Markdown occasionally includes a backslash followed by line-break character. Need to identify why it's happening and fix.\n- Is there a way to manage images better?\n- Can captions in the doc automatically be applied to the associated image?\n- Ensure backticks aren't messed up inside code blocks.\n\n--------\nMade with 💚 for my colleagues at MongoDB, by Judy2k.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjudy2k%2Fdoc-to-md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjudy2k%2Fdoc-to-md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjudy2k%2Fdoc-to-md/lists"}