]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
docs: add 'edit this page' link to footer of every page
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 8 Apr 2020 15:18:58 +0000 (16:18 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 9 Apr 2020 11:01:49 +0000 (12:01 +0100)
To encourage contributors to make changes to the main website, add a
footer link to every page which links to the corresponding source file
in git. With gitlab, they are able to edit content directly in the web
browser and then submit a merge request. This gives a way to contribute
content that is arguably easier than our wiki which requires manual
account creation, while this will also benefit from maintainer review.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
docs/Makefile.am
docs/libvirt.css
docs/page.xsl
docs/site.xsl
docs/subsite.xsl

index 61862c4ab783217f5b9bf6367d38660e5020c441..404121a2a2b71ac9b73d7eacdcfc29d8802adc6f 100644 (file)
@@ -429,6 +429,10 @@ manpages/%.html.in: manpages/%.rst
 %.html.tmp: %.html.in site.xsl subsite.xsl page.xsl \
                $(acl_generated)
        $(AM_V_GEN)name=`echo $@ | sed -e 's/.tmp//'`; \
+         genhtmlin=`echo $@ | sed -e 's/.tmp/.in/'`; \
+         rst=`echo $@ | sed -e 's/.html.tmp/.rst/'`; \
+         src="$$genhtmlin"; \
+         test -f "$$genhtmlin" && src="$$rst"; \
          dir=`dirname $@` ; \
          if test "$$dir" = "."; \
          then \
@@ -438,6 +442,7 @@ manpages/%.html.in: manpages/%.rst
            style=subsite.xsl; \
          fi; \
          $(XSLTPROC) --stringparam pagename $$name \
+           --stringparam pagesrc $$src \
            --stringparam builddir '$(abs_top_builddir)' \
            --stringparam timestamp $(timestamp) --nonet \
            $(top_srcdir)/docs/$$style $< > $@ \
index 18e55dac5981c0bb6366729e7ef0a6cc2d4a6dd5..a6f343908d5255e8699ceab2beea902d61131c99 100644 (file)
@@ -453,7 +453,7 @@ br.clear {
     text-decoration: underline;
 }
 
-#contact, #community {
+#contact, #community, #contribute {
     float: left;
     padding: 0px;
     margin-left: 3em;
index ddae5ab50809c4755389eb88368c6214e792146e..69238714004d652f27150df7d78e12a4e6103673 100644 (file)
@@ -77,6 +77,7 @@
   <!-- This is the master page structure -->
   <xsl:template match="/" mode="page">
     <xsl:param name="pagename"/>
+    <xsl:param name="pagesrc"/>
     <xsl:param name="timestamp"/>
     <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;
 </xsl:text>
               <li><a href="http://serverfault.com/questions/tagged/libvirt">serverfault</a></li>
             </ul>
           </div>
+          <div id="contribute">
+            <h3>Contribute</h3>
+            <ul>
+              <li><a href="https://gitlab.com/libvirt/libvirt/-/blob/master/docs/{$pagesrc}">edit this page</a></li>
+            </ul>
+          </div>
           <div id="conduct">
             Participants in the libvirt project agree to abide by <a href="{$href_base}governance.html#codeofconduct">the project code of conduct</a>
           </div>
index c9d41f2c93af67b4e45e78d32673aef6e8389672..73ddd8ca6b33ffda4284cdece85abec15213d735 100644 (file)
@@ -27,6 +27,7 @@
   <xsl:template match="/">
     <xsl:apply-templates select="." mode="page">
       <xsl:with-param name="pagename" select="$pagename"/>
+      <xsl:with-param name="pagesrc" select="$pagesrc"/>
       <xsl:with-param name="timestamp" select="$timestamp"/>
     </xsl:apply-templates>
   </xsl:template>
index f56ac0491c02aa6246b07cd1708ced1f96a1f810..bfd34eebd2748faf073a4ef7c975d5dcbdffbd26 100644 (file)
@@ -17,6 +17,7 @@
   <xsl:template match="/">
     <xsl:apply-templates select="." mode="page">
       <xsl:with-param name="pagename" select="$pagename"/>
+      <xsl:with-param name="pagesrc" select="$pagesrc"/>
       <xsl:with-param name="timestamp" select="$timestamp"/>
     </xsl:apply-templates>
   </xsl:template>