Skip to content

Commit

Permalink
new web
Browse files Browse the repository at this point in the history
  • Loading branch information
musketyr committed Jan 31, 2014
1 parent 2418754 commit a2a5a86
Show file tree
Hide file tree
Showing 47 changed files with 2,108 additions and 3 deletions.
1 change: 1 addition & 0 deletions gaelyk-docgenerator/build.gradle
Expand Up @@ -5,4 +5,5 @@ dependencies {
force = true
}
compile "com.thoughtworks.qdox:qdox:1.12.1"
compile 'org.jsoup:jsoup:1.7.3'
}
Expand Up @@ -15,12 +15,16 @@
*/
package groovyx.gaelyk.tools.docs

import com.thoughtworks.qdox.model.JavaMethod
import com.thoughtworks.qdox.model.JavaParameter
import groovy.json.JsonBuilder;

import org.codehaus.groovy.runtime.DefaultGroovyMethods
import com.thoughtworks.qdox.JavaDocBuilder

import org.codehaus.groovy.tools.shell.util.Logger
import org.jsoup.Jsoup
import org.jsoup.safety.Whitelist

/**
* Generate documentation about the methods provided by Gaelyk
Expand Down Expand Up @@ -186,6 +190,11 @@ class DocGenerator {
}

/**
* Generate an index.
* <p>
* This method creates a index map indexed by the first letter of the
Expand Down Expand Up @@ -265,9 +274,20 @@ class DocGenerator {
private Map getClassInfo(String pkg, String clazz) {
def listOfMethods = jdkEnhancedClasses[clazz].sort {it.name}
def methods = []
listOfMethods.each {method ->
listOfMethods.each { JavaMethod method ->
def parameters = method.getTagsByName("param").collect {
[name: it.value.replaceAll(' .*', ''), comment: linkify(it.value.replaceAll('^\\w*', ''), pkg)]
def ret = [
name: it.value.replaceAll(' .*', ''),
comment: linkify(it.value.replaceAll('^\\w*', ''), pkg),
]

JavaParameter parameter = method.getParameterByName(ret.name)
if (parameter) {
ret.typeDocUrl = getDocUrl(parameter.type?.toString(), pkg)
ret.type = parameter.type?.toString()

}
ret
}
if (parameters)
parameters.remove(0) // method is static, first arg is the "real this"
Expand All @@ -282,6 +302,7 @@ class DocGenerator {
shortComment: linkify(getFirstSentence(comment), pkg),
returnComment: method.getTagByName("return")?.getValue() ?: '',
seeComments: seeComments,
returnType: returnType,
returnTypeDocUrl: getDocUrl(returnType, pkg),
parametersSignature: getParametersDecl(method),
parametersDocUrl: getParametersDocUrl(method, pkg),
Expand Down Expand Up @@ -425,7 +446,8 @@ class DocGenerator {
}

private linkify(orig, curPackage) {
orig.replaceAll(/\{@link\s+([^}]*)\s*\}/) {all, link -> getDocUrl(link, curPackage) }
String text = orig.replaceAll(/\{@link\s+([^}]*)\s*\}/) {all, link -> getDocUrl(link, curPackage) }
Jsoup.clean(text, Whitelist.relaxed())
}

/**
Expand Down
3 changes: 3 additions & 0 deletions ngdocs/.bowerrc
@@ -0,0 +1,3 @@
{
"directory": "app/bower_components"
}
21 changes: 21 additions & 0 deletions ngdocs/.editorconfig
@@ -0,0 +1,21 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions ngdocs/.gitattributes
@@ -0,0 +1 @@
* text=auto
5 changes: 5 additions & 0 deletions ngdocs/.gitignore
@@ -0,0 +1,5 @@
node_modules
dist
.tmp
.sass-cache
app/bower_components
24 changes: 24 additions & 0 deletions ngdocs/.jshintrc
@@ -0,0 +1,24 @@
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"globals": {
"angular": false
}
}
7 changes: 7 additions & 0 deletions ngdocs/.travis.yml
@@ -0,0 +1,7 @@
language: node_js
node_js:
- '0.8'
- '0.10'
before_script:
- 'npm install -g bower grunt-cli'
- 'bower install'

0 comments on commit a2a5a86

Please sign in to comment.