Search solution for Nanoc websites

497 views
Skip to first unread message

bradleyland

unread,
Apr 19, 2011, 3:11:34 PM4/19/11
to nanoc
We're conducting a pilot project to use Nanoc for generating our
application's documentation. Everything is going smoothly so far, but
one of the first questions that came up was "how will someone search
the documentation?" I know this is not a problem that Nanoc sets out
to solve, but I'm curious if there is a "popular" solution to this
problem. I did some searching but didn't find any results. I think
part of the problem is that searching for "nanoc search" isn't very
productive, as the "search" keyword is heavily polluted. Right now I'm
considering some sort of simple search server based on Sinatra +
Ferret, but I don't want to trek down a new path when one may already
have been cut. I'm open to any suggestions!

Tom Tuddenham

unread,
Apr 20, 2011, 2:15:50 AM4/20/11
to na...@googlegroups.com
Commercial, but a quick answer would be Google's site search:

http://www.google.com/sitesearch/

The only other thing I can think of is to have some kind of AJAX
driven search based on static pages, but that would involve a lot of
work building up static indices and then searching into them.

Adding dynamic features to nanoc is an intriguing problem area :)

> --
> You received this message because you are subscribed to the nanoc discusssion group.
>
> To post to this group, send email to na...@googlegroups.com
> To unsubscribe from this group, send email to nanoc+un...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/nanoc

Chris Jacob

unread,
Apr 20, 2011, 8:53:59 PM4/20/11
to nanoc
You might want to explore this ( I haven't done this myself yet )...

1. Dynamically build a JSON object saved into a file... pull in URL,
META title, META description, META keywords ... then have some JS
"instant search" against that JSON object to display results very
quickly on the page. (might be too large of a JS file for big sites...
but bonus is that once the file is downloaded 1 time it should be
cached).
2. If the JSON search JS doesn't match any results offer a "Search on
Google" option at the end of the results... which will submit the
search input to google like "Some Keywords site:http://
www.example.com"


... another option if you have ALL your pages in a navigation menu ...
do some sort of JS search against that HTML markup ... perhaps could
use "data-" attributes to add extra value, e.g. keywords, to items
<li><a href="page-x" data-keywords="page sample test">Page X</a></li>

Perhaps same idea using jQuery $.load() to pull in an external file
and then search against it's markup?... better with JSON (smaller file
size).

Hope that gives you some ideas...I'm going to need to do a similar
thing for a static project I'm working on (using Jykell, hosted on
GitHub Pages). I will probably make use of a Navigation Menu that has
all the pages listed in the markup on every page...

FYI: https://github.com/firemonkeyio/firemonkeyio - no code in the
project yet ;-)


On Apr 20, 4:15 pm, Tom Tuddenham <ferrisox...@gmail.com> wrote:
> Commercial, but a quick answer would be Google's site search:
>
> http://www.google.com/sitesearch/
>
> The only other thing I can think of is to have some kind of AJAX
> driven search based on static pages, but that would involve a lot of
> work building up static indices and then searching into them.
>
> Adding dynamic features to nanoc is an intriguing problem area :)
>

Chris Eppstein

unread,
Apr 20, 2011, 9:22:12 PM4/20/11
to na...@googlegroups.com
This is what I do for my nanoc site.


You can see it in action here:


Because it's done on the client, it has a live search aspect that you can see by changing the search query.

chris

bradleyland

unread,
Apr 27, 2011, 9:50:49 AM4/27/11
to nanoc
This is perfect! We're leaning toward keyword based search, rather
than full-text. Documentation full-text search feels kind of lazy to
me. The chances for returning bad results are very high.

On Apr 20, 9:22 pm, Chris Eppstein <ch...@eppsteins.net> wrote:
> This is what I do for my nanoc site.
>
> https://github.com/chriseppstein/compass/tree/master/doc-src
>
> You can see it in action here:
>
> http://beta.compass-style.org/search/?q=css3
>
> Because it's done on the client, it has a live search aspect that you can
> see by changing the search query.
>
> chris
>
> On Wed, Apr 20, 2011 at 5:53 PM, Chris Jacob <i.chris.ja...@gmail.com>wrote:
>
>
>
> > You might want to explore this ( I haven't done this myself yet )...
>
> > 1. Dynamically build a JSON object saved into a file... pull in URL,
> > META title, META description, META keywords ... then have some JS
> > "instant search" against that JSON object to display results very
> > quickly on the page. (might be too large of a JS file for big sites...
> > but bonus is that once the file is downloaded 1 time it should be
> > cached).
> > 2. If the JSON search JS doesn't match any results offer a "Search on
> > Google" option at the end of the results... which will submit the
> > search input to google like "Some Keywords site:http://
> >www.example.com"
>
> > ... another option if you have ALL your pages in a navigation menu ...
> > do some sort of JS search against that HTML markup ... perhaps could
> > use "data-" attributes to add extra value, e.g. keywords, to items
> > <li><a href="page-x" data-keywords="page sample test">Page X</a></li>
>
> > Perhaps same idea using jQuery $.load() to pull in an external file
> > and then search against it's markup?... better with JSON (smaller file
> > size).
>
> > Hope that gives you some ideas...I'm going to need to do a similar
> > thing for a static project I'm working on (using Jykell, hosted on
> > GitHub Pages). I will probably make use of a Navigation Menu that has
> > all the pages listed in the markup on every page...
>
> > FYI:https://github.com/firemonkeyio/firemonkeyio- no code in the

Pito Salas

unread,
Feb 7, 2014, 5:48:24 PM2/7/14
to na...@googlegroups.com, ch...@eppsteins.net
Hey Chris, the link seems to be broken. Does your scheme still work? Have you refined/improved it?

Thanks!
Reply all
Reply to author
Forward
0 new messages