diff options
author | Calixte DENIZET <calixte@contrib.scilab.org> | 2011-05-10 14:02:52 +0200 |
---|---|---|
committer | Vincent COUVERT <vincent.couvert@scilab.org> | 2011-05-10 14:22:19 +0200 |
commit | 8a49f7457e431f4e25e181f768a29a66d6ea6651 (patch) | |
tree | 8aed78f03b36ea5e21014337f9a3c4d687e84481 /scilab/modules | |
parent | e4be69d4109b74ff6f02b875fa73a612e0200755 (diff) | |
download | scilab-8a49f7457e431f4e25e181f768a29a66d6ea6651.zip scilab-8a49f7457e431f4e25e181f768a29a66d6ea6651.tar.gz |
Bug 9439 fixed: There was no entry 'Scilab Home' in help toc list
Change-Id: I87ff422d6e415ab1340f83f9abeb7f3c8ea32e55
Diffstat (limited to 'scilab/modules')
3 files changed, 14 insertions, 4 deletions
diff --git a/scilab/modules/helptools/src/java/org/scilab/modules/helptools/HTMLDocbookTagConverter.java b/scilab/modules/helptools/src/java/org/scilab/modules/helptools/HTMLDocbookTagConverter.java index 07533a3..52f08ce 100644 --- a/scilab/modules/helptools/src/java/org/scilab/modules/helptools/HTMLDocbookTagConverter.java +++ b/scilab/modules/helptools/src/java/org/scilab/modules/helptools/HTMLDocbookTagConverter.java | |||
@@ -91,6 +91,8 @@ public class HTMLDocbookTagConverter extends DocbookTagConverter implements Temp | |||
91 | protected String currentId; | 91 | protected String currentId; |
92 | protected String indexFilename = "index" /*UUID.randomUUID().toString()*/ + ".html"; | 92 | protected String indexFilename = "index" /*UUID.randomUUID().toString()*/ + ".html"; |
93 | 93 | ||
94 | protected boolean isToolbox; | ||
95 | |||
94 | /** | 96 | /** |
95 | * Constructor | 97 | * Constructor |
96 | * @param inName the name of the input stream | 98 | * @param inName the name of the input stream |
@@ -118,6 +120,7 @@ public class HTMLDocbookTagConverter extends DocbookTagConverter implements Temp | |||
118 | scilabLexer = new ScilabLexer(primConf, macroConf); | 120 | scilabLexer = new ScilabLexer(primConf, macroConf); |
119 | this.urlBase = urlBase; | 121 | this.urlBase = urlBase; |
120 | this.linkToTheWeb = urlBase != null && !urlBase.equals("scilab://"); | 122 | this.linkToTheWeb = urlBase != null && !urlBase.equals("scilab://"); |
123 | this.isToolbox = isToolbox; | ||
121 | if (isToolbox) {// we generate a toolbox's help | 124 | if (isToolbox) {// we generate a toolbox's help |
122 | HTMLScilabCodeHandler.setLinkWriter(new AbstractScilabCodeHandler.LinkWriter() { | 125 | HTMLScilabCodeHandler.setLinkWriter(new AbstractScilabCodeHandler.LinkWriter() { |
123 | public String getLink(String id) { | 126 | public String getLink(String id) { |
diff --git a/scilab/modules/helptools/src/java/org/scilab/modules/helptools/JavaHelpDocbookTagConverter.java b/scilab/modules/helptools/src/java/org/scilab/modules/helptools/JavaHelpDocbookTagConverter.java index cb9cd95..0ddedc1 100644 --- a/scilab/modules/helptools/src/java/org/scilab/modules/helptools/JavaHelpDocbookTagConverter.java +++ b/scilab/modules/helptools/src/java/org/scilab/modules/helptools/JavaHelpDocbookTagConverter.java | |||
@@ -38,6 +38,7 @@ import org.xml.sax.SAXException; | |||
38 | public class JavaHelpDocbookTagConverter extends HTMLDocbookTagConverter { | 38 | public class JavaHelpDocbookTagConverter extends HTMLDocbookTagConverter { |
39 | 39 | ||
40 | private static final String XMLSTRING = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n"; | 40 | private static final String XMLSTRING = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n"; |
41 | private static final String WHATSNEW = "What's new ?"; | ||
41 | 42 | ||
42 | private StringBuilder buffer = new StringBuilder(8192); | 43 | private StringBuilder buffer = new StringBuilder(8192); |
43 | 44 | ||
@@ -118,6 +119,9 @@ public class JavaHelpDocbookTagConverter extends HTMLDocbookTagConverter { | |||
118 | private String convertMapId() { | 119 | private String convertMapId() { |
119 | buffer.setLength(0); | 120 | buffer.setLength(0); |
120 | buffer.append("<map version=\"1.0\">\n<mapID target=\"index\" url=\"index.html\"/>\n"); | 121 | buffer.append("<map version=\"1.0\">\n<mapID target=\"index\" url=\"index.html\"/>\n"); |
122 | if (!isToolbox) { | ||
123 | buffer.append("<mapID target=\"whatsnew\" url=\"ScilabHomePage.html\"/>\n"); | ||
124 | } | ||
121 | Iterator<String> iter = mapId.keySet().iterator(); | 125 | Iterator<String> iter = mapId.keySet().iterator(); |
122 | while (iter.hasNext()) { | 126 | while (iter.hasNext()) { |
123 | String id = iter.next(); | 127 | String id = iter.next(); |
@@ -153,6 +157,9 @@ public class JavaHelpDocbookTagConverter extends HTMLDocbookTagConverter { | |||
153 | private String convertTocItem() { | 157 | private String convertTocItem() { |
154 | buffer.setLength(0); | 158 | buffer.setLength(0); |
155 | buffer.append("<toc version=\"1.0\">\n<tocitem target=\"index\" text=\"" + bookTitle + "\">\n"); | 159 | buffer.append("<toc version=\"1.0\">\n<tocitem target=\"index\" text=\"" + bookTitle + "\">\n"); |
160 | if (!isToolbox) { | ||
161 | buffer.append("<tocitem target=\"whatsnew\" text=\"Scilab Home\"/>\n"); | ||
162 | } | ||
156 | convertTreeId(tree); | 163 | convertTreeId(tree); |
157 | buffer.append("</tocitem>\n</toc>"); | 164 | buffer.append("</tocitem>\n</toc>"); |
158 | 165 | ||
diff --git a/scilab/modules/helptools/src/java/org/scilab/modules/helptools/SciDocMain.java b/scilab/modules/helptools/src/java/org/scilab/modules/helptools/SciDocMain.java index bf4a704..efe2412 100644 --- a/scilab/modules/helptools/src/java/org/scilab/modules/helptools/SciDocMain.java +++ b/scilab/modules/helptools/src/java/org/scilab/modules/helptools/SciDocMain.java | |||
@@ -137,14 +137,14 @@ public final class SciDocMain { | |||
137 | if (format.equalsIgnoreCase("javahelp")) { | 137 | if (format.equalsIgnoreCase("javahelp")) { |
138 | if (!isToolbox) { | 138 | if (!isToolbox) { |
139 | Helpers.copyFile(new File(SCI + "/modules/helptools/data/pages/error.html"), new File(outputDirectory + "/ScilabErrorPage.html")); | 139 | Helpers.copyFile(new File(SCI + "/modules/helptools/data/pages/error.html"), new File(outputDirectory + "/ScilabErrorPage.html")); |
140 | File homepage = new File(SCI + "/modules/helptools/data/pages/homepage-"+language+".html"); | 140 | File homepage = new File(SCI + "/modules/helptools/data/pages/homepage-" + language + ".html"); |
141 | if (!homepage.isFile()) { | 141 | if (!homepage.isFile()) { |
142 | /* could not find the localized homepage. Switch to english */ | 142 | /* could not find the localized homepage. Switch to english */ |
143 | homepage=new File(SCI + "/modules/helptools/data/pages/homepage-en_US.html"); | 143 | homepage = new File(SCI + "/modules/helptools/data/pages/homepage-en_US.html"); |
144 | } | 144 | } |
145 | Helpers.copyFile(homepage, new File(outputDirectory + "/ScilabHomePage.html")); | 145 | Helpers.copyFile(homepage, new File(outputDirectory + "/ScilabHomePage.html")); |
146 | 146 | ||
147 | File homepageImage = new File(SCI + "/modules/helptools/data/pages/ban-"+language+".png"); | 147 | File homepageImage = new File(SCI + "/modules/helptools/data/pages/ban-" + language + ".png"); |
148 | if (!homepageImage.isFile()) { | 148 | if (!homepageImage.isFile()) { |
149 | homepageImage = new File(SCI + "/modules/helptools/data/pages/ban-en_US.png"); | 149 | homepageImage = new File(SCI + "/modules/helptools/data/pages/ban-en_US.png"); |
150 | } | 150 | } |