Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example showing how to load a custom template #15

Open
abelsromero opened this issue May 9, 2015 · 7 comments
Open

Add an example showing how to load a custom template #15

abelsromero opened this issue May 9, 2015 · 7 comments

Comments

@abelsromero
Copy link
Member

abelsromero commented May 9, 2015

As discuessed in http://discuss.asciidoctor.org/Maven-plugin-and-extensions-td3149.html#a3151, an example showing custom template loading should be added to show this feature.

It's important to remark in the example templates are useful when changing the HTML generated by Asciidoctor.

@abelsromero
Copy link
Member Author

@mokdeve
Copy link

mokdeve commented Jan 17, 2023

Hi All,

I downloaded a template (erb) from backends and saved it to my workspace, and added the templateDir for asciidoc-to-html-example in the POM, As follows:

<configuration>
                    <sourceDirectory>src/docs/asciidoc</sourceDirectory>
                    <templateDirs>
                        <templateDir>D:\worksapce\online-documentation-guide\src\docs\erb\html5</templateDir>
                   </templateDirs>
                    <attributes>
                        <endpoint-url>http://example.org</endpoint-url>
                        <sourcedir>${project.build.sourceDirectory}</sourcedir>
                        <project-version>${project.version}</project-version>
                    </attributes>
</configuration>

When I use build command mvn clean package got error Failed to load AsciiDoc docum ent - Unknown ERB implementation , as follows:

[ERROR] Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:2.2.2:process-asciidoc (asciidoc-to-html) on project asciidoc-to-html-example: Execution asciidoc-to-html of goal org.asciidoctor:asciidoctor-maven-plugin:2.2.2
:process-asciidoc failed: org.jruby.exceptions.ArgumentError: (ArgumentError) asciidoctor: FAILED: D:/worksapce/asciidoctor-maven-examples/asciidoc-to-html-example/src/docs/asciidoc/example-manual.adoc: Failed to load AsciiDoc docum
ent - Unknown ERB implementation: : (ArgumentError) Unknown ERB implementation: -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

Could you help me how to fix it?

@abelsromero
Copy link
Member Author

abelsromero commented Jan 17, 2023

Could you help me how to fix it?

I am afraid there's some issue. Good things...I could reproduce it and run it directly with AsciidoctorJ, so 🤞 it's some parameter combination. Or some classpath issue, I need to find why it cannot find the implementation for eRubis.
But other engines like slim work.

@abelsromero
Copy link
Member Author

@mokdeve btw, you did not explain your use case, but for certain cases is definetly easier to implement an extension. You can drop by https://asciidoctor.zulipchat.com/ and expose it to get some advice if you want.

@mokdeve
Copy link

mokdeve commented Jan 18, 2023

@abelsromero

Thanks, I want to use asciidoctor-maven-plugin in my java project to load a custom template for auto build.

Run it directly with AsciidoctorJ -T D:\worksapce\online-documentation-guide\src\docs\erb\html5 work fine as a temporary solution.

I need to find why it cannot find the implementation for eRubis.

I look forward to your good news.

@abelsromero
Copy link
Member Author

@mokdeve thanks for the patience, the issue is in the configuration of eruby . We inject an empty string and that should set the default, but it's not doing so. For now set it manually like <eruby>erb</eruby>.

@mokdeve
Copy link

mokdeve commented Jan 20, 2023

@abelsromero Thanks for your solution, I run it now and it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants