{"id":13791214,"url":"https://github.com/quarto-ext/include-code-files","last_synced_at":"2025-08-09T04:24:17.957Z","repository":{"id":157440155,"uuid":"589801898","full_name":"quarto-ext/include-code-files","owner":"quarto-ext","description":"Quarto extension to include code from source files.","archived":false,"fork":false,"pushed_at":"2024-09-04T16:01:25.000Z","size":10,"stargazers_count":60,"open_issues_count":10,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T03:09:57.920Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Lua","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/quarto-ext.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-01-17T00:57:43.000Z","updated_at":"2025-03-25T21:30:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5d51f37-badc-4e5d-b97a-1f9fd576e878","html_url":"https://github.com/quarto-ext/include-code-files","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarto-ext%2Finclude-code-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarto-ext%2Finclude-code-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarto-ext%2Finclude-code-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quarto-ext%2Finclude-code-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quarto-ext","download_url":"https://codeload.github.com/quarto-ext/include-code-files/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253815476,"owners_count":21968631,"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":[],"created_at":"2024-08-03T22:00:57.378Z","updated_at":"2025-05-12T20:26:20.443Z","avatar_url":"https://github.com/quarto-ext.png","language":"Lua","funding_links":[],"categories":["Extensions"],"sub_categories":[],"readme":"# Include Code Files Extension For Quarto\n\nFilter to include code from source files.\n\nThe filter is largely inspired by\n[pandoc-include-code](https://github.com/owickstrom/pandoc-include-code).\n\n## Installing\n\n```bash\nquarto add quarto-ext/include-code-files\n```\n\nThis will install the extension under the `_extensions` subdirectory.\nIf you're using version control, you will want to check in this directory.\n\n## Usage\n\nThe filter recognizes code blocks with the `include` attribute present. It swaps the content of the code block with contents from a file.\n\nHere is how you add the filter to a page (it can also be added to a `_quarto.yml` project file with the same syntax):\n\n````markdown\n---\ntitle: \"My Document\"\nfilters:\n   - include-code-files\n---\n\n````\n\n### Including Files\n\nOnce adding the filter to you page or project, the simplest way to use the filter is the `include` attribute\n\n    ```{.python include=\"script.py\"}\n    ```\n\nYou can still use other attributes, and classes, to control the code blocks:\n\n    ```{.python include=\"script.py\" code-line-numbers=\"true\"}\n    ```\n\n### Ranges\n\nIf you want to include a specific range of lines, use `start-line` and `end-line`:\n\n    ```{.python include=\"script.py\" start-line=35 end-line=80}\n    ```\n\n### Dedent\n\nUsing the `dedent` attribute, you can have whitespaces removed on each line, where possible (non-whitespace character will not be removed even if they occur\nin the dedent area).\n\n    ```{.python include=\"script.py\" dedent=4}\n    ```\n\n### Snippets\n\nUsing the `snippet` attribute, one may use ``pandoc-include-code`` style \nsnippets, for instance\n\n    ```{.python include=\"script.py\" snippet=\"main\"}\n    ```\n\nwill include the snippet 'main' which is enclosed between ``# start snippet main``\nand ``# end snippet main`` in the following \n\n```python\n# script.py\n\n# start snippet main\ndef main():\n    print(\"It works!\")\n\n# end snippet main\n```\n\n\nFor now this should support include for ``python``, ``r``, ``julia``, ``html``,\n``js``, ``ojs``, and ``css``. It might work on other documents too, but will \nhave to guess.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquarto-ext%2Finclude-code-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquarto-ext%2Finclude-code-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquarto-ext%2Finclude-code-files/lists"}