Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

First pass at text with basic info and links

  • Loading branch information...
commit 65199e57600b12631945705247149db86a4a734c 1 parent dcdf834
Michael authored

Showing 1 changed file with 51 additions and 0 deletions. Show diff stats Hide diff stats

  1. +51 0 README
51 README
... ... @@ -0,0 +1,51 @@
  1 +Emphasis
  2 +========
  3 +
  4 +Emphasis provides dynamic paragraph-specific anchor links and the ability to highlight text in a document,
  5 +all of which is made available in the URL hash so it can be emailed, bookmarked, or shared.
  6 +
  7 +For more information and examples please go to this blog post:
  8 +
  9 +http://open.blogs.nytimes.com/2011/01/10/emphasis-update-and-source/
  10 +
  11 +Configuration
  12 +-------------
  13 +
  14 +The main configuration element si specifiying what paragraph elements are in scope and are not. To this end
  15 +we specify the elements on or near Line 54:
  16 +
  17 + this.paraSelctors = $$(
  18 + ".entry p:not(p[class]):not(:empty)",
  19 + ".post p:not(p[class]):not(:empty)",
  20 + "article p:not(p[class]):not(:empty)"
  21 + );
  22 +
  23 +This covers a lot of common markup in many sites and blog. However this could be configured for your specific site.
  24 +
  25 +Example: If all you P tags reside in DIV tags with the "entry" classname, then this would be sufficient:
  26 +
  27 + this.paraSelctors = $$(".entry p:not(p[class]):not(:empty)");
  28 +
  29 +Over at The New York Times, we use the following:
  30 +
  31 + this.paraSelctors = $$('.articleBody p:not(p[class]):not(:empty)', '#articleBody p:not(p[class]):not(:empty)', '#content div.entry-content p:not(p[class]):not(:empty)');
  32 +
  33 +Dependencies
  34 +------------
  35 +Currently this requires that you use the PrototypeJS library - tested with version 1.6.
  36 +
  37 +http://prototypejs.org/download
  38 +
  39 +Thanks
  40 +------
  41 +
  42 +Levenshtein calculation in the script is based on some nice code by Andrew Hedges
  43 +http://andrew.hedges.name/experiments/levenshtein/
  44 +
  45 +To-Do
  46 +-----
  47 +
  48 + - Remove framework dependency (PrototypeJS)
  49 + - Further work on UI for highlighting with focus on simplicity
  50 + - Social
  51 + - Support for touch-based devices

0 comments on commit 65199e5

Please sign in to comment.
Something went wrong with that request. Please try again.