Skip to content

Commit 37a5a00

Browse files
authored
Merge pull request #320 from srobo/add-spell-check
Add spell checking
2 parents 624b249 + 686f0c1 commit 37a5a00

File tree

22 files changed

+2480
-93
lines changed

22 files changed

+2480
-93
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ _site
33
.sass-cache
44
.jekyll-metadata
55
.bundle
6+
node_modules/

.spelling

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
APRILTAG
2+
BODMAS
3+
CamCon
4+
DataTraveler
5+
Duratool
6+
DTSE9H
7+
Ebuyer
8+
iMAX
9+
IntelliJ
10+
Nikitin
11+
ODROID
12+
overcurrent
13+
piezo
14+
Plazma
15+
PULLUP
16+
Quarternion
17+
Ruggeduino
18+
Ruggeduinos
19+
Scarzy
20+
srobo
21+
ST7202USBGB
22+
studentrobotics
23+
usbkey
24+
Webots
25+
Zoloto
26+
27+
# Markup
28+
allowfullscreen
29+
endcomment
30+
forloop
31+
xmlschema
32+
33+
# Python Modules
34+
dateutil
35+
dbus
36+
docopt
37+
gmqtt
38+
iniparse
39+
kiwisolver
40+
matplotlib
41+
pydantic
42+
pygobject
43+
pyparsing
44+
pyquaternion
45+
pyserial
46+
pytz
47+
pyudev
48+
pyusb
49+
setuptools
50+
udiskie

Rakefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ task :dependencies do
1616
end
1717
end
1818

19+
task :spelling_dependencies do
20+
sh('npm install')
21+
end
22+
1923
file '_sass/brand/.git' do
2024
sh('git submodule update --init')
2125
end
@@ -30,6 +34,8 @@ task :build => [:dependencies, :submodules] do
3034
sh('bundle exec jekyll build --config _config.yml')
3135
end
3236

37+
task :build_spellings => [:build, :spelling_dependencies]
38+
3339
task :validate_kit_versions do
3440
data = YAML.load_file('_data/kit_versions.yml')
3541
data.each do |entry|
@@ -88,4 +94,8 @@ task :validate_sidebar_tree => [:build] do
8894
puts "Sidebar links validated successfully"
8995
end
9096

91-
task :validate => [:validate_kit_versions, :validate_links, :validate_sidebar_tree]
97+
task :validate_spellings => [:build_spellings] do
98+
sh('npm run spell-check')
99+
end
100+
101+
task :validate => [:validate_kit_versions, :validate_links, :validate_sidebar_tree, :validate_spellings]

_includes/sidebar.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
<a href="{{ subheading.url | prepend: site.baseurl }}">{{subheading.title}}</a>
1717
{% if subheading.tree %}
1818
<ul>
19-
{% for subsubheading in subheading.tree %}
20-
<li{% if clean_url == subsubheading.url %} class="selected" {% endif %}>
21-
<a href="{{ subsubheading.url | prepend: site.baseurl }}">{{subsubheading.title}}</a>
22-
{% if subsubheading.tree %}
19+
{% for sub_subheading in subheading.tree %}
20+
<li{% if clean_url == sub_subheading.url %} class="selected" {% endif %}>
21+
<a href="{{ sub_subheading.url | prepend: site.baseurl }}">{{sub_subheading.title}}</a>
22+
{% if sub_subheading.tree %}
2323
<ul>
24-
{% for subsubsubheading in subsubheading.tree %}
25-
<li{% if clean_url == subsubsubheading.url %} class="selected" {% endif %}>
26-
<a href="{{ subsubsubheading.url | prepend: site.baseurl }}">{{subsubsubheading.title}}</a>
24+
{% for sub_sub_subheading in sub_subheading.tree %}
25+
<li{% if clean_url == sub_sub_subheading.url %} class="selected" {% endif %}>
26+
<a href="{{ sub_sub_subheading.url | prepend: site.baseurl }}">{{sub_sub_subheading.title}}</a>
2727
</li>
2828
{% endfor %}
2929
</ul>

cspell.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
3+
"version": "0.2",
4+
"dictionaryDefinitions": [
5+
{
6+
"name": "project-words",
7+
"path": "./.spelling",
8+
"addWords": true
9+
}
10+
],
11+
"dictionaries": ["en-gb", "project-words", "python"],
12+
"useGitignore": true,
13+
"ignorePaths": ["resources/", "vendor/"],
14+
"files": ["**/*.html", "**/*.md", "**/*.js", "**/*.css"]
15+
}

css/interactive_troubleshooter.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
div.doc #resetbtnattop {
1+
div.doc #reset-btn-at-top {
22
margin-top: 20px;
33
font-weight: bold;
44
}

js/interactive_troubleshooter.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
function init() {
66
globalRadioName = 0;
77

8-
var resetBtnAtTop = document.getElementById("resetbtnattop");
8+
var resetBtnAtTop = document.getElementById("reset-btn-at-top");
99
resetBtnAtTop.style.display = "none";
1010

1111
var troubleshooter = document.getElementById("troubleshooter");
@@ -42,26 +42,26 @@
4242
parent.appendChild(newMessage);
4343
}
4444

45-
if ("askiffixed" in answer) {
46-
var question = data.askiffixed_question;
47-
question.answers[1].nextquestion = answer.nextquestion;
45+
if ("ask_if_fixed" in answer) {
46+
var question = data.ask_if_fixed_question;
47+
question.answers[1].next_question = answer.next_question;
4848
appendQuestion(parent, question);
4949
return;
5050
}
5151

52-
if (!("nextquestion" in answer)) {
52+
if (!("next_question" in answer)) {
5353
var newMessage = document.createElement("p");
5454
newMessage.className = "message";
5555
newMessage.textContent = "Thank you for using the SR Troubleshooter.";
5656
parent.appendChild(newMessage);
5757

58-
var resetBtnAtTop = document.getElementById("resetbtnattop");
58+
var resetBtnAtTop = document.getElementById("reset-btn-at-top");
5959
resetBtnAtTop.style.display = "inline-block";
6060

6161
return;
6262
}
6363

64-
appendQuestionById(parent, answer.nextquestion);
64+
appendQuestionById(parent, answer.next_question);
6565
}
6666

6767
function appendQuestionById(parent, id) {

0 commit comments

Comments
 (0)