dowl 0.6 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,9 @@
1
1
  require 'rubygems'
2
2
  require 'erb'
3
- require 'rdf'
4
3
  require 'fileutils'
5
4
  require 'linkeddata'
5
+ require 'redcarpet'
6
+
6
7
  require 'dowl/util'
7
8
  require 'dowl/schema'
8
9
  require 'dowl/class'
@@ -7,6 +7,11 @@ module DOWL
7
7
  @schema = schema
8
8
  if schema.introduction
9
9
  @introduction = File.read(schema.introduction)
10
+ if schema.introduction.end_with?(".md")
11
+ renderer = Redcarpet::Render::HTML.new({})
12
+ markdown = Redcarpet::Markdown.new(renderer, {})
13
+ @introduction = markdown.render(@introduction)
14
+ end
10
15
  end
11
16
  end
12
17
 
@@ -23,11 +23,13 @@ module DOWL
23
23
  model.load!
24
24
 
25
25
  dir = File.dirname(file)
26
- introduction = File.join(dir, "introduction.html")
27
- if File.exists?(introduction)
28
- return Schema.new(model, introduction)
29
- end
30
- return Schema.new(model)
26
+ if File.exists?(File.join(dir, "introduction.html"))
27
+ return Schema.new(model, File.join(dir, "introduction.html"))
28
+ elsif File.exists?( File.join(dir, "introduction.md"))
29
+ return Schema.new(model, File.join(dir, "introduction.md"))
30
+ else
31
+ return Schema.new(model)
32
+ end
31
33
  end
32
34
 
33
35
  def init()
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dowl
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: '0.7'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-13 00:00:00.000000000 Z
12
+ date: 2013-06-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mocha
@@ -43,7 +43,23 @@ dependencies:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '1.0'
46
- description: dowl OWL/RDF doc generator
46
+ - !ruby/object:Gem::Dependency
47
+ name: redcarpet
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: 2.2.2
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.2.2
62
+ description: Generate simple HTML documentation for subset of RDFS/OWL
47
63
  email: leigh@ldodds.com
48
64
  executables:
49
65
  - dowl