Skip to content
This repository was archived by the owner on Jun 11, 2020. It is now read-only.

Commit c23a626

Browse files
committed
Version 1.0.0
0 parents  commit c23a626

File tree

9 files changed

+809
-0
lines changed

9 files changed

+809
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#OSX-specific exclusions
2+
.[dD][sS]_[sS]tore
3+
4+
#Sublime nature exclusions
5+
*.sublime-workspace
6+
*.sublime-project

COPYING

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

Default.sublime-commands

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[
2+
{
3+
"caption": "Salesforce Reference",
4+
"command": "salesforce_reference"
5+
}
6+
]

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Sublime Salesforce Reference
2+
3+
A plugin for Sublime Text that gives you quick access to Salesforce Documentation from Sublime Text.
4+
5+
## Installation
6+
7+
1. **Recommended:** Download [Package Control](http://wbond.net/sublime_packages/package_control) and install using the *Package Control: Install Package* command (search for *Salesforce Reference*)
8+
2. **Not recommended:** Simply download this repo and save it to a *SublimeSalesforceReference* directory inside your Sublime Packages/ directory. You will not receive automatic updates as you would following option 1
9+
10+
## Usage
11+
12+
SublimeSalesforceReference adds a new command to your palette: *'Salesforce Reference'*. Simply select this command, and wait for a few moments for the plugin to retrieve an index of reference pages from Salesforce. At this point, a quick panel will pop up list documentation options; search for what you're after, press enter, and the documentation page will open in your web browser
13+
14+
![](/doc/img/usage.png)
15+
16+
## Contributing, Bugs, Suggestions, Questions
17+
18+
If you have any suggestions or bugs to report, please open an issue and I'll take a look ASAP. If you have any questions or would like to contribute in any way, you can also get in touch with me by tweeting [@Oblongmana](http://twitter.com/oblongmana), or go ahead and fork the repo and submit a pull request.
19+
20+
## License
21+
22+
Copyright (c) 2014 James Hill <oblongmana@gmail.com>
23+
24+
This program is free software: you can redistribute it and/or modify
25+
it under the terms of the GNU General Public License as published by
26+
the Free Software Foundation, either version 3 of the License, or
27+
(at your option) any later version.
28+
29+
This program is distributed in the hope that it will be useful,
30+
but WITHOUT ANY WARRANTY; without even the implied warranty of
31+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32+
GNU General Public License for more details.
33+
34+
You should have received a copy of the GNU General Public License
35+
along with this program. If not, see <http://www.gnu.org/licenses/>.
36+
37+
## Credits
38+
39+
All Salesforce Documentation is © Copyright 2000–2014 salesforce.com, inc.

SalesforceReference.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""SublimeSalesforceReference: Quick access to Salesforce Documentation from Sublime Text"""
2+
__version__ = "1.0.0"
3+
__author__ = "James Hill (oblongmana@gmail.com)"
4+
__copyright__ = "SublimeSalesforceReference: (C) 2014 James Hill. GNU GPL 3."
5+
__credits__ = ["All Salesforce Documentation is © Copyright 2000–2014 salesforce.com, inc."]
6+
7+
import sublime, sublime_plugin
8+
import urllib
9+
import xml.etree.ElementTree as ElementTree
10+
import webbrowser
11+
12+
13+
class SalesforceReferenceCommand(sublime_plugin.WindowCommand):
14+
15+
def run(self):
16+
self.retrieve_index_async()
17+
18+
19+
def retrieve_index_async(self):
20+
sublime.status_message('Retrieving Salesforce Reference Index...')
21+
sublime.set_timeout_async(self.retrieve_index,0)
22+
23+
def retrieve_index(self):
24+
sf_xml = urllib.request.urlopen('http://www.salesforce.com/us/developer/docs/apexcode/Data/Toc.xml').read().decode('utf-8')
25+
sf_tree = ElementTree.fromstring(sf_xml)
26+
leaf_parents = sf_tree.findall("*[@Title='Reference'].//TocEntry[@DescendantCount='0']..")
27+
self.sf_ref_pages_titles = []
28+
self.sf_ref_pages_links = []
29+
for parent in leaf_parents:
30+
self.sf_ref_pages_titles.append(parent.attrib['Title'])
31+
self.sf_ref_pages_links.append(parent.attrib['Link'])
32+
33+
self.window.show_quick_panel(self.sf_ref_pages_titles, self.open_documentation)
34+
35+
def open_documentation(self, reference_index):
36+
if(reference_index != -1):
37+
base_url= 'http://www.salesforce.com/us/developer/docs/apexcode'
38+
webbrowser.open_new_tab(base_url + self.sf_ref_pages_links[reference_index])
39+
40+

doc/img/usage.png

95.3 KB
Loading

messages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"install": "messages/install.txt",
3+
"1.0.0": "messages/1.0.0.txt"
4+
}

messages/1.0.0.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Sublime Force Reference 1.0.0 Release Notes:
2+
3+
Enhancements:
4+
- All commands now run asynchronously, showing a message in the status bar
5+
6+
Bug Fixes:
7+
- The "My Sites" Command now also checks for an http:// prefix and adds if missing

messages/install.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Sublime Salesforce Reference
2+
3+
A plugin for Sublime Text that gives you quick access to Salesforce Documentation from Sublime Text.
4+
5+
## Installation
6+
7+
1. **Recommended:** Download [Package Control](http://wbond.net/sublime_packages/package_control) and install using the *Package Control: Install Package* command (search for *Salesforce Reference*)
8+
2. **Not recommended:** Simply download this repo and save it to a *SublimeSalesforceReference* directory inside your Sublime Packages/ directory. You will not receive automatic updates as you would following option 1
9+
10+
## Usage
11+
12+
SublimeSalesforceReference adds a new command to your palette: *'Salesforce Reference'*. Simply select this command, and wait for a few moments for the plugin to retrieve an index of reference pages from Salesforce. At this point, a quick panel will pop up list documentation options; search for what you're after, press enter, and the documentation page will open in your web browser
13+
14+
## License
15+
16+
Copyright (c) 2014 James Hill <oblongmana@gmail.com>
17+
18+
This program is free software: you can redistribute it and/or modify
19+
it under the terms of the GNU General Public License as published by
20+
the Free Software Foundation, either version 3 of the License, or
21+
(at your option) any later version.
22+
23+
This program is distributed in the hope that it will be useful,
24+
but WITHOUT ANY WARRANTY; without even the implied warranty of
25+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26+
GNU General Public License for more details.
27+
28+
You should have received a copy of the GNU General Public License
29+
along with this program. If not, see <http://www.gnu.org/licenses/>.
30+
31+
## Credits
32+
33+
All Salesforce Documentation is © Copyright 2000–2014 salesforce.com, inc.

0 commit comments

Comments
 (0)