{"id":22427803,"url":"https://github.com/jhradilek/asciidoctor-dita-topic","last_synced_at":"2025-06-30T15:37:34.566Z","repository":{"id":240925942,"uuid":"803801194","full_name":"jhradilek/asciidoctor-dita-topic","owner":"jhradilek","description":"An AsciiDoc converter that generates individual DITA 1.3 topics","archived":false,"fork":false,"pushed_at":"2025-06-23T21:54:46.000Z","size":109,"stargazers_count":4,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-23T22:38:06.142Z","etag":null,"topics":["asciidoc","asciidoctor","asciidoctor-extension","dita","dita-ot"],"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/jhradilek.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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-21T12:11:31.000Z","updated_at":"2025-06-23T21:32:07.000Z","dependencies_parsed_at":"2024-05-21T13:36:11.011Z","dependency_job_id":"a3c28c57-1699-4caf-9cf0-9fcc4c6bd644","html_url":"https://github.com/jhradilek/asciidoctor-dita-topic","commit_stats":null,"previous_names":["jhradilek/asciidoctor-dita-topic"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/jhradilek/asciidoctor-dita-topic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhradilek%2Fasciidoctor-dita-topic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhradilek%2Fasciidoctor-dita-topic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhradilek%2Fasciidoctor-dita-topic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhradilek%2Fasciidoctor-dita-topic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhradilek","download_url":"https://codeload.github.com/jhradilek/asciidoctor-dita-topic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhradilek%2Fasciidoctor-dita-topic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261570496,"owners_count":23178732,"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":["asciidoc","asciidoctor","asciidoctor-extension","dita","dita-ot"],"created_at":"2024-12-05T20:12:55.084Z","updated_at":"2025-06-30T15:37:34.556Z","avatar_url":"https://github.com/jhradilek.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"= dita-topic\n\n`dita-topic` is a custom converter for Asciidoctor that converts a single AsciiDoc file to a corresponding DITA 1.3 topic.\n\nIn combination with link:https://github.com/jhradilek/asciidoctor-dita-vale[asciidoctor-dita-vale] and link:https://github.com/jhradilek/dita-custom-xslt#installation[dita-convert], this project can be used to rapidly convert AsciiDoc content to DITA:\n\n. Identify incompatible markup in the AsciiDoc source file:\n+\n[literal,subs=\"+quotes\"]\n....\n$ *vale source_file.adoc*\n....\n\n. Convert the AsciiDoc file to a generic DITA topic:\n+\n[literal,subs=\"+quotes\"]\n....\n$ *asciidoctor -r dita-topic -b dita-topic source_file.adoc*\n....\n\n. Convert the generic DITA topic to a specialized DITA concept, reference, or task:\n+\n[literal,subs=\"+quotes\"]\n....\n$ *dita-convert -gt task source_file.dita*\n....\n\n[#install]\n== Installation\n\nInstall the `asciidoctor-dita-topic` Ruby gem:\n\n[literal,subs=\"+quotes\"]\n....\n$ *gem install asciidoctor-dita-topic*\n....\n\n[#use]\n== Usage\n\nTo use the custom converter on the command line, load it with the `-r dita-topic` option and then select `dita-topic` as the backend output format with `-b dita-topic`:\n\n[literal,subs=\"+quotes\"]\n....\n$ *asciidoctor -r dita-topic -b dita-topic _your_file_.adoc*\n....\n\nThis creates a new file, `_your_file_.dita`, in the same directory as `_your_file_.adoc`. You can also convert multiple files at the same time:\n\n[literal,subs=\"+quotes\"]\n....\n$ **asciidoctor -r dita-topic -b dita-topic *.adoc**\n....\n\n[IMPORTANT]\n====\n`dita-topic` does not validate the converted content. If you have link:https://www.dita-ot.org/[DITA Open Toolkit] installed, you can check that the converted file can be built as follows:\n\n[literal,subs=\"+quotes\"]\n....\n$ **dita -i _converted_file_.dita -f xhtml**\n....\n\nTo produce slightly more readable errors, you can also use `xmlstarlet`:\n\n[literal,subs=\"+quotes\"]\n....\n$ **xmlstarlet val -e -s _path_to_dita-ot_directory_/plugins/org.oasis-open.dita.v1_3/schema-url/technicalContent/xsd/topic.xsd _converted_file_.dita**\n....\n====\n\n[#attributes]\n=== Supplying attribute definitions\n\nIf your AsciiDoc files use attributes that are defined outside of these files, you can supply the attribute definitions on the command line with the `-a _attribute_=_value_` option:\n\n[literal,subs=\"+quotes\"]\n....\n$ **asciidoctor -r dita-topic -b dita-topic -a _attribute_=_value_ _your_file_.adoc**\n....\n\nYou can provide multiple `-a _attribute_=_value_` options at the same time. Providing relevant attribute definitions is especially important if your document contains conditional content.\n\n.Providing a product version to resolve `ifeval` conditions\n====\nYour AsciiDoc files include a number of `ifeval` statements that provide different content for different versions of the product you are documenting:\n\n[source]\n----\n\\ifeval::[\"{ProductNumber}\" == \"1\"]\n...\n\\endif::[]\n\\ifeval::[\"{ProductNumber}\" == \"2\"]\n...\n\\endif::[]\n----\n\nTo ensure that the converted DITA files include all content for version 2 of your product, run:\n\n[literal,subs=\"+quotes\"]\n....\n$ **asciidoctor -r dita-topic -b dita-topic -a ProductNumber=2 *.adoc**\n....\n====\n\n[#authors]\n=== Enabling author lines\n\nAsciiDoc topics are expected to be included in other files and therefore should not contain link:https://docs.asciidoctor.org/asciidoc/latest/document/author-line/[author line] definitions. In most cases, lines that directly follow the topic title are intended as first paragraphs. For this reason, author lines are disabled by default. To avoid losing content during conversion, as a workaround, the `dita-topic` converter interprets the raw content of the author line as a paragraph and issues a warning.\n\nTo enable processing of author lines as metadata, set the value of the `dita-topic-authors` to `on`:\n\n[literal,subs=\"+quotes\"]\n....\n$ **asciidoctor -r dita-topic -b dita-topic -a dita-topic-authors=on _your_file_.adoc**\n....\n\n[#titles]\n=== Disabling floating titles\n\nUnlike AsciiDoc, DITA does not support floating titles and only allows titles to be assigned to a limited number of elements. To avoid losing content during conversion, as a workaround, the `dita-topic` converter uses the following markup by default:\n\n[source,xml]\n----\n\u003cp outputclass=\"title\"\u003e\u003cb\u003eFloating title\u003c/b\u003e\u003c/p\u003e\n----\n\nTo disable this behavior, set the value of the `dita-topic-titles` to `off`:\n\n[literal,subs=\"+quotes\"]\n....\n$ **asciidoctor -r dita-topic -b dita-topic -a dita-topic-titles=off _your_file_.adoc**\n....\n\n[#callouts]\n=== Disabling callouts\n\nUnlike AsciiDoc, DITA does not support callouts as a method to add annotations to specific lines in verbatim blocks. To avoid losing content during conversion, as a workaround, the `dita-topic` converter uses XML entities for circled numbers.\n\nTo disable this behavior, set the value of the `dita-topic-callouts` to `off`:\n\n[literal,subs=\"+quotes\"]\n....\n$ **asciidoctor -r dita-topic -b dita-topic -a dita-topic-callouts=off _your_file_.adoc**\n....\n\n[#includes]\n=== Disabling include directives\n\nBy default, Asciidoctor resolves all `include` directives before converting the file. To only convert the contents of the selected file, specify the `-S secure` option:\n\n[literal,subs=\"+quotes\"]\n....\n$ **asciidoctor -r dita-topic -b dita-topic -S secure _your_file_.adoc**\n....\n\n[#abstracts]\n=== Adding short descriptions\n\nDITA provides the `\u003cshortdesc\u003e` element which allows the user to describe the purpose of the topic and is often used as preview text in search results. To replicate this behavior, the `dita-topic` converter recognizes a paragraph preceded by the `[role=\"_abstract\"]` attribute list and adds the `outputclass=\"abstract\"` attribute to it. The link:https://github.com/jhradilek/dita-custom-xslt#installation[dita-convert Python package] transforms such a paragraph to `\u003cshortdesc\u003e` during conversion to a specialized DITA concept, reference, or task.\n\nFor example, to designate a paragraph as a short description, use the following AsciiDoc markup:\n\n[source,asciidoc]\n----\n[id=\"topic-id\"]\n= Procedure title\n\n[role=\"_abstract\"]\nA short description of the procedure module and what it helps the\nuser accomplish.\n\nAn introductory paragraph.\n----\n\n[#semantics]\n=== Adding semantic markup\n\nUnlike AsciiDoc, DITA provides a number of semantic elements for software components such as file names, commands, or command-line options. To replicate this behavior, the `dita-topic` converter recognizes the following link:https://docs.asciidoctor.org/asciidoc/latest/attributes/role/#assign-roles-to-formatted-inline-elements[roles] assigned to monospace (```) inline text:\n\n[cols=\"1,1\"]\n|===\n| AsciiDoc Role\n| DITA Element\n\n| command\n| `\u003ccmdname\u003e`\n\n| directory\n| `\u003cfilepath\u003e`\n\n| filename\n| `\u003cfilepath\u003e`\n\n| option\n| `\u003coption\u003e`\n\n| variable\n| `\u003cvarname\u003e`\n|===\n\nFor example, to describe a file name, use the following AsciiDoc markup:\n\n[source,asciidoc]\n----\nRead the [filename]`/etc/passwd` file to see the complete list of\navailable user accounts.\n----\n\n[#warnings]\n== Warnings\n\nDespite aspiring to avoid losing content during conversion and produce a valid DITA output, there are limitations to what is possible because of the differences between the two markup languages. When the `dita-topic` converter encounters a possible problem, it prints a warning to standard error output in the following format:\n\n[literal,subs=\"+quotes\"]\n....\nasciidoctor: WARNING: dita-topic: _The warning message_\n....\n\nThis possible warning messages are as follows:\n\n[horizontal]\nAdmonition titles not supported in DITA:: AsciiDoc allows you to add a custom title to any admonition by including `._Admonition title_` on the line above it. Unlike AsciiDoc, DITA does not allow titles for admonitions. `dita-topic` issues this warning whenever an admonition has a title defined in the converted AsciiDoc file.\n\nAuthor lines not enabled for topics:: AsciiDoc interprets the first line that directly follows the document title as an author line. Because topics are not expected to have author lines, `dita-topic` issues this warning when an author line is present in the converted AsciiDoc file.\n\nBlock titles not supported in DITA:: AsciiDoc allows you to include `._Block title_` on the line above most of the block elements to assign a custom title to them. Unlike AsciiDoc, DITA only allows titles to be assigned to a limited number of elements. `dita-topic` issues this warning when the `-a dita-topic-titles=off` option is specified and a block title is present in the converted AsciiDoc file.\n\nCallouts not supported in DITA:: AsciiDoc allows you to use `\u003c1\u003e`, `\u003c2\u003e`, `\u003c3\u003e` and so on in verbatim blocks to add annotations to the specific lines. Unlike AsciiDoc, DITA does not provide a direct equivalent for this functionality. `dita-topic` issues this warning when the `-a dita-topic-callouts=off` option is specified and these annotations are present in the converted AsciiDoc file.\n\nExamples not supported within _object_ in DITA:: AsciiDoc allows you to use an example block anywhere in the document. Unlike AsciiDoc, DITA only allows examples to appear directly in the topic body. `dita-topic` issues a warning whenever an example is nested in another AsciiDoc element.\n\nFloating titles not supported in DITA:: AsciiDoc allows you to use floating titles anywhere in the document. Unlike AsciiDoc, DITA does not support floating titles. `dita-topic` issues this warning when the `-a dita-topic-titles=off` option is specified and a floating title is present in the converted AsciiDoc file.\n\nInline breaks not supported in DITA:: AsciiDoc provides multiple ways to insert line breaks in paragraphs, such as inserting `{nbsp}+` at the end of the line or specifying `[%hardbreaks]` on the line preceding the paragraph. Unlike AsciiDoc, DITA does not provide direct equivalent for this functionality. `dita-topic` issues this warning whenever an inline line break is present in the converted AsciiDoc file and places the `\u003c!-- break -\\-\u003e` comment in the output file to mark its place.\n\nNesting of sections not supported in DITA:: AsciiDoc allows you to nest sections up to 5 levels deep. Unlike AsciiDoc, DITA does not allow the `\u003csection\u003e` elements to be nested. `dita-topic` issues a warning whenever nested sections are present in the converted AsciiDoc file.\n\nPage breaks not supported in DITA:: AsciiDoc allows you to use `\u003c\u003c\u003c` on a separate line to enforce a page break in output formats that support it. Unlike AsciiDoc, DITA does not support page breaks. `dita-topic` issues this warning whenever a page break is present in the converted AsciiDoc file and places the `\u003cp outputclass=\"page-break\"\u003e\u003c/p\u003e` in the output file to mark its place.\n\nPossible invalid reference: _reference_:: AsciiDoc allows you to cross reference by using an ID no matter if this ID is defined within or outside of the converted document. Unlike AsciiDoc, DITA requires both the target ID and the ID of the target topic to be included in the cross reference if the reference leads outside of the current file. As `dita-topic` is meant to be run on individual AsciiDoc files, it does not have access to information from referenced files during conversion. `dita-topic` issues this warning whenever the cross reference target is not present in the converted AsciiDoc file.\n\nSidebars not supported in DITA:: AsciiDoc allows you to assign any block the `[sidebar]` block style or enclose it between a pair of `\\****` to create a delimited sidebar block. Unlike AsciiDoc, DITA does not support sidebar blocks. `dita-topic` issues this warning when the `-a dita-topic-sidebars=off` option is specified and a sidebar block is present in the converted AsciiDoc file.\n\nSTEM support not implemented:: AsciiDoc provides multiple ways to insert Science, Technology, Engineering and Math (STEM) expressions in the document, including the `\\stem:[_formula_]` inline macro and the `[stem]` delimited block. `dita-topic` does not implement this feature and issues this warning whenever such an expression is present in the converted AsciiDoc file.\n\nTable footers not supported in DITA:: AsciiDoc allows you to set the `footer` option to mark the last table row as a table footer. Unlike AsciiDoc, DITA does not support table footers. `dita-topic` issues this warning whenever a table footer is present in the converted AsciiDoc file.\n\nThematic breaks not supported in DITA:: Asciidoc allows you to use `'''`, `---`, or `\\***` (the last two with possible optional spaces in between the characters) to insert a thematic break in between two blocks, most commonly represented by a horizontal line. Unlike AsciiDoc, DITA does not support thematic breaks. `dita-topic` issues this warning whenever a thematic break is present in the converted AsciiDoc file.\n\n[#copyright]\n== Copyright\n\nCopyright (C) 2024, 2025 Jaromir Hradilek\n\nThis program is free software, released under the terms of the link:LICENSE[MIT license]. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhradilek%2Fasciidoctor-dita-topic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhradilek%2Fasciidoctor-dita-topic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhradilek%2Fasciidoctor-dita-topic/lists"}