提交 ae6a92dd authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Fix some broken relative links in PDF

上级 b1ea8107
......@@ -18,7 +18,7 @@ Build
<table class="content"><tr class="content"><td class="content"><div class="contentDiv">
<!-- } -->
<h1>Build</h1>
<h1 id="build_index">Build</h1>
<a href="#portability">
Portability</a><br />
<a href="#environment">
......@@ -263,7 +263,7 @@ or if you have a feature request:
<ul><li>For bug reports, please provide a
<a href="http://sscce.org/">short, self contained, correct (compilable), example</a> of the problem.
</li><li>Feature requests are always welcome, even if the feature is already on the
<a href="roadmap.html">roadmap</a>. Your mail will help prioritize feature requests.
<a href="http://www.h2database.com/html/roadmap.html">roadmap</a>. Your mail will help prioritize feature requests.
If you urgently need a feature, consider <a href="#providing_patches">providing a patch</a>.
</li><li>Before posting problems, check the
<a href="faq.html">FAQ</a> and do a <a href="http://google.com">Google search</a>.
......
......@@ -18,7 +18,7 @@ Data Types
<!-- } -->
<h1>Data Types</h1>
<h2>Index</h2>
<h2 id="datatypes_index">Index</h2>
<!-- syntax-start
<p class="notranslate">
<c:forEach var="item" items="dataTypes">
......
......@@ -17,7 +17,7 @@ Frequently Asked Questions
<table class="content"><tr class="content"><td class="content"><div class="contentDiv">
<!-- } -->
<h1>Frequently Asked Questions</h1>
<h1 id="faq_index">Frequently Asked Questions</h1>
<a href="#support">
I Have a Problem or Feature Request</a><br />
......@@ -248,7 +248,7 @@ and not the alias name. If you need the alias name, use
<a href="http://java.sun.com/javase/6/docs/api/java/sql/ResultSetMetaData.html#getColumnLabel(int)"><code>ResultSetMetaData.getColumnLabel()</code></a>.
Some other database don't work like this yet (they don't follow the JDBC specification).
If you need compatibility with those databases, use the <a href="features.html#compatibility">Compatibility Mode</a>,
or append <a href="../javadoc/org/h2/engine/DbSettings.html#ALIAS_COLUMN_NAME"><code>;ALIAS_COLUMN_NAME=TRUE</code></a> to the database URL.
or append <a href="http://www.h2database.com/javadoc/org/h2/engine/DbSettings.html#ALIAS_COLUMN_NAME"><code>;ALIAS_COLUMN_NAME=TRUE</code></a> to the database URL.
</p>
<p>
This also applies to DatabaseMetaData calls that return a result set.
......@@ -285,7 +285,7 @@ Please start with small patches. That could be adding a test case to improve the
<a href="build.html#automated">code coverage</a> (the target code coverage for this project is 90%, higher is better).
You will have to <a href="build.html">develop, build and run the tests</a>.
Once you are familiar with the code, you could implement missing features from the
<a href="roadmap.html">feature request list</a>.
<a href="http://www.h2database.com/html/roadmap.html">feature request list</a>.
I suggest to start with very small features that are easy to implement.
Keep in mind to provide test cases as well.
</p>
......
......@@ -391,7 +391,7 @@ It looks like the development of this database has stopped. The last release was
<h2 id="products_work_with">H2 in Use</h2>
<p>
For a list of applications that work with or use H2, see:
<a href="links.html">Links</a>.
<a href="http://www.h2database.com/html/links.html">Links</a>.
</p>
<h2 id="connection_modes">Connection Modes</h2>
......
......@@ -18,7 +18,7 @@ SQL Grammar
<!-- } -->
<h1>SQL Grammar</h1>
<h2>Index</h2>
<h2 id="grammar_index">Index</h2>
<h3>Commands (Data Manipulation)</h3>
<!-- syntax-start
<p class="notranslate">
......
......@@ -18,7 +18,7 @@ Tutorial
<table class="content"><tr class="content"><td class="content"><div class="contentDiv">
<!-- } -->
<h1>Tutorial</h1>
<h1 id="tutorial_index">Tutorial</h1>
<a href="#tutorial_starting_h2_console">
Starting and Using the H2 Console</a><br />
<a href="#console_syntax">
......
......@@ -27,7 +27,13 @@ public class LinkChecker {
private static final boolean TEST_EXTERNAL_LINKS = false;
private static final boolean OPEN_EXTERNAL_LINKS = false;
private static final String[] IGNORE_MISSING_LINKS_TO = {
"SysProperties", "ErrorCode"
"SysProperties", "ErrorCode",
// TODO check these replacement link too
"#build_index",
"#datatypes_index",
"#faq_index",
"#grammar_index",
"#tutorial_index"
};
private final HashMap<String, String> targets = new HashMap<>();
......
......@@ -41,6 +41,7 @@ public class MergeDocs {
}
text = disableRailroads(text);
text = removeHeaderFooter(fileName, text);
text = fixLinks(text);
buff.append(text);
}
String finalText = buff.toString();
......@@ -92,6 +93,15 @@ public class MergeDocs {
return text;
}
private static String fixLinks(String text) {
return text
.replaceAll("href=\"build.html\"", "href=\"#build_index\"")
.replaceAll("href=\"datatypes.html\"", "href=\"#datatypes_index\"")
.replaceAll("href=\"faq.html\"", "href=\"#faq_index\"")
.replaceAll("href=\"grammar.html\"", "href=\"#grammar_index\"")
.replaceAll("href=\"tutorial.html\"", "href=\"#tutorial_index\"");
}
private static String getContent(String fileName) throws Exception {
File file = new File(BASE_DIR, fileName);
int length = (int) file.length();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论