-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
325 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
*.class | ||
|
||
# Package Files # | ||
*.war | ||
*.ear | ||
|
||
# Build Directorys # | ||
/.gradle | ||
/build | ||
/bin | ||
*.class | ||
|
||
# Package Files # | ||
*.war | ||
*.ear | ||
|
||
# Build Directorys # | ||
/.gradle | ||
/build | ||
/bin | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
javadoc.chm | ||
http://subchen.github.io/javadoc.chm/ | ||
|
||
Copyright 2010-2013 Guoqiang Chen. All rights reserved. | ||
Copyright 2010-2014 Guoqiang Chen. All rights reserved. | ||
Email: [email protected] | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set classpath=%classpath%;lib/commons-collections-3.2.1.jar | ||
set classpath=%classpath%;lib/commons-io-2.4.jar | ||
set classpath=%classpath%;lib/commons-lang-2.6.jar | ||
set classpath=%classpath%;lib/commons-logging-1.1.1.jar | ||
set classpath=%classpath%;lib/log4j-1.2.17.jar | ||
set classpath=%classpath%;lib/velocity-1.7.jar | ||
set classpath=%classpath%;build/javadoc.chm-2.1.0.jar | ||
|
||
java -Xms512m -Xmx512m jerbrick.tools.chm.Application D:/Downloads/jdk-8-apidocs/docs/api utf-8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* javadoc.chm | ||
* http://subchen.github.io/javadoc.chm/ | ||
* | ||
* Copyright 2010-2013 Guoqiang Chen. All rights reserved. | ||
* Copyright 2010-2014 Guoqiang Chen. All rights reserved. | ||
* Email: [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
@@ -17,53 +17,57 @@ | |
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package jerbrick.tools.chm; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.Map; | ||
import jerbrick.tools.chm.reader.ApiReader; | ||
import jerbrick.tools.chm.style.Javadoc7Style; | ||
import org.apache.commons.io.FileUtils; | ||
|
||
public class Application { | ||
|
||
public static void main(String[] args) throws Exception { | ||
if (args.length > 0) { | ||
Config.apiLocation = new File(args[0]); | ||
} | ||
if (args.length > 1) { | ||
Config.encoding = args[1]; | ||
} | ||
|
||
if (new File(Config.apiLocation, "resources/background.gif").exists()) { | ||
Config.style = new Javadoc7Style(); | ||
} | ||
|
||
clean(); | ||
|
||
ApiReader api = new ApiReader(); | ||
Map<String, Object> apiContext = api.getApiContext(); | ||
|
||
TemplateWriter writer = new TemplateWriter(); | ||
writer.apply(apiContext); | ||
} | ||
|
||
private static void clean() throws IOException { | ||
File f = new File(Config.apiLocation, "htmlhelp.hhp"); | ||
if (f.exists()) f.delete(); | ||
f = new File(Config.apiLocation, "htmlhelp.hhc"); | ||
if (f.exists()) f.delete(); | ||
f = new File(Config.apiLocation, "htmlhelp.hhk"); | ||
if (f.exists()) f.delete(); | ||
f = new File(Config.apiLocation, "build.bat"); | ||
if (f.exists()) f.delete(); | ||
f = new File(Config.apiLocation, "hhc.exe"); | ||
if (f.exists()) f.delete(); | ||
f = new File(Config.apiLocation, "hha.dll"); | ||
if (f.exists()) f.delete(); | ||
f = new File(Config.apiLocation, "redirs/"); | ||
if (f.exists()) FileUtils.deleteDirectory(f); | ||
} | ||
|
||
package jerbrick.tools.chm; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.util.Map; | ||
import jerbrick.tools.chm.reader.ApiReader; | ||
import jerbrick.tools.chm.style.*; | ||
import org.apache.commons.io.FileUtils; | ||
|
||
public class Application { | ||
|
||
public static void main(String[] args) throws Exception { | ||
if (args.length > 0) { | ||
Config.apiLocation = new File(args[0]); | ||
} | ||
if (args.length > 1) { | ||
Config.encoding = args[1]; | ||
} | ||
|
||
if (new File(Config.apiLocation, "resources/fonts").exists()) { | ||
Config.style = new Javadoc8Style(); | ||
} else if (new File(Config.apiLocation, "resources/background.gif").exists()) { | ||
Config.style = new Javadoc7Style(); | ||
} else { | ||
Config.style = new JavadocStyle(); | ||
} | ||
|
||
clean(); | ||
|
||
ApiReader api = new ApiReader(); | ||
Map<String, Object> apiContext = api.getApiContext(); | ||
|
||
TemplateWriter writer = new TemplateWriter(); | ||
writer.apply(apiContext); | ||
} | ||
|
||
private static void clean() throws IOException { | ||
File f = new File(Config.apiLocation, "htmlhelp.hhp"); | ||
if (f.exists()) f.delete(); | ||
f = new File(Config.apiLocation, "htmlhelp.hhc"); | ||
if (f.exists()) f.delete(); | ||
f = new File(Config.apiLocation, "htmlhelp.hhk"); | ||
if (f.exists()) f.delete(); | ||
f = new File(Config.apiLocation, "build.bat"); | ||
if (f.exists()) f.delete(); | ||
f = new File(Config.apiLocation, "hhc.exe"); | ||
if (f.exists()) f.delete(); | ||
f = new File(Config.apiLocation, "hha.dll"); | ||
if (f.exists()) f.delete(); | ||
f = new File(Config.apiLocation, "redirs/"); | ||
if (f.exists()) FileUtils.deleteDirectory(f); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* javadoc.chm | ||
* http://subchen.github.io/javadoc.chm/ | ||
* | ||
* Copyright 2010-2013 Guoqiang Chen. All rights reserved. | ||
* Copyright 2010-2014 Guoqiang Chen. All rights reserved. | ||
* Email: [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* javadoc.chm | ||
* http://subchen.github.io/javadoc.chm/ | ||
* | ||
* Copyright 2010-2013 Guoqiang Chen. All rights reserved. | ||
* Copyright 2010-2014 Guoqiang Chen. All rights reserved. | ||
* Email: [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* javadoc.chm | ||
* http://subchen.github.io/javadoc.chm/ | ||
* | ||
* Copyright 2010-2013 Guoqiang Chen. All rights reserved. | ||
* Copyright 2010-2014 Guoqiang Chen. All rights reserved. | ||
* Email: [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* javadoc.chm | ||
* http://subchen.github.io/javadoc.chm/ | ||
* | ||
* Copyright 2010-2013 Guoqiang Chen. All rights reserved. | ||
* Copyright 2010-2014 Guoqiang Chen. All rights reserved. | ||
* Email: [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* javadoc.chm | ||
* http://subchen.github.io/javadoc.chm/ | ||
* | ||
* Copyright 2010-2013 Guoqiang Chen. All rights reserved. | ||
* Copyright 2010-2014 Guoqiang Chen. All rights reserved. | ||
* Email: [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* javadoc.chm | ||
* http://subchen.github.io/javadoc.chm/ | ||
* | ||
* Copyright 2010-2013 Guoqiang Chen. All rights reserved. | ||
* Copyright 2010-2014 Guoqiang Chen. All rights reserved. | ||
* Email: [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* javadoc.chm | ||
* http://subchen.github.io/javadoc.chm/ | ||
* | ||
* Copyright 2010-2013 Guoqiang Chen. All rights reserved. | ||
* Copyright 2010-2014 Guoqiang Chen. All rights reserved. | ||
* Email: [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* javadoc.chm | ||
* http://subchen.github.io/javadoc.chm/ | ||
* | ||
* Copyright 2010-2013 Guoqiang Chen. All rights reserved. | ||
* Copyright 2010-2014 Guoqiang Chen. All rights reserved. | ||
* Email: [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* javadoc.chm | ||
* http://subchen.github.io/javadoc.chm/ | ||
* | ||
* Copyright 2010-2013 Guoqiang Chen. All rights reserved. | ||
* Copyright 2010-2014 Guoqiang Chen. All rights reserved. | ||
* Email: [email protected] | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
@@ -19,23 +19,23 @@ | |
*/ | ||
package jerbrick.tools.chm.reader; | ||
|
||
import java.io.*; | ||
import java.util.*; | ||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
import jerbrick.tools.chm.Config; | ||
import org.apache.commons.io.FileUtils; | ||
import org.apache.commons.lang.StringUtils; | ||
import java.io.*; | ||
import java.util.*; | ||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
import jerbrick.tools.chm.Config; | ||
import org.apache.commons.io.FileUtils; | ||
import org.apache.commons.lang.StringUtils; | ||
|
||
public class IndexesReader { | ||
|
||
private Map<String, KeyManager> keyManagerMaps = new HashMap<String, KeyManager>(); | ||
private Map<String, KeyManager> keyManagerMaps = new HashMap<String, KeyManager>(256); | ||
|
||
public Map<String, String> getIndexes(File resource) throws IOException { | ||
Pattern p = Config.style.getIndexRegex(); | ||
Matcher m = p.matcher(FileUtils.readFileToString(resource, Config.encoding)); | ||
|
||
Map<String, String> indexMaps = new HashMap<String, String>(512); | ||
Map<String, String> indexMaps = new HashMap<String, String>(1024); | ||
while (m.find()) { | ||
addIndex(indexMaps, m.group(2), m.group(1)); | ||
} | ||
|
@@ -48,10 +48,13 @@ private void addIndex(Map<String, String> indexMaps, String text, String url) th | |
urlToUse = StringUtils.remove(urlToUse, "../"); | ||
urlToUse = StringUtils.remove(urlToUse, "./"); | ||
|
||
if (text.indexOf('(') < 0 && url.indexOf('#') < 0) { | ||
if (url.indexOf('#') < 0) { | ||
key = text + " class"; | ||
} else { | ||
} else { | ||
key = StringUtils.substringBefore(text, "("); | ||
if (text.indexOf('(') != -1) { | ||
key = key + "()"; | ||
} | ||
|
||
String textToUse = StringUtils.substringBefore(urlToUse, ".html"); | ||
textToUse = textToUse.replace('/', '.') + "." + text; | ||
|
Oops, something went wrong.