Skip to content

Removed offline-reference docs. #11495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions app/src/processing/app/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -2169,60 +2169,6 @@ static public void registerWindowCloseKeys(JRootPane root,
// .................................................................


static public void showReference(String filename) {
showReference("reference/www.arduino.cc/en", filename);
}

static public void showReference(String prefix, String filename) {
File referenceFolder = getContentFile(prefix);
File referenceFile = new File(referenceFolder, filename);
if (!referenceFile.exists())
referenceFile = new File(referenceFolder, filename + ".html");

if(referenceFile.exists()){
openURL(referenceFile.getAbsolutePath());
}else{
showWarning(tr("Problem Opening URL"), format(tr("Could not open the URL\n{0}"), referenceFile), null);
}
}

public static void showEdisonGettingStarted() {
showReference("reference/Edison_help_files", "ArduinoIDE_guide_edison");
}

static public void showArduinoGettingStarted() {
if (OSUtils.isMacOS()) {
showReference("Guide/MacOSX");
} else if (OSUtils.isWindows()) {
showReference("Guide/Windows");
} else {
openURL("http://www.arduino.cc/playground/Learning/Linux");
}
}

static public void showReference() {
showReference("Reference/HomePage");
}


static public void showEnvironment() {
showReference("Guide/Environment");
}


static public void showTroubleshooting() {
showReference("Guide/Troubleshooting");
}


static public void showFAQ() {
showReference("Main/FAQ");
}


// .................................................................


/**
* "No cookie for you" type messages. Nothing fatal or all that
* much of a bummer, but something to notify the user about.
Expand Down
35 changes: 21 additions & 14 deletions app/src/processing/app/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@
import java.io.FileFilter;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.ConnectException;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -1134,29 +1136,29 @@ private JMenu buildHelpMenu() {
menu.setMnemonic(KeyEvent.VK_H);

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

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

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

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

menu.addSeparator();

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

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

item = new JMenuItem(tr("Visit Arduino.cc"));
Expand Down Expand Up @@ -1553,20 +1555,25 @@ protected void removeTab(SketchFile file) throws IOException {
tabs.remove(index);
}


// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

void handleFindReference(ActionEvent e) {
String text = getCurrentTab().getCurrentKeyword();

void handleFindReference(String text) {
String referenceFile = base.getPdeKeywords().getReference(text);
String q;
if (referenceFile == null) {
statusNotice(I18n.format(tr("No reference available for \"{0}\""), text));
q = text;
} else if (referenceFile.startsWith("Serial_")) {
q = referenceFile.substring(7);
} else {
if (referenceFile.startsWith("Serial_")) {
Base.showReference("Serial/" + referenceFile.substring("Serial_".length()));
} else {
Base.showReference("Reference/" + referenceFile);
}
q = referenceFile;
}
try {
Base.openURL("https://www.arduino.cc/search?tab=&q="
+ URLEncoder.encode(q, "UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/processing/app/EditorTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public void actionPerformed(ActionEvent e) {
menu.add(item);

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

final JMenuItem openURLItem = new JMenuItem(tr("Open URL"));
Expand Down
45 changes: 0 additions & 45 deletions app/src/processing/app/syntax/SketchTextArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,11 @@ public SketchTextArea(RSyntaxDocument document, PdeKeywords pdeKeywords) throws

public void setKeywords(PdeKeywords keywords) {
pdeKeywords = keywords;
setLinkGenerator(new DocLinkGenerator(pdeKeywords));
}

private void installFeatures() throws IOException {
setTheme(PreferencesData.get("editor.syntax_theme", "default"));

setLinkGenerator(new DocLinkGenerator(pdeKeywords));

setSyntaxEditingStyle(SYNTAX_STYLE_CPLUSPLUS);
}

Expand Down Expand Up @@ -175,48 +172,6 @@ public void getTextLine(int line, Segment segment) {
}
}

private static class DocLinkGenerator implements LinkGenerator {

private final PdeKeywords pdeKeywords;

public DocLinkGenerator(PdeKeywords pdeKeywords) {
this.pdeKeywords = pdeKeywords;
}

@Override
public LinkGeneratorResult isLinkAtOffset(RSyntaxTextArea textArea, final int offs) {
Token token = textArea.modelToToken(offs);
if (token == null) {
return null;
}

String reference = pdeKeywords.getReference(token.getLexeme());

if (reference != null || (token.getType() == TokenTypes.DATA_TYPE || token.getType() == TokenTypes.VARIABLE || token.getType() == TokenTypes.FUNCTION)) {

return new LinkGeneratorResult() {

@Override
public int getSourceOffset() {
return offs;
}

@Override
public HyperlinkEvent execute() {

LOG.fine("Open Reference: " + reference);

Base.showReference("Reference/" + reference);

return null;
}
};
}

return null;
}
}


/**
* Handles http hyperlinks.
Expand Down
14 changes: 0 additions & 14 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@

<antcall target="assemble-examples" />

<mkdir dir="${target.path}/reference"/>

<antcall target="assemble-docs" />

<!-- Write the revision file! -->
<echo file="${target.path}/lib/version.txt" message="${version}" />

Expand Down Expand Up @@ -254,16 +250,6 @@
</copy>
</target>

<target name="assemble-docs" unless="no_docs">
<!-- Unzip documentation -->
<antcall target="unzip">
<param name="archive_file" value="shared/reference-1.6.6-3.zip" />
<param name="archive_url" value="https://downloads.arduino.cc/reference-1.6.6-3.zip" />
<param name="final_folder" value="${target.path}/reference/www.arduino.cc" />
<param name="dest_folder" value="${target.path}/reference/" />
</antcall>
</target>

<!-- copy library folder -->
<target name="assemble-libraries" unless="light_bundle">
<download-library name="Ethernet" version="2.0.0"/>
Expand Down
1 change: 0 additions & 1 deletion build/shared/reference-1.6.6-3.zip.sha

This file was deleted.

3 changes: 3 additions & 0 deletions build/shared/revisions.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
ARDUINO 1.8.15 Not yet release

[ide]
* Removed the very outdated off-line documentation.

[wifi-firmware]
* Added latest firmwares (up to version 1.4.8) for NINA-based boards

Expand Down