Skip to content

Commit b9d32f4

Browse files
committed
Removed bundled offline docs
The offline documentation is hard to update and gets outdated very quickly. Fix arduino#8860
1 parent 1527b42 commit b9d32f4

File tree

5 files changed

+22
-84
lines changed

5 files changed

+22
-84
lines changed

app/src/processing/app/Base.java

-54
Original file line numberDiff line numberDiff line change
@@ -2169,60 +2169,6 @@ static public void registerWindowCloseKeys(JRootPane root,
21692169
// .................................................................
21702170

21712171

2172-
static public void showReference(String filename) {
2173-
showReference("reference/www.arduino.cc/en", filename);
2174-
}
2175-
2176-
static public void showReference(String prefix, String filename) {
2177-
File referenceFolder = getContentFile(prefix);
2178-
File referenceFile = new File(referenceFolder, filename);
2179-
if (!referenceFile.exists())
2180-
referenceFile = new File(referenceFolder, filename + ".html");
2181-
2182-
if(referenceFile.exists()){
2183-
openURL(referenceFile.getAbsolutePath());
2184-
}else{
2185-
showWarning(tr("Problem Opening URL"), format(tr("Could not open the URL\n{0}"), referenceFile), null);
2186-
}
2187-
}
2188-
2189-
public static void showEdisonGettingStarted() {
2190-
showReference("reference/Edison_help_files", "ArduinoIDE_guide_edison");
2191-
}
2192-
2193-
static public void showArduinoGettingStarted() {
2194-
if (OSUtils.isMacOS()) {
2195-
showReference("Guide/MacOSX");
2196-
} else if (OSUtils.isWindows()) {
2197-
showReference("Guide/Windows");
2198-
} else {
2199-
openURL("http://www.arduino.cc/playground/Learning/Linux");
2200-
}
2201-
}
2202-
2203-
static public void showReference() {
2204-
showReference("Reference/HomePage");
2205-
}
2206-
2207-
2208-
static public void showEnvironment() {
2209-
showReference("Guide/Environment");
2210-
}
2211-
2212-
2213-
static public void showTroubleshooting() {
2214-
showReference("Guide/Troubleshooting");
2215-
}
2216-
2217-
2218-
static public void showFAQ() {
2219-
showReference("Main/FAQ");
2220-
}
2221-
2222-
2223-
// .................................................................
2224-
2225-
22262172
/**
22272173
* "No cookie for you" type messages. Nothing fatal or all that
22282174
* much of a bummer, but something to notify the user about.

app/src/processing/app/Editor.java

+21-14
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@
4646
import java.io.FileFilter;
4747
import java.io.FilenameFilter;
4848
import java.io.IOException;
49+
import java.io.UnsupportedEncodingException;
4950
import java.net.ConnectException;
5051
import java.net.URL;
5152
import java.net.URLClassLoader;
53+
import java.net.URLEncoder;
5254
import java.util.ArrayList;
5355
import java.util.Arrays;
5456
import java.util.Collections;
@@ -1137,29 +1139,29 @@ private JMenu buildHelpMenu() {
11371139
menu.setMnemonic(KeyEvent.VK_H);
11381140

11391141
JMenuItem item = new JMenuItem(tr("Getting Started"));
1140-
item.addActionListener(event -> Base.showArduinoGettingStarted());
1142+
item.addActionListener(event -> Base.openURL("https://www.arduino.cc/en/Guide"));
11411143
menu.add(item);
11421144

11431145
item = new JMenuItem(tr("Environment"));
1144-
item.addActionListener(event -> Base.showEnvironment());
1146+
item.addActionListener(event -> Base.openURL("https://www.arduino.cc/en/Guide/Environment"));
11451147
menu.add(item);
11461148

11471149
item = new JMenuItem(tr("Troubleshooting"));
1148-
item.addActionListener(event -> Base.showTroubleshooting());
1150+
item.addActionListener(event -> Base.openURL("https://support.arduino.cc/hc/en-us"));
11491151
menu.add(item);
11501152

11511153
item = new JMenuItem(tr("Reference"));
1152-
item.addActionListener(event -> Base.showReference());
1154+
item.addActionListener(event -> Base.openURL("https://www.arduino.cc/reference/en/"));
11531155
menu.add(item);
11541156

11551157
menu.addSeparator();
11561158

11571159
item = newJMenuItemShift(tr("Find in Reference"), 'F');
1158-
item.addActionListener(event -> handleFindReference(event));
1160+
item.addActionListener(event -> handleFindReference(getCurrentTab().getCurrentKeyword()));
11591161
menu.add(item);
11601162

11611163
item = new JMenuItem(tr("Frequently Asked Questions"));
1162-
item.addActionListener(event -> Base.showFAQ());
1164+
item.addActionListener(event -> Base.openURL("https://support.arduino.cc/hc/en-us"));
11631165
menu.add(item);
11641166

11651167
item = new JMenuItem(tr("Visit Arduino.cc"));
@@ -1556,20 +1558,25 @@ protected void removeTab(SketchFile file) throws IOException {
15561558
tabs.remove(index);
15571559
}
15581560

1561+
15591562
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15601563

1561-
void handleFindReference(ActionEvent e) {
1562-
String text = getCurrentTab().getCurrentKeyword();
15631564

1565+
void handleFindReference(String text) {
15641566
String referenceFile = base.getPdeKeywords().getReference(text);
1567+
String q;
15651568
if (referenceFile == null) {
1566-
statusNotice(I18n.format(tr("No reference available for \"{0}\""), text));
1569+
q = text;
1570+
} else if (referenceFile.startsWith("Serial_")) {
1571+
q = referenceFile.substring(7);
15671572
} else {
1568-
if (referenceFile.startsWith("Serial_")) {
1569-
Base.showReference("Serial/" + referenceFile.substring("Serial_".length()));
1570-
} else {
1571-
Base.showReference("Reference/" + referenceFile);
1572-
}
1573+
q = referenceFile;
1574+
}
1575+
try {
1576+
Base.openURL("https://www.arduino.cc/search?tab=&q="
1577+
+ URLEncoder.encode(q, "UTF-8"));
1578+
} catch (UnsupportedEncodingException e) {
1579+
e.printStackTrace();
15731580
}
15741581
}
15751582

app/src/processing/app/EditorTab.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public void actionPerformed(ActionEvent e) {
247247
menu.add(item);
248248

249249
final JMenuItem referenceItem = new JMenuItem(tr("Find in Reference"));
250-
referenceItem.addActionListener(editor::handleFindReference);
250+
referenceItem.addActionListener(ev -> editor.handleFindReference(getCurrentKeyword()));
251251
menu.add(referenceItem);
252252

253253
final JMenuItem openURLItem = new JMenuItem(tr("Open URL"));

build/build.xml

-14
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,6 @@
213213

214214
<antcall target="assemble-examples" />
215215

216-
<mkdir dir="${target.path}/reference"/>
217-
218-
<antcall target="assemble-docs" />
219-
220216
<!-- Write the revision file! -->
221217
<echo file="${target.path}/lib/version.txt" message="${version}" />
222218

@@ -253,16 +249,6 @@
253249
</copy>
254250
</target>
255251

256-
<target name="assemble-docs" unless="no_docs">
257-
<!-- Unzip documentation -->
258-
<antcall target="unzip">
259-
<param name="archive_file" value="shared/reference-1.6.6-3.zip" />
260-
<param name="archive_url" value="https://downloads.arduino.cc/reference-1.6.6-3.zip" />
261-
<param name="final_folder" value="${target.path}/reference/www.arduino.cc" />
262-
<param name="dest_folder" value="${target.path}/reference/" />
263-
</antcall>
264-
</target>
265-
266252
<!-- copy library folder -->
267253
<target name="assemble-libraries" unless="light_bundle">
268254
<download-library name="Ethernet" version="2.0.0"/>

build/shared/reference-1.6.6-3.zip.sha

-1
This file was deleted.

0 commit comments

Comments
 (0)