Git Product home page Git Product logo

webgen-tipue_search-bundle's Introduction

Tipue Search integration for webgen

Tipue Search is a site search engine which uses jQuery. It provides three modes of operation:

  • live mode where one supplies a list of URLs which are then searched (not very fast, needs a web server),

  • json mode where the search data is loaded via an Ajax request (still needs a web server) and

  • static mode where the search data is loaded directly by the HTML file (fast, no web server needed).

Usage

Provided Paths

This webgen extension bundle contains all needed Tipue Search files except jQuery. Remember that one needs to load the jQuery library before Tipue Search!

The Tipue Search files are provided as passive paths at the following locations:

  • /javascriptss/tipue_search/tipuesearch.min.js - the main Tipue Search javascript file

  • /javascripts/tipue_search/tipuesearch_set.js - defines stop and replacement words as well as word stems

  • /stylesheets/tipue_search/tipuesearch.css - the CSS file that includes the necessary styles

  • /stylesheets/tipue_search/img/loader.gif, /stylesheets/tipue_search/img/link.png, /stylesheets/tipue_search/img/search.gif, /stylesheets/tipue_search/img/expand.png` - images needed by the CSS file

Additionally, the following paths are provided:

  • /templates/tipue_search.template - provides the blocks for rendering the tag and the path handler contents

Easy Usage

Tipue Search can easily be integrated into a webgen website by using the included tipue_search tag:

{tipue_search: {path: data.js, options: {mode: static},
                entries: {alcn: /**/*.html}}}

The option options can be used to set any Tipue Search option and the option nodes specifies the nodes that should appear in the search index (more information on this below).

If this tag occurs on a page, the needed nodes are automatically linked to it and a new node representing the search index at the specified path is created.

Manual Usage

It is also possible to craft the needed HTML fragments manually and just use this extension for providing the necessary files. If you want to use it this way, have a look at the Tipue Search documentation

A search index node can be created by the path handler tipue_search which uses paths in Webgen Page Format. Since no path extension is registered for it, you need to explicitly specify the handler meta information for a path that should be handled by the tipue_search handler via a meta information path.

The following meta information on a tipue search node should be set:

  • entries (mandatory): The node finder option set specifying the nodes that should be used for the search index. It is assumed that the nodes are valid HTML files.

  • mode (mandatory): The Tipue Search mode (static, live or json).

  • content_css: A CSS query for selecting the elements that contain the text that should be indexed. Default is body.

The template which defines the content of a search index node can be customized by adding a content block named 'tipue_search' to the path.

Installation

The easiest way to install this extension bundle is by installing the corresponding Rubygem:

gem install webgen-tipue_search-bundle

If you don't use Rubygems, copy the folder lib/webgen/bundle/tipue_search into your ext directory.

After that you just need to tell webgen to use this extension bundle by adding the following line to your ext/init.rb file:

load("tipue_search")

Copyright and license

Copyright (c) 2013 Thomas Leitner under the MIT License (see LICENSE)


The included Tipue Search files are also licensed under the MIT (see LICENSE-TIPUESEARCH).

webgen-tipue_search-bundle's People

Contributors

gettalong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.