You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2015/09/19 15:05:50 UTC

svn commit: r1704011 - in /maven/site/trunk/content: apt/developers/website/deploy-component-reference-documentation.apt markdown/developers/website/component-reference-documentation-helper.md

Author: hboutemy
Date: Sat Sep 19 13:05:49 2015
New Revision: 1704011

URL: http://svn.apache.org/viewvc?rev=1704011&view=rev
Log:
automated some instructions

Modified:
    maven/site/trunk/content/apt/developers/website/deploy-component-reference-documentation.apt
    maven/site/trunk/content/markdown/developers/website/component-reference-documentation-helper.md

Modified: maven/site/trunk/content/apt/developers/website/deploy-component-reference-documentation.apt
URL: http://svn.apache.org/viewvc/maven/site/trunk/content/apt/developers/website/deploy-component-reference-documentation.apt?rev=1704011&r1=1704010&r2=1704011&view=diff
==============================================================================
--- maven/site/trunk/content/apt/developers/website/deploy-component-reference-documentation.apt (original)
+++ maven/site/trunk/content/apt/developers/website/deploy-component-reference-documentation.apt Sat Sep 19 13:05:49 2015
@@ -143,6 +143,9 @@ svnmucc -m "Publish yyy $version documen
   cp HEAD xxx-archives/yyy-LATEST xxx/yyy
 +----------+
 
+ You can also use {{{./component-reference-documentation-helper.html}Component Reference Documentation Helper}}
+ to prepare svnmucc command line.
+
 * Updating index page in the Maven site
 
  Some component types have an index page refering to each components of the same type. This is the case for

Modified: maven/site/trunk/content/markdown/developers/website/component-reference-documentation-helper.md
URL: http://svn.apache.org/viewvc/maven/site/trunk/content/markdown/developers/website/component-reference-documentation-helper.md?rev=1704011&r1=1704010&r2=1704011&view=diff
==============================================================================
--- maven/site/trunk/content/markdown/developers/website/component-reference-documentation-helper.md (original)
+++ maven/site/trunk/content/markdown/developers/website/component-reference-documentation-helper.md Sat Sep 19 13:05:49 2015
@@ -1,46 +1,91 @@
 ## Preparing Component Release Documentation
 
-<!-- TODO add javascript to make this dynamic:
-1. select a component category to display index page, archives and list content (sorted by 
-2. select a component to update instructions to publish release documentation
---> 
+select component category, then type artifact id and version to generate svn commands:
 
 <table>
 <tr><td>
 <h2>Component category</h2>
 <ul>
-<li><a href="#core">core</a></li>
-<li><a href="#shared">shared components</a></li>
-<li><a href="#plugins">plugins</a></li>
-<li><a href="#pom">poms</a></li>
-<li><a href="#skins">skins</a></li>
-<li><a href="#others">others</a></li>
+<li><a href="?core">core</a></li>
+<li><a href="?shared">shared components</a></li>
+<li><a href="?plugins">plugins</a></li>
+<li><a href="?pom">poms</a></li>
+<li><a href="?skins">skins</a></li>
+<li><a href="?others">others</a></li>
 </ul>
  
 </td><td>
 
-<h2>plugins content</h2>
+<h2>Component information</h2>
+
+artifact id: <input type="text" name="artifactId" id="artifactId"></input><br/>
+version: <input type="text" name="version" id="version"></input><br/>
+<button onclick="instructions()">Publish instructions</button>
 
-<ul>
-<li>maven-javadoc-plugin: <a href="/plugins/maven-javadoc-plugin/">current</a> / <a href="/plugins-archives/maven-javadoc-plugin-LATEST/">LATEST</a></li>
-<li>...</li>
-</ul>
 </td></tr>
 
 <tr><td colspan="2">
-instructions to publish maven-javadoc-plugin 1.9 release documentation
-<pre>svnmucc -m "Publish maven-javadoc-plugin 1.9 documentation" \
+instructions to publish component release documentation
+<pre id="svnmucc">svnmucc -m "Publish ${artifactId} ${version} documentation" \
   -U https://svn.apache.org/repos/infra/websites/production/maven/components \
-  cp HEAD plugins-archives/maven-javadoc-plugin-LATEST plugins-archives/maven-javadoc-plugin-1.9 \
-  rm plugins/maven-javadoc-plugin \
-  cp HEAD plugins-archives/maven-javadoc-plugin-LATEST plugins/maven-javadoc-plugin</pre>
+  cp HEAD ${category}-archives/${artifactId}-LATEST ${category}-archives/${artifactId}-${version} \
+  rm ${category}/${artifactId} \
+  cp HEAD ${category}-archives/${artifactId}-LATEST ${category}/${artifactId}</pre>
 </td></tr>
 
 <tr><td>category index page<br/>
-<iframe src="/plugins/" width="100%" height="300px"></iframe>
+<iframe id="index-page" src="" width="100%" height="300px"></iframe>
 </td>
 <td>archives directory<br/>
-<iframe src="/plugins-archives/?C=M;O=D" width="100%" height="300px"></iframe>
+<iframe id="archives" src="" width="100%" height="300px"></iframe>
 </td>
 </tr>
 </table>
+
+<script type="text/javascript"><![CDATA[
+function selectCategory(index, archive) {
+  indexPage.setAttribute('src', 'http://maven.apache.org/' + index);
+  archives.setAttribute('src', 'http://maven.apache.org/' + archive + '?C=M;O=D');
+}
+var category = document.location.search.substr(1);
+var indexPage = document.getElementById('index-page');
+var archives = document.getElementById('archives');
+if (category == "core") {
+  selectCategory('docs/history.html', 'ref/');
+} else if (category == "others") {
+  selectCategory('', 'components/');
+} else if (category != "") {
+  selectCategory(category + '/', category+'-archives/');
+}
+var svnmuccTemplate = document.getElementById('svnmucc').innerHTML;
+
+function escapeRegExp(string) {
+    return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
+}
+function replaceAll(string, find, replace) {
+  return string.replace(new RegExp(escapeRegExp(find), 'g'), replace);
+}
+
+function instructions() {
+  var category = document.location.search.substr(1);
+  var artifactId = document.getElementById('artifactId').value;
+  var version = document.getElementById('version').value;
+  var svnmucc = svnmuccTemplate;
+  if (category == "others") {
+    // category directory is based on artifactId
+    svnmucc = replaceAll(svnmucc, '${category}/${artifactId}', '${artifactId}');
+    category = artifactId;
+  }
+  if (category == "core") {
+    artifactId = "Maven";
+    svnmucc = svnmucc.substr(0, svnmucc.indexOf("  rm "))
+    svnmucc = replaceAll(svnmucc, '${artifactId}-LATEST', '3-LATEST');
+    svnmucc = replaceAll(svnmucc, '${category}-archives', 'ref');
+    svnmucc = replaceAll(svnmucc, '${artifactId}-${version}', '${version}');
+  }
+  svnmucc = replaceAll(svnmucc, '${category}', category);
+  svnmucc = replaceAll(svnmucc, '${artifactId}', artifactId);
+  svnmucc = replaceAll(svnmucc, '${version}', version);
+  document.getElementById('svnmucc').innerHTML = svnmucc;
+}
+//]]></script>