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
Allow the source highlighter to be enabled in the site plugin #160
Comments
@paranoiabla, you mentioned you got this working in light of recent changes to the plugin. Could you elaborate? |
I'm using the |
Is it possible to pass configuration to a Maven site module? If so, then we could pass that on to AsciidoctorJ. |
According to documentation you can add a site descriptor (site.xml in src/site) to customize the layout and other things (ref). Inside it you can add a section for custom properties This could be an option, the thing is if we should support all the options from process-asciidoc mojo. Also, so far I've only found a couple of example of how to recover custom properties and they use, either apache velocity scripts to directly generate the HTML, or some velocity api whose usage is not clear to me (https://github.com/andriusvelykis/reflow-maven-skin/blob/master/reflow-velocity-tools/src/main/java/lt/velykis/maven/skins/reflow/SkinConfigTool.java). |
One other possibility is to have a convention to set Maven properties with a special prefix to pass options to Asciidoctor.
or we could stuff them all into a single property.
We should be able to read global attributes from the Maven plugin. It's not super clean, but it seems simpler than the alternatives thus far. |
Hello, the possiblity of using maven properties seem good for me, with this you can use every parameter of the maven plugin Thanks for all answer guys, I will test this before having best solution |
With
for this input :
|
You have two options. You can either grab the CodeRay stylesheet from the Asciidoctor repository and stick that into the template of your site or you can inline the styles using a second AsciiDoc attribute:
|
Wonderful ! asciidoctor is very powerfull! |
I'm not sure what's adding the |
Aha. This may be something that's fixed by 3dc576f. Are you using the SNAPSHOT version? If not, this is a known issue because plexus messes with the output in a seriously nasty way right now. |
Ohh I see, thank you, I will use a SNAPSHOT version until it will be releases. |
I've been testing the idea of passing Maven properties and this does not work. Basically the Doxia Parser does not recognize the @parameter notation in the attributes, which makes sense because AsciidoctorParser is not a plugin itself. In the meantime I have sent a message to the user's mailing list, to see if they can offer some idea. |
Just a quick question here - is it possible to pass the properties as part of the |
…or#168 & asciidoctor#160 enable configuratino for site parser - rewrite Maven Site parser to make more organized and extensible - pass AsciiDoc configuration in Maven Site plugin to Asciidoctor API - enhance Maven Site integration test - add custom template - add include - add source highlighting - make validation code compatible with Java 6 - enable integration tests on Travis - remove unused legacy site module
…or#168 & asciidoctor#160 enable configuration for site parser - rewrite Maven Site parser to make more organized and extensible - pass AsciiDoc configuration in Maven Site plugin to Asciidoctor API - enhance Maven Site integration test - add custom template - add include - add source highlighting - make validation code compatible with Java 6 - enable integration tests on Travis - remove unused legacy site module
…or#168 & asciidoctor#160 enable configuration for site parser - rewrite AsciidoctorParser (used by Maven Site Plugin) to make it more organized and extensible - pass AsciiDoc configuration defined in Maven Site plugin to the Asciidoctor API - enhance Maven Site integration test - add custom template - add include - add source highlighting - make validation code compatible with Java 6 - enable integration tests on Travis CI - remove unused legacy site module - fix license headers - minor cleanups
…or#168 & asciidoctor#160 enable configuration for site parser - rewrite AsciidoctorParser (used by Maven Site Plugin) to make it more organized and extensible - pass AsciiDoc configuration defined in Maven Site plugin to the Asciidoctor API - enhance Maven Site integration test - add custom template - add include - add source highlighting - make validation code compatible with Java 6 - enable integration tests on Travis CI - remove unused legacy site module - fix license headers - minor cleanups
The secret was to use the @Requirement
protected MavenProject project; then we can access the resolved configuration for the site plugin using the following call: project.getGoalConfiguration("org.apache.maven.plugins", "maven-site-plugin", "site", "site"); With a little bit of work, it's possible to walk the DOM and extract the configuration we are interested in. |
…or#168 & asciidoctor#160 enable configuration for site parser - rewrite AsciidoctorParser (used by Maven Site Plugin) to make it more organized and extensible - specify baseDir by default when invoking Asciidoctor API - pass AsciiDoc configuration defined in Maven Site plugin to the Asciidoctor API - API options (e.g., templateDir) - Ruby options (e.g., requires) - AsciiDoc attributes (e.g., icons=font) - enhance Maven Site integration test - add custom template - add include - add source highlighting - make validation code compatible with Java 6 - enable integration tests on Travis CI - remove unused legacy site module - fix license headers - minor cleanups
…or#168 & asciidoctor#160 enable configuration for site parser - rewrite AsciidoctorParser (used by Maven Site Plugin) to make it more organized and extensible - specify baseDir by default when invoking Asciidoctor API - pass AsciiDoc configuration defined in Maven Site plugin to the Asciidoctor API - API options (e.g., templateDir) - Ruby options (e.g., requires) - AsciiDoc attributes (e.g., icons=font) - enhance Maven Site integration test - add custom template - add include - add source highlighting - make validation code compatible with Java 6 - enable integration tests on Travis CI and Appveyor - remove unused legacy site module - fix license headers - minor cleanups
…or#168 & asciidoctor#160 enable configuration for site parser - rewrite AsciidoctorParser (used by Maven Site Plugin) to make it more organized and extensible - specify baseDir by default when invoking Asciidoctor API - pass AsciiDoc configuration defined in Maven Site plugin to the Asciidoctor API - API options (e.g., templateDir) - Ruby options (e.g., requires) - AsciiDoc attributes (e.g., icons=font) - enhance Maven Site integration test - add custom template - add include - add source highlighting - make validation code compatible with Java 6 - enable integration tests on Travis CI and Appveyor - remove unused legacy site module - fix license headers - minor cleanups
…or#168 & asciidoctor#160 enable configuration for site parser - rewrite AsciidoctorParser (used by Maven Site Plugin) to make it more organized and extensible - specify baseDir by default when invoking Asciidoctor API - pass AsciiDoc configuration defined in Maven Site plugin to the Asciidoctor API - API options (e.g., templateDir) - Ruby options (e.g., requires) - AsciiDoc attributes (e.g., icons=font) - enhance Maven Site integration test - add custom template - add include - add source highlighting - make validation code compatible with Java 6 - enable integration tests on Travis CI and Appveyor - remove unused legacy site module - fix license headers - minor cleanups
It should be possible to enable the source highlighter from the plugin configuration when using the site plugin.
This issue involves two parts:
As a workaround, you can enable the source highlighter by adding an explicit attribute in the document header.
The text was updated successfully, but these errors were encountered: