{"id":22685526,"url":"https://github.com/shwilliam/gatsby-source-copy","last_synced_at":"2026-04-10T06:48:46.439Z","repository":{"id":39572163,"uuid":"281076142","full_name":"shwilliam/gatsby-source-copy","owner":"shwilliam","description":"📝 Source copy for your Gatsby site from non-technical members of your team","archived":false,"fork":false,"pushed_at":"2023-01-06T11:57:06.000Z","size":1283,"stargazers_count":1,"open_issues_count":14,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-30T15:03:18.179Z","etag":null,"topics":["archieml","gatsby","gatsby-source-plugin","google-docs","markdown"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shwilliam.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-20T09:42:24.000Z","updated_at":"2021-02-02T23:45:55.000Z","dependencies_parsed_at":"2023-02-06T01:01:43.054Z","dependency_job_id":null,"html_url":"https://github.com/shwilliam/gatsby-source-copy","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shwilliam%2Fgatsby-source-copy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shwilliam%2Fgatsby-source-copy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shwilliam%2Fgatsby-source-copy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shwilliam%2Fgatsby-source-copy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shwilliam","download_url":"https://codeload.github.com/shwilliam/gatsby-source-copy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246200324,"owners_count":20739567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["archieml","gatsby","gatsby-source-plugin","google-docs","markdown"],"created_at":"2024-12-09T22:15:22.040Z","updated_at":"2025-10-17T14:21:48.052Z","avatar_url":"https://github.com/shwilliam.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `gatsby-source-copy`\n\n\u003e The easiest way to source copy from non-technical members of your team\n\n## Installation\n\n### 1. Add this package as a dependency\n\n`yarn add gatsby-source-copy`\n\n`npm install --save gatsby-source-copy`\n\n### 2. Configure the plugin in `gatsby-config.js`\n\n```javascript\nmodule.exports = {\n  plugins: [\n    {\n      resolve: 'gatsby-source-copy',\n      options: {\n        documents: [\n          {\n            key: '\u003cSOME_UNIQUE_KEY\u003e',\n            id: '\u003cGOOGLE_DOC_ID\u003e',\n          },\n        ],\n      },\n    },\n  ],\n}\n```\n\n### 3. Querying copy\n\nAll queried documents will return a node with `content` containing a `raw` field\nwith the text of the source document.\n\nIf a `format` has been specified, `content` will also contain the parsed data of\nthe document, accessed with the target format as the key. The return-type of the\nformatted data depends on the format specified. For more details consult [the\ndocumentation of your desired format option](#formats).\n\n#### Example query\n\n```\nquery CopyQuery {\n  allCopy {\n    edges {\n      node {\n        content {\n          raw\n          archieml {\n            document_title\n          }\n          markdown {\n            tokens {\n              type\n              text\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n## Google Docs\n\n### Permissions\n\nTo ensure your Google Document can be sourced, make sure you have enabled anyone\nwith a link to view the file. This can be configured in the \"Share\" menu.\n\n### Document ID\n\nSourcing content with `gatsby-source-copy` requires configuration containing the\nIDs of the target documents. This ID can be found in your Google Doc URL, commonly\nbetween `d/` and `/edit`. For example, a document with the URL\n`https://docs.google.com/document/d/dj2k3/edit`, has the ID `dj2k3`.\n\n## Formats\n\nTypically, Gatsby sites utilize transformer plugins to parse content for you to\nquery. For example, [`gatsby-transformer-remark`](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-remark)\nfor transforming markdown. To provide better ergonomics for querying content,\nthis plugin provides support for parsing [several popular markup languages](#parsers)\nused for authoring copy. This enables simpler queries by exposing the parsed\ncontent alongside the raw text that was sourced.\n\nBy default, `gatsby-source-copy` **will not** parse your content but return the\nraw text of the document. To parse the contents of the document, provide a\n`format` configuration option. This option can be set globally or per document.\n`gatsby-source-copy` currently supports parsing [Markdown](https://www.markdownguide.org/)\nand [ArchieML](http://archieml.org/).\n\n```javascript\n// global\n{\n  resolve: 'gatsby-source-copy',\n  options: {\n    format: \"markdown\",\n    documents: [...]\n  }\n}\n\n// per document\n{\n  resolve: 'gatsby-source-copy',\n  options: {\n    documents: [\n        {key: 'foo', id: 'ajCe2', format: \"archieml\"},\n        {key: 'bar', id: 'a9rcf', format: \"markdown\"},\n      }\n    ]\n  }\n}\n```\n\n### Parsers\n\n| Format   | Key          | Parser                                                    | Example                                                                                                  |\n| -------- | ------------ | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |\n| Markdown | `\"markdown\"` | [`marked.js`](https://marked.js.org/#/USING_PRO.md#lexer) | [examples/markdown.md](https://github.com/shwilliam/gatsby-source-copy/blob/main/examples/markdown.md)   |\n| ArchieML | `\"archieml\"` | [`archieml-js`](https://github.com/newsdev/archieml-js)   | [examples/archieml.txt](https://github.com/shwilliam/gatsby-source-copy/blob/main/examples/archieml.txt) |\n\nCan't find the format you're looking for? [Open an issue](https://github.com/shwilliam/gatsby-source-copy/issues)\nor [add your own](#contributing)!\n\n## Contributing\n\nThis project is open to and encourages contributions! Feel free to discuss any\nbug fixes/features in the [issues](https://github.com/shwilliam/gatsby-source-copy/issues).\nIf you wish to work on this project:\n\n1. Fork [this project](https://github.com/shwilliam/gatsby-source-copy)\n2. Create a branch (`git checkout -b new-branch`)\n3. Commit your changes (`git commit -am 'add new feature'`)\n4. Push to the branch (`git push origin new-branch`)\n5. [Submit a pull request!](https://github.com/shwilliam/gatsby-source-copy/pull/new/master)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshwilliam%2Fgatsby-source-copy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshwilliam%2Fgatsby-source-copy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshwilliam%2Fgatsby-source-copy/lists"}