Skip to content

Commit

Permalink
Spell check (#1052)
Browse files Browse the repository at this point in the history
* simple refactor

* utilize the spellcheck sphinx plugin
  • Loading branch information
johrstrom authored Dec 30, 2024
1 parent e6bb883 commit 5b476e0
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
ruby-version: '3.3'
bundler-cache: true

- name: Check Spelling
run: |
rake spellcheck || true
- name: Make Html
run: |
rake build
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,9 @@ dummy:
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
@echo
@echo "Build finished. Dummy builder generates no files."

.PHONY: spellcheck
spellcheck:
$(SPHINXBUILD) -b spelling $(ALLSPHINXOPTS) $(BUILDDIR)
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
25 changes: 17 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ end

desc "Build docs using docker"
task :build do
if podman?
exec "podman run --rm -it -v #{__dir__}:/doc #{image} make html"
elsif docker?
exec "docker run --rm -it -v '#{__dir__}:/doc' -u '#{user_group}' #{image} make html"
else
raise StandardError, "Cannot find any suitable container runtime to build. Need 'podman' or 'docker' installed."
end
exec "#{run_cmd} make html"
end

desc "Spellcheck"
task :spellcheck do
exec "#{run_cmd} make spellcheck"
end

desc "Open built documentation in browser"
Expand All @@ -25,7 +24,7 @@ def user_group
end

def image
'ohiosupercomputer/ood-doc-build:v3.0.0'
'ohiosupercomputer/ood-doc-build:v3.1.0'
end

def docker?
Expand All @@ -37,3 +36,13 @@ def podman?
`which podman 2>/dev/null 2>&1`
$?.success?
end

def run_cmd
if podman?
"podman run --rm -it -v #{__dir__}:/doc #{image}"
elsif docker?
"docker run --rm -it -v '#{__dir__}:/doc' -u '#{user_group}' #{image}"
else
raise StandardError, "Cannot find any suitable container runtime to build. Need 'podman' or 'docker' installed."
end
end
6 changes: 5 additions & 1 deletion source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
'sphinx.ext.githubpages',
'sphinxcontrib.httpdomain',
'sphinxcontrib.plantuml',
'sphinx_tabs.tabs'
'sphinx_tabs.tabs',
'sphinxcontrib.spelling'
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -411,3 +412,6 @@ def setup(app):
doc_context = {
'ondemand_version': version,
}

# spelling configurations
spelling_ignore_contributor_names = False
7 changes: 7 additions & 0 deletions source/spelling_wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
backport
backporting
websocket
Phusion
Stata
VNC
Fluxbox

0 comments on commit 5b476e0

Please sign in to comment.