Add lightspeed_rag_content.asciidoc subpackage#39
Merged
jpodivin merged 5 commits intoroad-core:mainfrom Mar 25, 2025
Merged
Conversation
This commit adds the ligthspeed_rag_content.asciidoc package. The
purpose of this package is to:
1. Provide an interface for easy conversion of AsciiDoc formatted
files, mainly to text format.
The AsciidoctorConverter class can be used to convert AsciiDoc
files. On the backend, the class uses asciidoctor tool [1]. This
makes the package dependent on this tool and ruby. The main reason
for picking this tool is that as of now there is no easy way to
convert AsciiDoc formatted files to text format using pure Python
and as we have already an extension written for asciidoctor, we can
reuse it.
This commit does not rule out the possibility of introducing a new
converter later with a more suitable backend based on pure Python.
One can convert the .adoc file either by using
the AsciidoctorConverter class or by using the
lightspeed_rag_content.asciidoc module as follows:
python -m lightspeed_rag_content.asciidoc convert \
-i input_file.adoc -o output_file.txt
2. Allow investigation of a structure of AsciiDoc formatted files.
The introduced package wraps an already existing ruby script that
dumps a file structure of adoc file. This comes handy when writing
custom ruby extension for asciidoctor. The script can be used
as follows:
python -m lightspeed_rag_content.asciidoc get_structure input.adoc
[1] https://asciidoctor.org/
Signed-off-by: Lukas Piwowarski <lpiwowar@redhat.com>
This commit adds unit tests for the ligthspeed_rag_content.asciidoc package. Signed-off-by: Lukas Piwowarski <lpiwowar@redhat.com>
0aa7e94 to
54e6eb6
Compare
Contributor
Author
lpiwowar
commented
Mar 20, 2025
7e93a31 to
66a4814
Compare
This commit allows using the AsciidoctorConverter to convert AsciiDoc files to target formats that are by default supported by asciidoctor: - html5 - xhtml5 - manpage Signed-off-by: Lukas Piwowarski <lpiwowar@redhat.com>
66a4814 to
711c65c
Compare
Contributor
Author
|
I've created an issue here -> #41 It seems like sometimes the |
This commit adds asciidoctor binary into the base image. This allows the consumers of that image to use the lightspeed_rag_content.asciidoc sub-package, as it is heavily dependent on asciidoctor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds the
ligthspeed_rag_content.asciidocpackage. The purpose of this package is to:1. Provide an interface for easy conversion of AsciiDoc formatted files, mainly to text format.
The
AsciidoctorConverterclass can be used to convert AsciiDoc files. On the backend, the class usesasciidoctortool [1]. This makes the package dependent on this tool and ruby. The main reason for picking this tool is that as of now there is no easy way to convert AsciiDoc formatted files to text format using pure Python and as we have already an extension written forasciidoctor, we can reuse it.This commit does not rule out the possibility of introducing a new converter later with a more suitable backend based on pure Python.
One can convert the
.adocfile either by using theAsciidoctorConverterclass or by using thelightspeed_rag_content.asciidocmodule as follows:2. Allow investigation of a structure of AsciiDoc formatted files.
The introduced package wraps an already existing ruby script that dumps a file structure of
.adocfile. This comes handy when writing custom ruby extension for asciidoctor. The script can be used as follows:[1] https://asciidoctor.org/