documentinator 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/Rakefile +13 -0
- data/VERSION +1 -0
- data/doc.haml +8 -0
- data/documentinator.rb +33 -0
- data/reset.sass +62 -0
- metadata +72 -0
data/.gitignore
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
begin
|
2
|
+
require 'jeweler'
|
3
|
+
Jeweler::Tasks.new do |gs|
|
4
|
+
gs.name = "documentinator"
|
5
|
+
gs.homepage = "http://github.com/quackingduck/documentinator"
|
6
|
+
gs.summary = "A light-weight web app for serving up a folder of markdown files"
|
7
|
+
gs.email = "myles@myles.id.au"
|
8
|
+
gs.authors = ["Myles Byrne"]
|
9
|
+
end
|
10
|
+
Jeweler::GemcutterTasks.new
|
11
|
+
rescue LoadError
|
12
|
+
puts "Install jeweler to build gem"
|
13
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
data/doc.haml
ADDED
data/documentinator.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'sinatra'
|
2
|
+
require 'rdiscount'
|
3
|
+
|
4
|
+
def Documentinator!
|
5
|
+
dir = File.dirname(File.expand_path(caller.first.split(':').first))
|
6
|
+
set :dir, dir
|
7
|
+
set :styles, dir + '/styles.sass'
|
8
|
+
run Sinatra::Application
|
9
|
+
end
|
10
|
+
|
11
|
+
set :haml, {:format => :html5}
|
12
|
+
set :views, lambda { root }
|
13
|
+
|
14
|
+
helpers do
|
15
|
+
|
16
|
+
def md source
|
17
|
+
RDiscount.new(source).to_html.
|
18
|
+
# uses newline entity in pre tags
|
19
|
+
gsub(/<code>.*?<\/code>/m) do |match|
|
20
|
+
match.gsub(/\n/m,"
")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def styles
|
25
|
+
sass File.read(settings.styles) if File.exist? settings.styles
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
get '/' do
|
31
|
+
@doc = md File.read(settings.dir + '/index.md')
|
32
|
+
haml :doc
|
33
|
+
end
|
data/reset.sass
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
// latest at: http://github.com/quackingduck/sasslib/raw/master/reset.sass
|
2
|
+
|
3
|
+
a, abbr, acronym, address, applet,
|
4
|
+
b, big, blockquote, body, button,
|
5
|
+
caption, center, cite, code,
|
6
|
+
dd, del, dfn, div, dl, dt,
|
7
|
+
em,
|
8
|
+
fieldset, font, form,
|
9
|
+
h1, h2, h3, h4, h5, h6, hr, html,
|
10
|
+
i, iframe, img, input, ins,
|
11
|
+
kbd,
|
12
|
+
label, legend, li,
|
13
|
+
object, ol,
|
14
|
+
p, pre,
|
15
|
+
q,
|
16
|
+
s,
|
17
|
+
samp, small, span, strike, strong, sub, sup,
|
18
|
+
table, textarea, tbody, td, tfoot, th, thead, tr, tt,
|
19
|
+
u, ul,
|
20
|
+
var
|
21
|
+
:margin 0
|
22
|
+
:padding 0
|
23
|
+
:border 0
|
24
|
+
:outline 0
|
25
|
+
:font-size 100%
|
26
|
+
:vertical-align baseline
|
27
|
+
:background transparent
|
28
|
+
:text-align left
|
29
|
+
:font-weight normal
|
30
|
+
|
31
|
+
body, input, button, textarea
|
32
|
+
:line-height 1
|
33
|
+
:font-family sans-serif
|
34
|
+
|
35
|
+
ol, ul
|
36
|
+
:list-style none
|
37
|
+
|
38
|
+
blockquote, q
|
39
|
+
:quotes none
|
40
|
+
|
41
|
+
*:focus
|
42
|
+
:outline 0
|
43
|
+
|
44
|
+
ins
|
45
|
+
:text-decoration none
|
46
|
+
|
47
|
+
del
|
48
|
+
:text-decoration line-through
|
49
|
+
|
50
|
+
table
|
51
|
+
:border-collapse collapse
|
52
|
+
:border-spacing 0
|
53
|
+
|
54
|
+
input, textarea
|
55
|
+
:border 1px solid #ccc
|
56
|
+
|
57
|
+
button
|
58
|
+
:background #ccc
|
59
|
+
|
60
|
+
hr
|
61
|
+
:height 1px
|
62
|
+
:background #ccc
|
metadata
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: documentinator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Myles Byrne
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-06-22 00:00:00 -05:00
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description:
|
23
|
+
email: myles@myles.id.au
|
24
|
+
executables: []
|
25
|
+
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files: []
|
29
|
+
|
30
|
+
files:
|
31
|
+
- .gitignore
|
32
|
+
- Rakefile
|
33
|
+
- VERSION
|
34
|
+
- doc.haml
|
35
|
+
- documentinator.rb
|
36
|
+
- reset.sass
|
37
|
+
has_rdoc: true
|
38
|
+
homepage: http://github.com/quackingduck/documentinator
|
39
|
+
licenses: []
|
40
|
+
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options:
|
43
|
+
- --charset=UTF-8
|
44
|
+
require_paths:
|
45
|
+
- lib
|
46
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
hash: 3
|
52
|
+
segments:
|
53
|
+
- 0
|
54
|
+
version: "0"
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
61
|
+
segments:
|
62
|
+
- 0
|
63
|
+
version: "0"
|
64
|
+
requirements: []
|
65
|
+
|
66
|
+
rubyforge_project:
|
67
|
+
rubygems_version: 1.3.7
|
68
|
+
signing_key:
|
69
|
+
specification_version: 3
|
70
|
+
summary: A light-weight web app for serving up a folder of markdown files
|
71
|
+
test_files: []
|
72
|
+
|