{"id":18547633,"url":"https://github.com/singond/gradle-pandoc","last_synced_at":"2025-05-15T07:34:26.191Z","repository":{"id":133722333,"uuid":"162166028","full_name":"Singond/Gradle-Pandoc","owner":"Singond","description":"A Gradle plugin for converting markdown files to output with Pandoc","archived":false,"fork":false,"pushed_at":"2019-11-01T10:18:59.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-17T09:43:18.684Z","etag":null,"topics":["gradle-plugin","pandoc"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/Singond.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-12-17T17:22:32.000Z","updated_at":"2019-11-01T10:18:31.000Z","dependencies_parsed_at":"2024-07-26T08:02:49.685Z","dependency_job_id":null,"html_url":"https://github.com/Singond/Gradle-Pandoc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Singond%2FGradle-Pandoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Singond%2FGradle-Pandoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Singond%2FGradle-Pandoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Singond%2FGradle-Pandoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Singond","download_url":"https://codeload.github.com/Singond/Gradle-Pandoc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254296280,"owners_count":22047239,"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":["gradle-plugin","pandoc"],"created_at":"2024-11-06T20:30:18.441Z","updated_at":"2025-05-15T07:34:26.169Z","avatar_url":"https://github.com/Singond.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Pandoc plugin for Gradle\n========================\nThis plugin enables using the Pandoc converter from a build script.\n[Pandoc](https://pandoc.org/index.html) is a universal tool which can convert\ndocuments to and from a wide array of formats, including (but not limited to)\nMarkdown, HTML, Texinfo, man, LaTeX, PDF and even Microsoft Word docx.\n\nThe plugin does _not_ come bundled with Pandoc. Instead, it uses system calls\nto invoke whichever version of Pandoc is installed on your system. Please see\nthe Pandoc website in order to download the tool.\n\nRequirements\n------------\n- [Pandoc](https://pandoc.org/index.html) and its dependencies must be\n  installed on your system.\n\nUsage\n=====\nTo enable the plugin, add the following to the top of your `build.gradle`:\n\n```groovy\nbuildscript {\n\trepositories {\n\t\tmaven {\n\t\t\turl 'https://dl.bintray.com/singon/maven'\n\t\t}\n\t}\n\tdependencies {\n\t\t// Prefer a fixed version instead of '0.+'\n\t\tclasspath 'com.github.singond:gradle-pandoc:0.+'\n\t}\n}\napply plugin: 'com.github.singond.pandoc'\n```\n\nA new task type `Pandoc` is now available; its fully-qualified name is\n`com.github.singond.gradle.pandoc.Pandoc`.\nAlso, a single instance of this task called `pandoc` has been added to your\nproject. You need to configure it first, for example:\n\n```groovy\npandoc {\n\tsources \"docs\"\n\toutputDir \"$buildDir/docs\"\n\tformat \"html\", \"html\"\n\tformat \"latex\", \"pdf\"\n}\n```\n\nThis will convert every file in the `docs` directory into a corresponding\n`html` and `pdf` file in the `${buildDir}/docs` directory, assuming thah\n`pandoc` is installed on your system and available in `PATH`.\n\n\nLocating Pandoc Installation\n--------------\nIf the `pandoc` tool is not in your `PATH`, the build will not be able to\ncomplete successfully. In order to correct this, specify another location by\nadding:\n\n```groovy\npandoc {\n\t...\n\tpandocPath \"/path/to/pandoc\"\n}\n```\n\nControlling Output\n------------------\n\n### Output Format\nIf you don't specify any conversion format, this plugin will not do anything.\nTo add a conversion format, specify its name, and (optionally) a corresponding\nfile name extension in the `format` method.\nThe format name (here, `latex`) must be a format name recognized by Pandoc.\nPlease refere to the `pandoc` manual for the list of available formats.\n\n```groovy\npandoc {\n\t...\n\tformat \"latex\", \"pdf\"\n}\n```\n\nThis tells Gradle to convert every source file into a `pdf` file by using\nthe `latex` conversion format. It roughly translates into:\n\n```sh\npandoc filename.md --to=latex --output=filename.pdf\n```\n\nIf the format name and file extension is the same, you can omit the second\nargument:\n\n```\npandoc {\n\t...\n\tformat \"html\"\n}\n```\n\nYou can also specify more than one format:\n\n```\npandoc {\n\t...\n\tformat \"latex\", \"pdf\"\n\tformat \"html\"\n}\n```\n\nThis will convert every source file into a `pdf` file (through LaTeX)\nand a `html` file.\n\n### Output Directory\nThe converted files are placed into the `${outputDir}` directory.\nBy default, they are divided into subdirectories according to their type.\nFor example, consider we have the following file structure in the project root:\n\n```\ndocs/\n\tdocument-1.md\n\tdocument-2.md\n\tdocument-3.md\n```\n\nThis is our `build.gradle`:\n\n```\npandoc {\n\tsources \"docs\"\n\toutputDir \"$buildDir/docs\"\n\tformat \"html\"\n\tformat \"latex\", \"pdf\"\n}\n```\n\nRunning `gradle pandoc` will result in the following files being created\n(assuming that your build directory is set to `build` (the default):\n\n```\nbuild/\n\tdocs/\n\t\thtml/\n\t\t\tdocument-1.html\n\t\t\tdocument-2.html\n\t\t\tdocument-3.html\n\t\tlatex-pdf/\n\t\t\tdocument-1.pdf\n\t\t\tdocument-2.pdf\n\t\t\tdocument-3.pdf\n```\n\nIf you prefer not to split the output files into subdirectories by type,\nyou can set the `separateOutput` option to false:\n\n```\npandoc {\n\tsources \"docs\"\n\toutputDir \"$buildDir/docs\"\n\tformat \"html\"\n\tformat \"latex\", \"pdf\"\n\tseparateOutput false\n}\n```\nAssuming the same source files structure, this will yield:\n\n```\nbuild/\n\tdocs/\n\t\tdocument-1.html\n\t\tdocument-1.pdf\n\t\tdocument-2.html\n\t\tdocument-2.pdf\n\t\tdocument-3.html\n\t\tdocument-3.pdf\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsingond%2Fgradle-pandoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsingond%2Fgradle-pandoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsingond%2Fgradle-pandoc/lists"}