qdoc 0.0.112 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/qdoc +9 -1
- data/lib/qdoc.rb +10 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bef42c2417f0507e1bc986f0933a36bbd39f1e6c
|
4
|
+
data.tar.gz: 902369433c0e780ba7e4c0f82d76fc6b390dce79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 253eefcf9c0663888913acd3ab8b678762a11248cec506c5a77d85749d1a1119c47e0c92b7c73a305c2fc7a5c25da74ae63f5e02c6a0d261c5cbfef871403c4c
|
7
|
+
data.tar.gz: cad9145fbe7aa8274477e193ca59581005596cb3b1cdd2ff1757437bc69eeb3fc759c523c002c5004285ec3c4e1d43380f539d41b9899079ce908a2cf700cf5f
|
data/bin/qdoc
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby --
|
2
2
|
require 'qdoc'
|
3
3
|
|
4
|
-
|
4
|
+
if ( /-h/.match(ARGV.join(" ").downcase) )
|
5
|
+
puts "Usage qdoc [-cdn]"
|
6
|
+
puts " -cdn causes qdoc to utilize CDN-based Bootstrap library instead of copying one locally"
|
7
|
+
exit(0)
|
8
|
+
end
|
9
|
+
|
10
|
+
bootstrap = ( /-cdn/.match(ARGV.join(" ").downcase) ? :cdn : :local )
|
11
|
+
|
12
|
+
QDoc.new(bootstrap: bootstrap).run
|
data/lib/qdoc.rb
CHANGED
@@ -2,15 +2,17 @@
|
|
2
2
|
require 'redcarpet'
|
3
3
|
require 'fileutils'
|
4
4
|
require 'nokogiri'
|
5
|
-
|
5
|
+
|
6
|
+
BOOTSTRAP_CDN = '<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">'
|
6
7
|
|
7
8
|
class QDoc
|
8
9
|
|
9
10
|
# Initializes QDoc
|
10
11
|
# [options[:output_directory] set the directory to be created for documentation
|
11
12
|
# [options#index_content] set the static index page message
|
13
|
+
# [options#bootstratp] :local (default) copies the local file, otherwise CDN stylesheet is used
|
12
14
|
def initialize( options = {} )
|
13
|
-
defaults = { output_directory: "doc", index_content: "Choose from the list.", target_extensions: %w(md rc html) }
|
15
|
+
defaults = { output_directory: "doc", index_content: "Choose from the list.", target_extensions: %w(md rc html), bootstrap: :local }
|
14
16
|
options = defaults.merge options
|
15
17
|
@out_dir = options[:output_directory]
|
16
18
|
|
@@ -21,6 +23,8 @@ class QDoc
|
|
21
23
|
@documents = Array.new
|
22
24
|
@locations = Array.new
|
23
25
|
@redcarpet = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new( :with_toc_data => true), :autolink => true, :space_after_headers => false, :no_intra_emphasis => true, :tables => true)
|
26
|
+
|
27
|
+
@bootstrap_local = (options[:bootstrap] == :local)
|
24
28
|
end
|
25
29
|
|
26
30
|
# Causes QDoc to search the current directory and tree, and parse found files
|
@@ -85,16 +89,17 @@ class QDoc
|
|
85
89
|
end
|
86
90
|
|
87
91
|
def copy_bootstrap
|
88
|
-
FileUtils.cp( File.dirname(__FILE__) + "/bootstrap.min.css", "#{@out_dir}/bootstrap.min.css" )
|
92
|
+
FileUtils.cp( File.dirname(__FILE__) + "/bootstrap.min.css", "#{@out_dir}/bootstrap.min.css" ) if @bootstrap_local
|
89
93
|
end
|
90
94
|
|
91
|
-
def create_page( content, title )
|
95
|
+
def create_page( content, title, bootstrap = :local )
|
92
96
|
"<!DOCTYPE html>
|
93
97
|
<html>
|
94
98
|
<head>
|
95
99
|
<title>" + title + "</title>
|
96
100
|
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
|
97
|
-
|
101
|
+
" + ( @bootstrap_local ? "
|
102
|
+
<link href='bootstrap.min.css' rel='stylesheet'>" : BOOTSTRAP_CDN ) + "
|
98
103
|
<style>
|
99
104
|
.bs-sidebar .nav > li > a {
|
100
105
|
padding-top: 0px;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Sereno
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redcarpet
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
83
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.2
|
84
|
+
rubygems_version: 2.5.2
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: A quick doc converter
|