{"id":15816617,"url":"https://github.com/shaunbharat/render-gfm","last_synced_at":"2025-06-13T20:07:13.543Z","repository":{"id":40782475,"uuid":"489541838","full_name":"shaunbharat/render-gfm","owner":"shaunbharat","description":"Render GitHub Flavoured Markdown, with CSS for each of GitHub's themes","archived":false,"fork":false,"pushed_at":"2024-07-01T07:47:49.000Z","size":157,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-07T12:49:38.408Z","etag":null,"topics":["css","github","github-flavored-markdown","github-themes","markdown","render","syntax-highlighting","themes"],"latest_commit_sha":null,"homepage":"https://shaunbharat.github.io/render-gfm/","language":"TypeScript","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/shaunbharat.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":"2022-05-07T01:58:36.000Z","updated_at":"2025-01-24T20:08:29.000Z","dependencies_parsed_at":"2024-10-26T18:24:28.341Z","dependency_job_id":null,"html_url":"https://github.com/shaunbharat/render-gfm","commit_stats":{"total_commits":17,"total_committers":3,"mean_commits":5.666666666666667,"dds":"0.23529411764705888","last_synced_commit":"b8d25b8e65a42f8dd6716919deae821751f74d5e"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaunbharat%2Frender-gfm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaunbharat%2Frender-gfm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaunbharat%2Frender-gfm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaunbharat%2Frender-gfm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaunbharat","download_url":"https://codeload.github.com/shaunbharat/render-gfm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaunbharat%2Frender-gfm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259138928,"owners_count":22811021,"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":["css","github","github-flavored-markdown","github-themes","markdown","render","syntax-highlighting","themes"],"created_at":"2024-10-05T05:06:01.917Z","updated_at":"2025-06-13T20:07:13.513Z","avatar_url":"https://github.com/shaunbharat.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# render-gfm\n\nRender GitHub Flavoured Markdown, with CSS for each of GitHub's themes.\n\n- [GitHub Repository](https://github.com/shaunbharat/render-gfm)\n- [npm Package](https://www.npmjs.com/package/render-gfm)\n- [Documentation](https://shaunbharat.github.io/render-gfm/render-gfm)\n\n## See Example\n\n[This version is rendered Markdown, through GitHub Pages alone.](https://shaunbharat.github.io/render-gfm/pages)\n\n[This version is rendered Markdown, using render-gfm.](https://shaunbharat.github.io/render-gfm)\n\n## CLI\n\n### Install (Globally)\n\n```bash\n# Install render-gfm with the --global option (-g) to use the CLI.\nnpm install -g render-gfm\n```\n\n### Usage (Commands)\n\n\u003e Use the help option (`--help` or `-h`) to see the usage information for each command.\n\n```bash\nrender-gfm --help\n\n# Render Markdown files\nrender-gfm markdown --help\n\n# Generate CSS\nrender-gfm themes --help\n```\n\n\u003e Examples of the `markdown` command\n\n```bash\n# Example - Render \"README.md\" and \"test.md\" Markdown files to the output folder \"docs\" in the current directory\nrender-gfm markdown  -o ./docs README.md test.md\n\n# or another example (both relative and absolute paths are allowed)\nrender-gfm markdown -o ../dist C:/Users/Owner/Desktop/Project/README.md\n```\n\n\u003e Examples of the `themes` command\n\n```bash\n# Example - Generate and write the CSS files to the output folder \"css\" in the current directory\nrender-gfm themes -o ./css\n```\n\n### Usage (Functions)\n\n\u003e The CLI commands are just wrappers around some functions. These functions have been written specifically for the CLI, but are exported and can be used in your code directly.\n\n```javascript\n/**\n * Render Markdown files (looks in the current working directory by default, if relative paths are specified) to the specified output directory.\n * @param {string[]} files An array of the Markdown file paths to render. Can be absolute or relative paths.\n * @param {string} outputDir The directory to write the rendered HTML to. If unspecified, the default is the folder \"dist\" in the current working directory.\n */\nexport async function markdown(files: string[], outputDir: string = './dist');\n\n/**\n * Generate CSS files for each of GitHub's themes to the specified output directory.\n * @param {string} outputDir The directory to write the CSS files to. If unspecified, the default is the folder \"dist/css\" in the current working directory.\n */\nexport async function themes(outputDir: string = './dist/css');\n```\n\n## API\n\n### Install\n\n```bash\n# Install render-gfm to your JavaScript project.\nnpm install render-gfm\n```\n\n### Usage\n\n```javascript\nimport render, { generateCSS } from 'render-gfm';\n\n/**\n * Generates and returns CSS for each requested theme in the `themes` array, as an object\n * @param {string} outputDir The directory to write the CSS files to. If unspecified, the CSS will still be returned in an object, but not written to the filesystem.\n * @param {Theme[]} themes An array of the themes to generate CSS for. Defaults to all themes.\n * @returns {Promise\u003cRecord\u003cstring, string\u003e\u003e} An object containing the CSS for each theme.\n */\nexport async function generateCSS(outputDir: string, themes: Theme[] = [Theme.Auto, Theme.Light, Theme.Dark, Theme.DarkDimmed, Theme.DarkHighContrast, Theme.LightColorblind, Theme.DarkColorblind]): Promise\u003cRecord\u003cstring, string\u003e\u003e;\n\n/**\n * Renders Markdown to HTML. If `outputFile` is specified, the HTML will be written to the filesystem.\n * The resulting HTML rendered will be wrapped in a default template, unless `includeDefaultTemplate` is set to false.\n * This is useful for when you want to use your own HTML template.\n * @param {string} markdown The Markdown to render.\n * @param {string} outputFile The file to write the rendered HTML to. If unspecified, the HTML will still be returned, but not written to the filesystem.\n * @param {boolean} includeDefaultTemplate Whether or not to include the default HTML template. Default: true. If false, the rendered Markdown will not be wrapped in a template.\n * @returns {Promise\u003cstring\u003e} The rendered HTML.\n */\nexport default async function render(markdown: string, outputFile: string, includeDefaultTemplate: boolean = true): Promise\u003cstring\u003e;\n```\n\n## License\n\nCopyright © 2022 [Shaun Bharat](https://github.com/shaunbharat).\n\nThis project is licensed with the [MIT](https://github.com/shaunbharat/render-gfm/blob/main/LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaunbharat%2Frender-gfm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaunbharat%2Frender-gfm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaunbharat%2Frender-gfm/lists"}