File: petrodoc

package info (click to toggle)
sputnik 12.06.27-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,900 kB
  • sloc: javascript: 6,955; sh: 762; python: 94; makefile: 42
file content (89 lines) | stat: -rw-r--r-- 2,538 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package    = 'Versium'
versions   = {
   {'8.06.15', 'June 15, 2008', 'the initial release'},
}
summary    = 'Diff functions'
maintainer = 'Yuri Takhteyev (yuri@freewisdom.org)'

detailed   = [[
     This module provides a small collection of functions for diffing text.
]]

license    = 'MIT/X11'

homepage   = 'http://sputnik.freewisdom.org/lib/diff/'
favicon    = 'http://media.freewisdom.org/etc/sputnik-icon.png'
download   = 'http://sputnik.freewisdom.org/files/diff-$version.tar.gz'
--download   = "/tmp/versium-$version.tar.gz"
push       = "scp %s yuri@web10.webfaction.com:~/webapps/static/files/"
--push       = "cp %s /tmp/"
logo       = 'diff.png'
keywords   = 'lua, diff'
rss        = homepage.."releases.rss"
--------------------------------------------------------------------------------

dependencies = [[
]]

Installation = [[
  The Diff library consists of a single file (diff.lua), plus a test script
  (tests/basic.lua).  Just put the file somewhere in your Lua path.
  Here is a list of recent releases:

  <ul>
  $do_versions[=[<li><a href="$url">$package-$version</a> - $comment ($date) </li> ]=]
  </ul>

  You can also install it using LuaRocks with

    luarocks install diff

  or:

    luarocks --from=http://sputnik.freewisdom.org/rocks/earth install diff

]]

Using = [[

A simple diff of two strings:

    > require("diff")
    > for _, token in ipairs(diff.diff("This is a test", "This was a test!")) do 
    >> print(token[1], token[2])
    >> end
    This    same
    is      out
    was     in
            same
    a       same
            same
    test    out
    test!   in
            same

That is, diff.diff(old, new) returns a table of pairs, each consisting of a string
and it's status: "same" (the string is present in both), "in" (the string appeared
in <i>new</i>, or "out" (the string was present in <i>old</i> but was removed).

Alternatively, you can just generate an HTML for this diff:

    > = diff.diff("This is a test", "This was a test!"):to_html()
    This <del>is</del><ins>was</ins> a <del>test</del><ins>test!</ins>
   
]]

TOC = {
   { "Overview",     "<p>"..detailed.."</p>" },
   { "Installation", markdown(Installation) },
   --{ "Using Diff", markdown(include("doc/howto.md")) },
   { "Contact",      "Please contact Yuri Takhteyev (yuri -at- freewisdom.org) with any questions."},
   { "LuaDoc",       make_luadoc{"diff.lua"} },
   { "License",      markdown(include("LICENSE.txt")) }


}
-------------------------------------------------------------------------------