{"id":21253919,"url":"https://github.com/courseorchestra/asciidoctor-open-document","last_synced_at":"2025-07-11T01:33:29.861Z","repository":{"id":38195189,"uuid":"364591658","full_name":"CourseOrchestra/asciidoctor-open-document","owner":"CourseOrchestra","description":"Open Document converter for Asciidoctor","archived":false,"fork":false,"pushed_at":"2024-10-30T05:24:44.000Z","size":5415,"stargazers_count":24,"open_issues_count":3,"forks_count":7,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-30T08:36:16.639Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/CourseOrchestra.png","metadata":{"files":{"readme":"README.adoc","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":"2021-05-05T13:47:02.000Z","updated_at":"2024-07-22T16:30:50.000Z","dependencies_parsed_at":"2023-10-03T10:37:00.573Z","dependency_job_id":"d300ffa5-f73c-4dda-bca0-6329c6a21f2c","html_url":"https://github.com/CourseOrchestra/asciidoctor-open-document","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseOrchestra%2Fasciidoctor-open-document","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseOrchestra%2Fasciidoctor-open-document/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseOrchestra%2Fasciidoctor-open-document/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseOrchestra%2Fasciidoctor-open-document/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CourseOrchestra","download_url":"https://codeload.github.com/CourseOrchestra/asciidoctor-open-document/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225669588,"owners_count":17505386,"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-11-21T03:53:28.199Z","updated_at":"2024-11-21T03:53:28.710Z","avatar_url":"https://github.com/CourseOrchestra.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":":toc: macro\n:toclevels: 4\n\nimage::https://github.com/CourseOrchestra/asciidoctor-open-document/workflows/build/badge.svg[link=https://github.com/CourseOrchestra/asciidoctor-open-document/actions?query=workflow%3A\"build\"]\n\n= Open Document converter for Asciidoctor\n\ntoc::[]\n\n== About\n\n//tag::about[]\nOpen Document converter for Asciidoctor allows to convert asciidoc documentation into fodt (plain Open Document) format. It relies on https://docs.asciidoctor.org/home/[Asciidoctor project].\n\nFodt file may be converted with https://www.libreoffice.org/[LibreOffice] SDK or CLI into pdf, odt, docx, doc etc.\n\nExamples (built automatically as a part of CI routine):\n\n* https://github.com/CourseOrchestra/asciidoctor-open-document/blob/main/test/test_cases/stew/test.adoc[source asciidoc file];\n* https://courseorchestra.github.io/asciidoctor-open-document/test.fodt[fodt file] (indexes are not updated);\n* https://courseorchestra.github.io/asciidoctor-open-document/test.odt[odt file];\n* https://courseorchestra.github.io/asciidoctor-open-document/test.pdf[pdf file];\n* https://courseorchestra.github.io/asciidoctor-open-document/test.docx[docx file] -- yes, sometimes messy, but generally not so bad and there is always a possibility to simplify conversion rules and tailor them to the needs of the exact project.\n\nThe asciidoctor-open-document converter can be extended in the following ways:\n\n* custom fodt template. Allows to customize paragraph properties, text properties, page properties (orientation, header, footer and like), list properties, table properties. Custom fodt template can contain title page or any before/after content;\n* custom slim templates;\n* custom xml-content preprocessor;\n* custom Open Document style setters.\n//end::about[]\n\n== Usage\n\n//tag::usage[]\n\n=== With docker\n\n==== With `a-od` simplified utility\n\nAssuming you need to convert `test.adoc` from the current directory to odt format.\n\n----\ndocker run --rm -v $(pwd):/documents/ curs/asciidoctor-od a-od test.adoc odt\n----\n\nGeneral syntax of `a-od` is:\n\n----\na-od [file] [output format] [custom fodt temlate] [custom conversion library]\n----\n\nTo use asciidoctor cli options add `--asciidoctor` at the end and any asciidoctor cli options. For example, to convert `foo.adoc` to pdf with revision number `v5` use:\n\n----\na-od foo.adoc pdf --asciidoctor -a revnumber=v5\n----\n\n==== Or step by step without `a-od`\n\n* Convert adoc to preliminary Open Document content file\n+\nThe following steps assume that asciidoc file `test.adoc` is in the `/my-adoc` directory. As a result we want to get `test.fodt` and `test.pdf`.\n+\n----\ndocker run --rm -v $(pwd):/documents/ curs/asciidoctor-od a-od-pre -r asciidoctor-mathematical -r asciidoctor-diagram test.adoc -o pre.xml\n----\n+\nHere `asciidoctor-mathematical` and `asciidoctor-diagram` extensions are used.\n\n* Convert preliminary Open Document content file to fodt\n+\n----\ndocker run --rm -v $(pwd):/documents/ curs/asciidoctor-od a-od-out -c /usr/local/a-od/a-od-my/my-cp-example.rb -i pre.xml -o test.fodt\n----\n+\nHere the custom library is used. It contains examples of custom features: positioning equation number, paragraph alignment role, code highlighting, positioning admonitions inside of the list element.\n\n* Convert fodt to pdf, odt, docx\n+\n----\ndocker run --rm -v $(pwd):/documents/ curs/asciidoctor-od java -jar /usr/local/a-od/lo-kts-converter.main.jar -f pdf,odt,docx -i test.fodt\n----\n\n=== As a ruby script\n\nConversion consists of 2 steps.\n\n. Convert adoc to preliminary content file\n. Convert preliminary content file to fodt\n\n==== Convert adoc to preliminary content file\n\nConversion to preliminary content file is done by the standard `asciidoctor` command with a slim template (slim folder of a source code).\n\n----\nasciidoctor -T [path to slim] -b fodt asciidoc_file.adoc\n----\n\nThere is a wrapper `a-od-pre` in docker image. Use it like a normal `asciidoctor` command. It just sets slim template and backend.\n\n\n==== Convert preliminary content file to fodt\n\nConversion to final fodt file is done with the `asciidoctor-od.rb` script.\n\n----\nruby [path to script]/a-od-producer.rb -i [prelimenary content file] -o [final file] -c [custom process library] -f [fodt template]\n----\n\nThere is a wrapper `a-od-out` in docker image. It just runs ruby with `a-od-producer.rb`.\n//end::usage[]\n\n*More details* can be found in https://courseorchestra.github.io/asciidoctor-open-document/[Open Document converter for Asciidoctor documentation].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcourseorchestra%2Fasciidoctor-open-document","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcourseorchestra%2Fasciidoctor-open-document","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcourseorchestra%2Fasciidoctor-open-document/lists"}