From 9924bd8bfe2dc32a85e7bd03886995e76ca96eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sun, 20 May 2018 09:27:36 +0200 Subject: [PATCH] Landing page is WIP, add some tags to languages --- docs/_includes/head.html | 1 + docs/css/pmd-customstyles.css | 13 ++ docs/index.md | 187 ++++++++++-------- docs/pages/pmd/rules/apex.md | 2 + docs/pages/pmd/rules/ecmascript.md | 2 + docs/pages/pmd/rules/java.md | 2 + docs/pages/pmd/rules/jsp.md | 2 + docs/pages/pmd/rules/plsql.md | 2 + docs/pages/pmd/rules/pom.md | 2 + docs/pages/pmd/rules/vf.md | 2 + docs/pages/pmd/rules/vm.md | 2 + docs/pages/pmd/rules/xml.md | 2 + docs/pages/pmd/rules/xsl.md | 2 + .../pmd/docs/RuleDocGenerator.java | 2 + 14 files changed, 142 insertions(+), 81 deletions(-) create mode 100644 docs/css/pmd-customstyles.css diff --git a/docs/_includes/head.html b/docs/_includes/head.html index f5ca45688a..f547ed12cd 100644 --- a/docs/_includes/head.html +++ b/docs/_includes/head.html @@ -13,6 +13,7 @@ + diff --git a/docs/css/pmd-customstyles.css b/docs/css/pmd-customstyles.css new file mode 100644 index 0000000000..e3bf9291f4 --- /dev/null +++ b/docs/css/pmd-customstyles.css @@ -0,0 +1,13 @@ + +.panel-body { + padding-top: 0cm; +} + +.landing-page.cat-title { + margin-bottom: .5cm; + margin-top: .5cm; +} + +.landing-page.cat-description { + margin-bottom: .5cm; +} \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 9462c92d68..127ad04df6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,7 +1,7 @@ --- -title: PMD Introduction +title: PMD Documentation website keywords: java -tags: [getting_started] +tags: [] permalink: index.html toc: false summary: > @@ -12,88 +12,113 @@ last_updated: August 2017 author: Jeff Jensen , Andreas Dangel --- -{% include image.html file="pmd-logo-big.png" alt="PMD Logo" %} -
+## Welcome to PMD! -**PMD** scans source code in Java and other languages and looks for potential problems like: - -* Possible bugs - empty try/catch/finally/switch statements -* Dead code - unused local variables, parameters and private methods -* Suboptimal code - wasteful String/StringBuffer usage -* Overcomplicated expressions - unnecessary if statements, for loops that could be while loops - -**CPD**, the copy-paste-detector, finds duplicated code in many languages: - -* Duplicate code is often just copied and pasted. This means, the bugs are also copied and pasted. Fixing - them means, fix all duplicated code locations. - -## Features - -{::options parse_block_html="true" /} - -
-### PMD - -Features: - -* Supporting 8 languages -* Many ready-to-use built-in rules. -* Custom rules can be written in Java -* Custom rules can be written using XPath expression that query the AST of the sources -* Many output formats -* Many integrations into IDEs, build tools - -Supported Languages: - -* [Java](pmd_rules_java.html) -* [JSP](pmd_rules_jsp.html) -* [JavaScript](pmd_rules_ecmascript.html) -* [Salesforce.com Apex](pmd_rules_apex.html) and [Visualforce](pmd_rules_vf.html) -* [PLSQL](pmd_rules_plsql.html) -* [Apache Velocity](pmd_rules_vm.html) -* [XML](pmd_rules_xml.html) and [Maven POM](pmd_rules_pom.html) -* [XSL](pmd_rules_xsl.html) - -
-### CPD - -Features: - -* Supporting 19 languages -* Simple GUI -* Fast -* Many integrations - -Supported Languages: - -* Java -* C, C++ -* C# -* Groovy -* PHP -* Ruby -* Fortran -* JavaScript -* PLSQL -* Apache Velocity -* Scala -* Objective C -* Matlab -* Python -* Go -* Swift -* Salesforce.com Apex and Visualforce - -
- -## Download PMD {{ site.pmd.version }} - -Latest Version: {{ site.pmd.version }} ({{ site.pmd.date }}) - -* [Release Notes](pmd_release_notes.html) -* [Download](https://github.com/pmd/pmd/releases) +First time user? Then you may be interested in our [quickstart page](TODO). +
+
+ +
+
+
+
+ + + + +
+
+

Getting started

+

A collection of pages explaining the gist of PMD usage and ruleset making.

+ Learn More +
+
+
+
+
+
+ + + + +
+
+

Extending PMD

+

Guides about writing rules, metrics, and testing them properly.

+ Learn More +
+
+
+
+
+
+ + + + +
+
+

Rule reference

+

Find an existing rule to craft your own rulesets.

+ Learn More +
+
+
+
+
+
+ + + + +
+
+

Contributing

+

Help us make PMD better!

+ Learn More +
+
+
+
+ + +# More details + + +
+
+
+
+ + + + +
+
+
+

Rule references

+
+

+ Pick your language to find out about the rule it supports. +

+
    + {% for page in site.pages %} + {% for tag in page.tags %} + {% if tag == "rule_references" %} +
  • {{page.language_name}}
  • + {% endif %} + {% endfor %} + {% endfor %} +
+
+
+
+
+ + + {% include links.html %} diff --git a/docs/pages/pmd/rules/apex.md b/docs/pages/pmd/rules/apex.md index 5e18176286..6ce6d16ffc 100644 --- a/docs/pages/pmd/rules/apex.md +++ b/docs/pages/pmd/rules/apex.md @@ -1,5 +1,7 @@ --- title: Apex Rules +tags: [rule_references, apex] +language_name: Apex permalink: pmd_rules_apex.html folder: pmd/rules --- diff --git a/docs/pages/pmd/rules/ecmascript.md b/docs/pages/pmd/rules/ecmascript.md index 1c365da30a..b93948fd2f 100644 --- a/docs/pages/pmd/rules/ecmascript.md +++ b/docs/pages/pmd/rules/ecmascript.md @@ -1,5 +1,7 @@ --- title: Ecmascript Rules +tags: [rule_references, ecmascript] +language_name: Ecmascript permalink: pmd_rules_ecmascript.html folder: pmd/rules --- diff --git a/docs/pages/pmd/rules/java.md b/docs/pages/pmd/rules/java.md index 6c3a7dc708..2b68ec546d 100644 --- a/docs/pages/pmd/rules/java.md +++ b/docs/pages/pmd/rules/java.md @@ -1,5 +1,7 @@ --- title: Java Rules +tags: [rule_references, java] +language_name: Java permalink: pmd_rules_java.html folder: pmd/rules --- diff --git a/docs/pages/pmd/rules/jsp.md b/docs/pages/pmd/rules/jsp.md index 47ee66cc1b..0936eb384d 100644 --- a/docs/pages/pmd/rules/jsp.md +++ b/docs/pages/pmd/rules/jsp.md @@ -1,5 +1,7 @@ --- title: Java Server Pages Rules +tags: [rule_references, jsp] +language_name: Java Server Pages permalink: pmd_rules_jsp.html folder: pmd/rules --- diff --git a/docs/pages/pmd/rules/plsql.md b/docs/pages/pmd/rules/plsql.md index aa86a94fd1..096a830256 100644 --- a/docs/pages/pmd/rules/plsql.md +++ b/docs/pages/pmd/rules/plsql.md @@ -1,5 +1,7 @@ --- title: PLSQL Rules +tags: [rule_references, plsql] +language_name: PLSQL permalink: pmd_rules_plsql.html folder: pmd/rules --- diff --git a/docs/pages/pmd/rules/pom.md b/docs/pages/pmd/rules/pom.md index 0810b5b46e..d7ef300b45 100644 --- a/docs/pages/pmd/rules/pom.md +++ b/docs/pages/pmd/rules/pom.md @@ -1,5 +1,7 @@ --- title: Maven POM Rules +tags: [rule_references, pom] +language_name: Maven POM permalink: pmd_rules_pom.html folder: pmd/rules --- diff --git a/docs/pages/pmd/rules/vf.md b/docs/pages/pmd/rules/vf.md index f3a4e48aad..67921e4bb5 100644 --- a/docs/pages/pmd/rules/vf.md +++ b/docs/pages/pmd/rules/vf.md @@ -1,5 +1,7 @@ --- title: Salesforce VisualForce Rules +tags: [rule_references, vf] +language_name: Salesforce VisualForce permalink: pmd_rules_vf.html folder: pmd/rules --- diff --git a/docs/pages/pmd/rules/vm.md b/docs/pages/pmd/rules/vm.md index 88c2848866..754a707303 100644 --- a/docs/pages/pmd/rules/vm.md +++ b/docs/pages/pmd/rules/vm.md @@ -1,5 +1,7 @@ --- title: VM Rules +tags: [rule_references, vm] +language_name: VM permalink: pmd_rules_vm.html folder: pmd/rules --- diff --git a/docs/pages/pmd/rules/xml.md b/docs/pages/pmd/rules/xml.md index 8b8c2b85a6..77ee363a9a 100644 --- a/docs/pages/pmd/rules/xml.md +++ b/docs/pages/pmd/rules/xml.md @@ -1,5 +1,7 @@ --- title: XML Rules +tags: [rule_references, xml] +language_name: XML permalink: pmd_rules_xml.html folder: pmd/rules --- diff --git a/docs/pages/pmd/rules/xsl.md b/docs/pages/pmd/rules/xsl.md index befc91c3bc..6f76373446 100644 --- a/docs/pages/pmd/rules/xsl.md +++ b/docs/pages/pmd/rules/xsl.md @@ -1,5 +1,7 @@ --- title: XSL Rules +tags: [rule_references, xsl] +language_name: XSL permalink: pmd_rules_xsl.html folder: pmd/rules --- diff --git a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java index eb0e993901..827f5aaca4 100644 --- a/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java +++ b/pmd-doc/src/main/java/net/sourceforge/pmd/docs/RuleDocGenerator.java @@ -184,6 +184,8 @@ public class RuleDocGenerator { List lines = new LinkedList<>(); lines.add("---"); lines.add("title: " + entry.getKey().getName() + " Rules"); + lines.add("tags: [rule_references, " + languageTersename + "]"); + lines.add("language_name: " + entry.getKey().getName()); lines.add("permalink: " + LANGUAGE_INDEX_PERMALINK_PATTERN.replace("${language.tersename}", languageTersename)); lines.add("folder: pmd/rules"); lines.add("---");