Commit graph

10 commits

Author SHA1 Message Date
James Nylen
dac8b04fc8
Add full profile search (#763)
* Prevent duplicate company names

* Fix output indentation

* Search full profile content using lunr.js

* Remove extra stop words

This wasn't really working correctly - the stop word 'work' would leave
instances of 'working' and 'works' in the index for example.

* Change company name description from "Name" to "Company name"

* Pre-process query:

- Search for terms in AND mode, per
  https://lunrjs.com/guides/searching.html#term-presence
- Discard non-alphanumeric characters from the search
- Better handling of contractions and searching for stop words

* Display search query and results in the console

* Add special search token: _incomplete

* Add a link to search for incomplete profiles

* Revert "Add a link to search for incomplete profiles"

This reverts commit f6384c90cb.

* Add link to search documentation

* Improve search explanation appearance when it spans multiple lines

* Fix searching for contractions

Previously, searching for e.g. "don't" wasn't working correctly. After
trimming the contraction, "do" is a stop word, so it should be ignored.

* Improve "empty search" message

* Prefer matches other than "company name" in search excerpts

* Move inline scripts before external scripts

This probably doesn't matter right now due to the way the scripts are
currently structured, but it might matter one day and it's more logical
this way.

* Fix search engine index progress

* Improve script indentation

* I got 99 problems and they're all bots

* Update script exit code

When a Node.js error occurs the exit code is probably going to be 1, so
we should use a different code.

* Fix the tests

* Update documentation

This was wrong (out of date), but the correct version is obvious from
reading the code.

* Make download progress work in both Chrome and Firefox

See https://stackoverflow.com/a/32799706
2020-05-06 07:42:21 +01:00
James Nylen
5cce269df4
Refactor validation logic into a short script and a larger library file (#444)
* Refactor validation logic into a short script and a larger library file

* Add unit tests for utility functions
2018-06-25 00:00:12 -05:00
James Nylen
cbd3073fd6
Validate whether profiles marked as incomplete are actually incomplete (#443) 2018-06-24 21:42:33 -05:00
James Nylen
780627bf1e
Better handling of apostrophes in company names (#441) 2018-06-23 00:20:24 -05:00
James Nylen
8942a91a85
Add automated tests for validation script (#438)
* Update node

* Add mocha and chai

* Fix npm audit issue

https://nodesecurity.io/advisories/577

* Skip some redundant errors

* Catch duplicate headings

* Update the wording of a few errors

* Detect when headings are wrapped inside another element

* Build and validate the content of each profile section

* Add tests for validation script

* Remove empty sections in existing profiles
2018-06-22 23:50:06 -05:00
James Nylen
bdce7e5637 Add missing company profiles; require all companies to have a profile (#413)
* Rename "Tower / fournova" to "fournova"

* Fix some issues in the readme

These could break later steps in automated profile generation.

* Generate "sed" script to fill in missing readme links

To use this:

sed -e "big output line from script" -i README.md

* Fill in missing readme links

Missing profile files have not been generated yet.

* Update script to write missing company profiles

* Add missing company profile files (minimal)

* Update rename script

Now that company profiles may contain their own filename, we need to
update the filename there too.

* Rename a few company profiles

* Remove temporary code to generate minimal profiles
2018-04-24 11:20:07 +01:00
James Nylen
c00635038d
Make company headings consistent (#407)
* Change "Office Locations" to "Office locations" for consistent casing

* Standardize other company headings

* Validate heading names

* Add a way to look at headings of all profiles at once
2018-04-16 18:15:26 -04:00
James Nylen
3bbfe49a51 Validate company sort order in readme; try out comment bot (#382)
* Left over from previous changes

* Validate company sort order in readme

* Changes to support validating PR branches

In order to make this work without potentially running untrusted code,
we need to run the validation scripts from a separate place than the
content being validated.

* Fix typo

The output of the validation script should be the same, so this commit
should not generate another bot message.

* Fix most of the readme sort order

The PR should get a new bot message after this.

* Fix remaining sort order issues and remove a duplicate company
2017-12-29 10:40:05 +00:00
James Nylen
7c08aef114 Fix company names; add Travis CI config (#377)
* Fix minor issues in readme table

* Parse and validate readme table

* Add missing links from readme to company profiles

* Fix the last issue with a company's name in its profile

* Add script to rename a company profile

* Fix example company name to match its profile filename

* Rename company profiles to match filename convention

Run this to generate the rename commands:

bin/validate.js | grep 'Expected filename' | sed 's#^#bin/rename.sh company-profiles/#; s#: Expected filename "# company-profiles/#; s#" for company .*$##' | tee renames.txt

Inspect the output, then run this to do the renames:

sh < renames.txt

* Add Travis CI configuration
2017-12-18 22:08:09 +00:00
James Nylen
c7dfcb8ffd Add initial validation script (#375)
Let's do this
2017-12-17 14:31:37 +00:00