This is an automated email from the ASF dual-hosted git repository. hboutemy pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-doxia-sitetools.git
The following commit(s) were added to refs/heads/master by this push: new 0407851 [DOXIASITETOOLS-183] added edit source feature 0407851 is described below commit 040785192b67261656a020b5d83e133ce16a776d Author: Hervé Boutemy <hbout...@apache.org> AuthorDate: Sun Dec 17 16:39:52 2017 +0100 [DOXIASITETOOLS-183] added edit source feature --- doxia-decoration-model/pom.xml | 2 +- doxia-decoration-model/src/main/mdo/decoration.mdo | 11 ++++++++++- .../apache/maven/doxia/siterenderer/RenderingContext.java | 12 ++++++++++++ .../maven/doxia/siterenderer/resources/default-site.vm | 7 ++++++- 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/doxia-decoration-model/pom.xml b/doxia-decoration-model/pom.xml index 60d9642..abce402 100644 --- a/doxia-decoration-model/pom.xml +++ b/doxia-decoration-model/pom.xml @@ -60,7 +60,7 @@ under the License. <model>src/main/mdo/decoration.mdo</model> </models> <!-- TODO Do not forget to update the version in the decoration description. See DOXIASITETOOLS-98. --> - <version>1.7.0</version> + <version>1.8.0</version> <firstVersion>1.0.0</firstVersion> </configuration> <executions> diff --git a/doxia-decoration-model/src/main/mdo/decoration.mdo b/doxia-decoration-model/src/main/mdo/decoration.mdo index 7e192a5..cac9616 100644 --- a/doxia-decoration-model/src/main/mdo/decoration.mdo +++ b/doxia-decoration-model/src/main/mdo/decoration.mdo @@ -29,7 +29,7 @@ under the License. <p>An XSD is available at:</p> <ul> <!-- There is no property filtering in Modello, this has to be updated manually. See DOXIASITETOOLS-98. --> - <li><a href="http://maven.apache.org/xsd/decoration-1.7.0.xsd">http://maven.apache.org/xsd/decoration-1.7.0.xsd</a></li> + <li><a href="http://maven.apache.org/xsd/decoration-1.8.0.xsd">http://maven.apache.org/xsd/decoration-1.8.0.xsd</a></li> </ul> ]]></description> @@ -123,6 +123,15 @@ under the License. <identifier>true</identifier> </field> <field> + <name>edit</name> + <description><![CDATA[ + The base url to edit Doxia document sources. + In general, <code>${project.scm.url}</code> value should do the job. + ]]></description> + <version>1.8.0+</version> + <type>String</type> + </field> + <field> <name>poweredBy</name> <description>Powered by logos list.</description> <version>1.0.0+</version> diff --git a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/RenderingContext.java b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/RenderingContext.java index b05c0c6..239e6ec 100644 --- a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/RenderingContext.java +++ b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/RenderingContext.java @@ -280,4 +280,16 @@ public class RenderingContext // TODO rename to DocumentRenderingContext { return isDoxiaSource() ? ( basedirRelativePath + '/' + inputName ) : null; } + + /** + * Get url of the Doxia source calculate from given base url. + * + * @param base the base url to use + * @return the resulting url + * @since 1.8 + */ + public String getDoxiaSourcePath( String base ) + { + return PathTool.calculateLink( getDoxiaSourcePath(), base ); + } } diff --git a/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/default-site.vm b/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/default-site.vm index 77fd795..9409c82 100644 --- a/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/default-site.vm +++ b/doxia-site-renderer/src/main/resources/org/apache/maven/doxia/siterenderer/resources/default-site.vm @@ -58,7 +58,12 @@ </div> <div id="breadcrumbs"> #publishDate( "left" $decoration.publishDate $decoration.version ) - <div class="xright">#links( $decoration.body.links )#publishDate( "right" $decoration.publishDate $decoration.version )</div> + <div class="xright">#links( $decoration.body.links ) +#* *##if( $decoration.edit && $docRenderingContext.editable ) + <li class="pull-right"><a href="$docRenderingContext.getDoxiaSourcePath( $decoration.edit )">[edit]</a></li> +#* *##end + #publishDate( "right" $decoration.publishDate $decoration.version ) + </div> <div class="clear"> <hr/> </div> -- To stop receiving notification emails like this one, please contact ['"commits@maven.apache.org" <commits@maven.apache.org>'].