gitdoc 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +31 -0
- data/TODO +6 -0
- data/VERSION +1 -1
- data/bin/gitdoc +39 -0
- data/default.sass +94 -0
- data/gitdoc/tasks.rb +11 -0
- data/gitdoc.rb +2 -0
- metadata +15 -9
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# GitDoc
|
2
|
+
|
3
|
+
GitDoc is another attempt at a tiny content system.
|
4
|
+
|
5
|
+
I mostly use it to share research notes with people I'm working with.
|
6
|
+
|
7
|
+
You don't actually need to use git with it.
|
8
|
+
|
9
|
+
Here's how you can use it to put some content on the internet:
|
10
|
+
|
11
|
+
mkdir resume
|
12
|
+
cd resume
|
13
|
+
gitdoc init
|
14
|
+
mate index.md
|
15
|
+
# then edit document
|
16
|
+
rake
|
17
|
+
# preview in browser
|
18
|
+
git init && git commit -m ''
|
19
|
+
heroku add
|
20
|
+
git push heroku master
|
21
|
+
|
22
|
+
My two primary goals with GitDoc are simplicity and stability.
|
23
|
+
|
24
|
+
Simplicity in the sense that the smallest GitDoc instance contains 4 files: `config.ru`, `Gemfile`, `Rakefile` and `index.md` and once you've filled `index.md` (and any other files you create) with your content the signal-to-noise ratio should be pretty high.
|
25
|
+
|
26
|
+
Stability in the sense that you should be able to come back to a GitDoc instance 15 months later, type `rake` and see the content without too much fiddling with technology.
|
27
|
+
|
28
|
+
There are literally hundreds of 'similar' projects to GitDoc. A couple that I like are:
|
29
|
+
|
30
|
+
* [Gollum](https://github.com/github/gollum) - If you don't mind waiting after you've committed your changes to see them rendered then this thing is pretty cool. Power's the GitHub wikis.
|
31
|
+
* [Brochure](https://github.com/sstephenson/brochure) - Supports partials and pages can be written in any [Tilt](https://github.com/rtomayko/tilt) based template language.
|
data/TODO
ADDED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.0
|
data/bin/gitdoc
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
version = File.read(File.dirname(__FILE__)+'/../VERSION')
|
4
|
+
|
5
|
+
unless ARGV == ['init']
|
6
|
+
puts "GitDoc version #{version}"
|
7
|
+
puts "Run with 'init' to make the current directory a GitDoc instance"
|
8
|
+
exit
|
9
|
+
end
|
10
|
+
|
11
|
+
if File.exists? 'config.ru'
|
12
|
+
abort "config.ru exists, is GitDoc already set up for this folder?"
|
13
|
+
end
|
14
|
+
|
15
|
+
config = <<-END
|
16
|
+
require 'gitdoc'
|
17
|
+
|
18
|
+
GitDoc!
|
19
|
+
END
|
20
|
+
|
21
|
+
rakefile = <<-END
|
22
|
+
require 'bundler/setup' unless $LOAD_PATH.detect { |p| p =~ /gitdoc$/ }
|
23
|
+
require 'gitdoc/tasks'
|
24
|
+
END
|
25
|
+
|
26
|
+
gemfile = <<-END
|
27
|
+
source :rubygems
|
28
|
+
gem 'gitdoc', '#{version}'
|
29
|
+
END
|
30
|
+
|
31
|
+
index = <<-END
|
32
|
+
Welcome to GitDoc
|
33
|
+
END
|
34
|
+
|
35
|
+
File.open('config.ru','w') { |f| f.write config }
|
36
|
+
File.open('Rakefile','w') { |f| f.write rakefile }
|
37
|
+
File.open('Gemfile','w') { |f| f.write gemfile }
|
38
|
+
|
39
|
+
system 'bundle install'
|
data/default.sass
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
*
|
2
|
+
font-family: Helvetica Neue
|
3
|
+
|
4
|
+
body, pre, code
|
5
|
+
font-size: 14px
|
6
|
+
line-height: 20px
|
7
|
+
color: #333
|
8
|
+
|
9
|
+
a
|
10
|
+
color: #333
|
11
|
+
text-decoration: underline
|
12
|
+
|
13
|
+
h1, h2, h3, p, ul, ol, pre
|
14
|
+
margin: 20px 0
|
15
|
+
|
16
|
+
h1,h2,h3
|
17
|
+
font-weight: bold
|
18
|
+
|
19
|
+
// draws a block to the side to make long documents easier to scan and to
|
20
|
+
// make it easier to recognise the heading level
|
21
|
+
@mixin heading-hint ( $width)
|
22
|
+
position: relative
|
23
|
+
&:before
|
24
|
+
content: ''
|
25
|
+
display: block
|
26
|
+
width: $width
|
27
|
+
height: 10px
|
28
|
+
background: #e8e8e8
|
29
|
+
position: absolute
|
30
|
+
left: -15px - $width
|
31
|
+
top: 7px
|
32
|
+
|
33
|
+
h1
|
34
|
+
font-size: 20px
|
35
|
+
@include heading-hint(30px)
|
36
|
+
|
37
|
+
h2
|
38
|
+
font-size: 18px
|
39
|
+
@include heading-hint(25px)
|
40
|
+
|
41
|
+
h3
|
42
|
+
font-size: 16px
|
43
|
+
@include heading-hint(20px)
|
44
|
+
|
45
|
+
em
|
46
|
+
font-style: italic
|
47
|
+
|
48
|
+
strong
|
49
|
+
font-weight: bold
|
50
|
+
|
51
|
+
// GitDoc doesn't really support more than two levels of list nesting
|
52
|
+
// If you have to do that you'll need to write your own styles
|
53
|
+
|
54
|
+
li
|
55
|
+
margin: 10px 0
|
56
|
+
|
57
|
+
li:before
|
58
|
+
float: left
|
59
|
+
margin-left: -44px
|
60
|
+
color: #666
|
61
|
+
width: 30px
|
62
|
+
text-align: right
|
63
|
+
|
64
|
+
ul li:before
|
65
|
+
content: "*"
|
66
|
+
margin-top: 5px
|
67
|
+
font-size: 20px
|
68
|
+
|
69
|
+
ul ul li:before
|
70
|
+
font-size: 15px
|
71
|
+
margin-top: 3px
|
72
|
+
margin-left: -45px
|
73
|
+
color: #999
|
74
|
+
|
75
|
+
ol > li
|
76
|
+
counter-increment: ol-li
|
77
|
+
ol li:before
|
78
|
+
content: counter(ol-li)
|
79
|
+
|
80
|
+
ol ol li
|
81
|
+
counter-increment: ol-ol-li
|
82
|
+
ol ol li:before
|
83
|
+
content: counter(ol-ol-li)
|
84
|
+
|
85
|
+
ol ol li:before
|
86
|
+
font-size: 13px
|
87
|
+
color: #999
|
88
|
+
|
89
|
+
ul ul, ol ol
|
90
|
+
margin: 0
|
91
|
+
|
92
|
+
#doc
|
93
|
+
width: 600px
|
94
|
+
margin: 40px auto
|
data/gitdoc/tasks.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
task :server do
|
2
|
+
exec 'unicorn -r bundler/setup'
|
3
|
+
end
|
4
|
+
|
5
|
+
task :dev do
|
6
|
+
unless $LOAD_PATH.last =~ /gitdoc$/
|
7
|
+
abort "Run rake with the path to GitDocs's source to use dev mode\n"+
|
8
|
+
"Eg. rake -I ~/Projects/gitdoc dev"
|
9
|
+
end
|
10
|
+
exec "shotgun -I #{$LOAD_PATH.last}"
|
11
|
+
end
|
data/gitdoc.rb
CHANGED
@@ -10,6 +10,7 @@ def GitDoc! title = nil, opts = {}
|
|
10
10
|
set :styles, dir + '/styles.sass'
|
11
11
|
set :title, title
|
12
12
|
set :header, opts[:header]
|
13
|
+
set :default_styles, opts[:default_styles] != false
|
13
14
|
run Sinatra::Application
|
14
15
|
end
|
15
16
|
|
@@ -89,6 +90,7 @@ get '/.css' do
|
|
89
90
|
content_type :css
|
90
91
|
styles = sass(:reset)
|
91
92
|
styles += File.read(settings.root + '/highlight.css')
|
93
|
+
styles += sass(:default) if settings.default_styles?
|
92
94
|
styles += sass(File.read(settings.styles)) if File.exist? settings.styles
|
93
95
|
styles
|
94
96
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
|
-
-
|
7
|
+
- 3
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
version:
|
10
|
+
version: 3.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Myles Byrne
|
@@ -15,8 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
19
|
-
default_executable:
|
18
|
+
date: 2011-01-20 00:00:00 +11:00
|
19
|
+
default_executable: gitdoc
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: rdiscount
|
@@ -67,18 +67,24 @@ dependencies:
|
|
67
67
|
version_requirements: *id003
|
68
68
|
description:
|
69
69
|
email: myles@myles.id.au
|
70
|
-
executables:
|
71
|
-
|
70
|
+
executables:
|
71
|
+
- gitdoc
|
72
72
|
extensions: []
|
73
73
|
|
74
|
-
extra_rdoc_files:
|
75
|
-
|
74
|
+
extra_rdoc_files:
|
75
|
+
- README.md
|
76
|
+
- TODO
|
76
77
|
files:
|
77
78
|
- .gitignore
|
79
|
+
- README.md
|
78
80
|
- Rakefile
|
81
|
+
- TODO
|
79
82
|
- VERSION
|
83
|
+
- bin/gitdoc
|
84
|
+
- default.sass
|
80
85
|
- doc.haml
|
81
86
|
- gitdoc.rb
|
87
|
+
- gitdoc/tasks.rb
|
82
88
|
- highlight.css
|
83
89
|
- reset.sass
|
84
90
|
has_rdoc: true
|