minivan / middleman-spellcheck Goto Github PK
View Code? Open in Web Editor NEWRun a spell checking job through aspell every time you build with middleman.
License: MIT License
Run a spell checking job through aspell every time you build with middleman.
License: MIT License
Ivan, do you think there's a chance to push the spellcheck fixes to RubyGems?
Not having this functionality in a public Gems repo makes it hard for me to integrate my build with Circle CI.
Let me know if I can help
Wojciech
I think we're considering 1st
to have 2 "tokens" individually passed to aspell
: 1
and st
.
It would be nice to not do it.
I get an error while running this out of the box on a mac:
/middleman-spellcheck-0.7.2/lib/middleman-spellcheck/spellchecker.rb:24: invalid multibyte char (US-ASCII) (SyntaxError)
Adding the following at the top of that file seems to solve that problem:
# encoding: utf-8
I wanted to add some unit tests, and my understanding is that "rake" should do most of the necessary setup and configuration for me, but when I typed rake
it gets stuck at the issue from below.
I'd like to understand if it all should just work, or whether I need to modify something.
wk:/w/repos/middleman-spellcheck> bundle
Fetching git://github.com/middleman/middleman.git
fatal: unable to connect to github.com:
github.com[0: 192.30.252.131]: errno=Operation timed out
Retrying git clone 'git://github.com/middleman/middleman.git' "/Users/wk/.bundler/cache/git/middleman-aed1a0fbc4b2942d67aa6c89e2b8ec89bfc74f07" --bare --no-hardlinks --quiet due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git://github.com/middleman/middleman.git' "/Users/wk/.bundler/cache/git/middleman-aed1a0fbc4b2942d67aa6c89e2b8ec89bfc74f07" --bare --no-hardlinks --quiet` in directory /w/repos/middleman-spellcheck has failed.
fatal: unable to connect to github.com:
github.com[0: 192.30.252.131]: errno=Operation timed out
Retrying git clone 'git://github.com/middleman/middleman.git' "/Users/wk/.bundler/cache/git/middleman-aed1a0fbc4b2942d67aa6c89e2b8ec89bfc74f07" --bare --no-hardlinks --quiet due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git://github.com/middleman/middleman.git' "/Users/wk/.bundler/cache/git/middleman-aed1a0fbc4b2942d67aa6c89e2b8ec89bfc74f07" --bare --no-hardlinks --quiet` in directory /w/repos/middleman-spellcheck has failed.
fatal: unable to connect to github.com:
github.com[0: 192.30.252.128]: errno=Operation timed out
Retrying git clone 'git://github.com/middleman/middleman.git' "/Users/wk/.bundler/cache/git/middleman-aed1a0fbc4b2942d67aa6c89e2b8ec89bfc74f07" --bare --no-hardlinks --quiet due to error (4/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git://github.com/middleman/middleman.git' "/Users/wk/.bundler/cache/git/middleman-aed1a0fbc4b2942d67aa6c89e2b8ec89bfc74f07" --bare --no-hardlinks --quiet` in directory /w/repos/middleman-spellcheck has failed.
^Cwk:/w/repos/middleman-spellcheck>
My site has a lot of source code-like things like PredicateFactory
that are being picked up by the spell checker. I would like to be able to do:
activate :spellcheck, exclude-tags: [:code, :pre]
to cause the spell checking to avoid checking these elements that cause lots of spurious errors.
It would be convenient if middleman-spellcheck also generated at the end a deduplicated list reporting all the words that had been flagged as misspelled. Say you used "Heroku", "PredicateFactory", and "changeListener" throughout your pages and these are words you'd like to skip, but you also had a few words you genuinely misspelled.
["Heroku","PredicateFactory","changeListener","signifigant"]
I then take my list, prune any genuine misspellings, and add the rest to my allow:
list in config.rb
. This is the equivalent of doing something like:
bundle exec middleman build | grep "misspell" | sort | uniq | cut -d"'" -f2 | sed 's/\(.*\)/\"\1\"/' | tr "\\n" "," | sed 's/\(.*\),$/[\1]/'
Here is a few examples,
spellcheck Running spell checker for /templates/development-helpers/ misspell The word ''Name' is misspelled
misspell The word ''data' is misspelled
misspell The word ''none'' is misspelled
I can work on this. Any guesses on where to start looking?
Could it be related to this?
https://github.com/minivan/middleman-spellcheck/blame/e3a85d910fd99d92e9d17480ce72154118050af7/lib/middleman-spellcheck/spellchecker.rb#L80
For example Hello<br/>World
would be converted to text HelloWorld
causing the spell check to break. Maybe we could instead turn it into Hello \n World
instead.
After I made fixes to middleman-spellcheck
it's almost right.
https://circleci.com/gh/wkoszek/me
But I didn't bother to fix anything, since I've noticed some bugs in some articles are features in another. I need per-article whitelist for words which I know are fine.
The global list I'd just keep for things that repeat, such as names, acronyms etc..
Summary: we need per-page section, somewhere in front-matter, where I could say:
spellcheck:
- good: SEO, CEO, Toyota
- good: IBM, Twitter, GitHub
Seems like we're splitting words such as green-yellow
or T-rex
. I wonder if there's a good solution to this.
I'm getting this trace from my attempt to build a Dockerfile for my home website.
This is Ubuntu 15.04 with Ruby 2.2.4 built via RVM.
We'll have to debug this guy.
spellcheck Running spell checker for /blog/2012/02/02/book-secret/
/nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-spellcheck-0.9.2/lib/middleman-spellcheck/spellchecker.rb:57:in `block (2 levels) in query': undefined method `strip' for nil:NilClass (NoMethodError)
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-spellcheck-0.9.2/lib/middleman-spellcheck/spellchecker.rb:51:in `each'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-spellcheck-0.9.2/lib/middleman-spellcheck/spellchecker.rb:51:in `block in query'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-spellcheck-0.9.2/lib/middleman-spellcheck/spellchecker.rb:48:in `popen'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-spellcheck-0.9.2/lib/middleman-spellcheck/spellchecker.rb:48:in `query'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-spellcheck-0.9.2/lib/middleman-spellcheck/spellchecker.rb:87:in `check'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-spellcheck-0.9.2/lib/middleman-spellcheck/extension.rb:110:in `run_check'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-spellcheck-0.9.2/lib/middleman-spellcheck/extension.rb:104:in `spellcheck_resource'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-spellcheck-0.9.2/lib/middleman-spellcheck/extension.rb:31:in `block in after_build'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-spellcheck-0.9.2/lib/middleman-spellcheck/extension.rb:29:in `each'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-spellcheck-0.9.2/lib/middleman-spellcheck/extension.rb:29:in `after_build'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-core-3.3.12/lib/middleman-core/extension.rb:159:in `block in bind_after_build'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/uber-0.0.15/lib/uber/options.rb:96:in `instance_exec'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/uber-0.0.15/lib/uber/options.rb:96:in `proc!'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/uber-0.0.15/lib/uber/options.rb:82:in `evaluate_for'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/uber-0.0.15/lib/uber/options.rb:60:in `call'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/hooks-0.4.1/lib/hooks/hook.rb:59:in `evaluate_callback'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/hooks-0.4.1/lib/hooks/hook.rb:55:in `execute_callback'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/hooks-0.4.1/lib/hooks/hook.rb:40:in `block in run'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/hooks-0.4.1/lib/hooks/hook.rb:39:in `each'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/hooks-0.4.1/lib/hooks/hook.rb:39:in `inject'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/hooks-0.4.1/lib/hooks/hook.rb:39:in `run'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/hooks-0.4.1/lib/hooks.rb:55:in `run_hook_for'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/hooks-0.4.1/lib/hooks/instance_hooks.rb:6:in `run_hook'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-core-3.3.12/lib/middleman-core/cli/build.rb:72:in `build'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-core-3.3.12/lib/middleman-core/cli.rb:72:in `method_missing'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:29:in `run'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:126:in `run'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-core-3.3.12/lib/middleman-core/cli.rb:20:in `start'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/gems/middleman-core-3.3.12/bin/middleman:18:in `<top (required)>'
from /nonexistent/.rvm/rubies/ruby-2.2.4/bin/middleman:23:in `load'
from /nonexistent/.rvm/rubies/ruby-2.2.4/bin/middleman:23:in `<main>'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/bin/ruby_executable_hooks:15:in `eval'
from /nonexistent/.rvm/rubies/ruby-2.2.4/lib/ruby/gems/2.2.0/bin/ruby_executable_hooks:15:in `<main>'
makefile:4: recipe for target 'render' failed
make: *** [render] Error 1
Even the 0.9.2 gem declares a dependency on middleman-core ~> 3.2, so cannot be used with Middleman 4.0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.