dokkit-model-simpledocument 0.1.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/CHANGES +7 -0
- data/INSTALL +18 -0
- data/README +2 -0
- data/Rakefile +130 -0
- data/lib/doc/layouts/simpledocument.html +8 -0
- data/lib/doc/layouts/simpledocument.tex +17 -0
- data/lib/doc/layouts/simpledocument.text +1 -0
- data/lib/model/README +119 -0
- data/lib/model/Rakefile +35 -0
- data/lib/model/doc/config/model.yaml +14 -0
- data/lib/model/doc/config/simpledocument.yaml +17 -0
- data/lib/model/doc/pages/simpledocument.dpl +123 -0
- data/lib/model/doc/res/tex/deplate.sty +46 -0
- data/lib/scripts/simpledocument.rb +16 -0
- data/lib/tasks/builtin/builtin.rf +3 -0
- data/lib/tasks/rakefile.rf +2 -0
- data/lib/tests/test_structure.rb +49 -0
- metadata +83 -0
data/CHANGES
ADDED
data/INSTALL
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
= Installation notes
|
2
|
+
|
3
|
+
* If you have installed this model using rubygems then you are done.
|
4
|
+
|
5
|
+
* If you have downloaded the file <modelname>.tar.gz then, in order to
|
6
|
+
install the model, you need to put its content in
|
7
|
+
$HOME/.dokkit/models/<modelname> or simply execute:
|
8
|
+
|
9
|
+
$ tar xvzf <modelname>.tar.gz -C $HOME/.dokkit/models
|
10
|
+
|
11
|
+
* To check if the model has been successfully installed execute:
|
12
|
+
|
13
|
+
$ dokkit --list
|
14
|
+
|
15
|
+
and see if the desidered model is in the list.
|
16
|
+
|
17
|
+
* For more information about dokkit models, please check dokkit website
|
18
|
+
at http://dokkit.rubyforge.org/
|
data/README
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
begin
|
2
|
+
require 'rubygems'
|
3
|
+
rescue LoadError
|
4
|
+
nil # optional
|
5
|
+
end
|
6
|
+
|
7
|
+
$:.unshift('lib')
|
8
|
+
require 'rake/gempackagetask'
|
9
|
+
require 'rake/contrib/rubyforgepublisher'
|
10
|
+
require 'rake/clean'
|
11
|
+
require 'rake/testtask'
|
12
|
+
require 'rake/rdoctask'
|
13
|
+
require 'dokkit/render_task_factory'
|
14
|
+
|
15
|
+
PKG_NAME = "dokkit-model-simpledocument"
|
16
|
+
PKG_VERSION = "0.1.0"
|
17
|
+
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
18
|
+
PKG_FILES = FileList.new( ['lib/**/*', 'model/**/*', '[A-Z]*'] ) do |fl|
|
19
|
+
fl.exclude(/TEMPLATE\./).to_a
|
20
|
+
end
|
21
|
+
|
22
|
+
task :default => [:gem]
|
23
|
+
|
24
|
+
# Create a task that will package the dokkit model into distributable
|
25
|
+
# tar, zip and gem files.
|
26
|
+
spec = Gem::Specification.new do |s|
|
27
|
+
# Basic information.
|
28
|
+
s.name = PKG_NAME
|
29
|
+
s.version = PKG_VERSION
|
30
|
+
s.summary = "dokkit simple document model"
|
31
|
+
s.description = <<-EOF
|
32
|
+
This is a simple document model for dokkit. You can use this model as a base to create simple documents
|
33
|
+
like tutorials, howtos, guides, technical reports.
|
34
|
+
EOF
|
35
|
+
|
36
|
+
s.files = PKG_FILES.to_a
|
37
|
+
s.require_path = 'lib'
|
38
|
+
s.autorequire = 'dokkit'
|
39
|
+
|
40
|
+
s.add_dependency('dokkit', '>= 0.2.0')
|
41
|
+
|
42
|
+
#### Documentation and testing.
|
43
|
+
|
44
|
+
#### Author and project details.
|
45
|
+
|
46
|
+
s.author = "Andrea Fazzi"
|
47
|
+
s.email = "andrea.fazzi@alca.le.it"
|
48
|
+
s.homepage = "http://dokkit.rubyforge.org/"
|
49
|
+
s.rubyforge_project = "dokkit"
|
50
|
+
end
|
51
|
+
|
52
|
+
desc "Build Gem"
|
53
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
54
|
+
pkg.need_zip = true
|
55
|
+
pkg.need_tar = true
|
56
|
+
end
|
57
|
+
|
58
|
+
# Support Tasks ------------------------------------------------------
|
59
|
+
|
60
|
+
desc "Look for TODO and FIXME tags in the code"
|
61
|
+
task :todo do
|
62
|
+
Pathname.new(File.dirname(__FILE__)).egrep(/#.*(FIXME|TODO|TBD|DEPRECATED)/) do |match|
|
63
|
+
puts match
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
task :release => [:verify_env_vars, :release_files, :publish_doc, :publish_news]
|
68
|
+
|
69
|
+
task :verify_env_vars do
|
70
|
+
raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER']
|
71
|
+
raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD']
|
72
|
+
end
|
73
|
+
|
74
|
+
desc "Release files on RubyForge"
|
75
|
+
task :release_files => [:gem] do
|
76
|
+
require 'meta_project'
|
77
|
+
require 'rake/contrib/xforge'
|
78
|
+
release_files = FileList[
|
79
|
+
"pkg/#{PKG_FILE_NAME}.gem"
|
80
|
+
]
|
81
|
+
|
82
|
+
Rake::XForge::Release.new(MetaProject::Project::XForge::RubyForge.new('dokkit')) do |release|
|
83
|
+
# Never hardcode user name and password in the Rakefile!
|
84
|
+
release.user_name = ENV['RUBYFORGE_USER']
|
85
|
+
release.password = ENV['RUBYFORGE_PASSWORD']
|
86
|
+
release.files = release_files.to_a
|
87
|
+
release.release_name = "#{PKG_NAME} #{PKG_VERSION}"
|
88
|
+
# The rest of the options are defaults (among others, release_notes and release_changes, parsed from CHANGES)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
desc "Publish news on RubyForge"
|
93
|
+
task :publish_news => [:gem] do
|
94
|
+
require 'rake/meta_project'
|
95
|
+
require 'rake/contrib/xforge'
|
96
|
+
release_files = FileList[
|
97
|
+
"pkg/#{PKG_FILE_NAME}.gem"
|
98
|
+
]
|
99
|
+
|
100
|
+
Rake::XForge::NewsPublisher.new(MetaProject::Project::XForge::RubyForge.new('dokkit')) do |news|
|
101
|
+
# Never hardcode user name and password in the Rakefile!
|
102
|
+
news.user_name = ENV['RUBYFORGE_USER']
|
103
|
+
news.password = ENV['RUBYFORGE_PASSWORD']
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
desc "Delete output and intermediate files"
|
108
|
+
task :clean_output do
|
109
|
+
OUTPUT_FL.each { |file| sh "rm -rf #{file}"}
|
110
|
+
end
|
111
|
+
|
112
|
+
factory = Dokkit::RenderTaskFactory.instance
|
113
|
+
factory.create_render_text(:render_readme) do |task|
|
114
|
+
task.output_dir = 'lib/model/'
|
115
|
+
task.layout_dir = 'lib/doc/layouts'
|
116
|
+
task.config_dir = 'lib/model/doc/config'
|
117
|
+
task.pages.dir = 'lib/model/doc/pages'
|
118
|
+
end
|
119
|
+
|
120
|
+
desc "Generate README file from a deplate source"
|
121
|
+
task :readme => [:render_readme] do
|
122
|
+
File.move('lib/model/simpledocument.text', 'lib/model/README')
|
123
|
+
end
|
124
|
+
|
125
|
+
desc "Tag the working tree and copy it to dokkit-models/simpledocument/tags/REL_X_Y_Z on RubyForge"
|
126
|
+
task :tag do
|
127
|
+
reltag = "REL_#{PKG_VERSION.gsub(/\./, '_')}"
|
128
|
+
puts "Tagging current head with [#{reltag}]"
|
129
|
+
sh "svn copy ./ svn+ssh://#{ENV['RUBYFORGE_USER']}@rubyforge.org/var/svn/dokkit/dokkit-models/simpledocument/tags/#{reltag}/ -m \"tag #{reltag}\"" if ENV['RUBYFORGE_USER']
|
130
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
\documentclass[a4paper,12pt]{article}
|
2
|
+
|
3
|
+
\usepackage{hyperref}
|
4
|
+
\usepackage{color}
|
5
|
+
\usepackage{<%= relative('/deplate') %>}
|
6
|
+
|
7
|
+
\title{<%= @config['document']['title'] %>}
|
8
|
+
\author{<%= @config['document']['author'] %>}
|
9
|
+
|
10
|
+
\begin{document}
|
11
|
+
|
12
|
+
\maketitle
|
13
|
+
\clearpage
|
14
|
+
|
15
|
+
<%= @content_for_layout %>
|
16
|
+
|
17
|
+
\end{document}
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= @content_for_layout %>
|
data/lib/model/README
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
|
2
|
+
Table of Contents
|
3
|
+
=================
|
4
|
+
|
5
|
+
1 Description of the model
|
6
|
+
2 Edit and render your document
|
7
|
+
2.1 Render a pdf document
|
8
|
+
3 Rendering the modified parts of the document and cleaning up
|
9
|
+
4 How to get other dokkit models
|
10
|
+
5 WHAT'S NEXT?
|
11
|
+
|
12
|
+
|
13
|
+
1 Description of the model
|
14
|
+
==========================
|
15
|
+
|
16
|
+
This is a simple document model for dokkit. You can use this model
|
17
|
+
as a base to create simple documents like tutorials, howtos, technical
|
18
|
+
reports, etc.
|
19
|
+
|
20
|
+
|
21
|
+
2 Edit and render your document
|
22
|
+
===============================
|
23
|
+
|
24
|
+
To edit the content of the document simply edit doc/pages/simpledocument.dpl
|
25
|
+
(this file) or create a new file with dpl extension in doc/pages directory.
|
26
|
+
|
27
|
+
To get further information about the wiki syntax to use please check
|
28
|
+
deplate[1] homepage.
|
29
|
+
|
30
|
+
To render this document in html, open a terminal and type:
|
31
|
+
|
32
|
+
$ dokkit
|
33
|
+
|
34
|
+
from the top-level directory or from any subdirectory contained in
|
35
|
+
it.
|
36
|
+
|
37
|
+
To render this document in latex format, type:
|
38
|
+
|
39
|
+
$ dokkit render_tex
|
40
|
+
|
41
|
+
To render this document in plain text format, type:
|
42
|
+
|
43
|
+
$ dokkit render_text
|
44
|
+
|
45
|
+
In any case, you should get the output
|
46
|
+
|
47
|
+
* in the html directory for the html generated output
|
48
|
+
* in the tex directory for the tex generated output
|
49
|
+
* in the text directory for the plain text generated output
|
50
|
+
|
51
|
+
|
52
|
+
2.1 Render a pdf document
|
53
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~
|
54
|
+
|
55
|
+
If a latex distribution is present on your system then the command:
|
56
|
+
|
57
|
+
$ dokkit render_pdf
|
58
|
+
|
59
|
+
will try to generate a pdf file for your document.
|
60
|
+
|
61
|
+
If you are an ubuntu/debian user then you can obtain a complete latex
|
62
|
+
distribution running the command:
|
63
|
+
|
64
|
+
$ sudo apt-get install texlive
|
65
|
+
|
66
|
+
|
67
|
+
3 Rendering the modified parts of the document and cleaning up
|
68
|
+
==============================================================
|
69
|
+
|
70
|
+
Once you have rendered the document, running the dokkit command again
|
71
|
+
will appear to do nothing, because only changed resources are re-rendered.
|
72
|
+
To clean the output and start over run:
|
73
|
+
|
74
|
+
$ dokkit clobber
|
75
|
+
|
76
|
+
Note that if you modify any part of the document then you must re-run
|
77
|
+
dokkit command in order to apply changes and to re-generate the desidered
|
78
|
+
output.
|
79
|
+
|
80
|
+
So, once you have modified your document, run:
|
81
|
+
|
82
|
+
$ dokkit render_<xxx>
|
83
|
+
|
84
|
+
Only the modified resources will be transformed.
|
85
|
+
|
86
|
+
|
87
|
+
4 How to get other dokkit models
|
88
|
+
================================
|
89
|
+
|
90
|
+
To search for other document models open a terminal and type:
|
91
|
+
|
92
|
+
$ gem list dokkit-model
|
93
|
+
|
94
|
+
To get a particular model named <model_name> run:
|
95
|
+
|
96
|
+
$ gem install dokkit-model-<model_name>
|
97
|
+
|
98
|
+
or check http://rubyforge.org/projects/dokkit/.[2]
|
99
|
+
|
100
|
+
|
101
|
+
5 WHAT'S NEXT?
|
102
|
+
==============
|
103
|
+
|
104
|
+
* See what else you can do by typing:
|
105
|
+
|
106
|
+
$ dokkit --tasks
|
107
|
+
EOB
|
108
|
+
|
109
|
+
- Modify the configuration of the document by editing
|
110
|
+
''doc/config/simpledocument.yaml''.
|
111
|
+
|
112
|
+
- Override the default layout creating in ''doc/layouts'' a custom
|
113
|
+
layout with the same name of your document.
|
114
|
+
|
115
|
+
For further information about ''dokkit'' see http://dokkit.rubyforge.org/.
|
116
|
+
|
117
|
+
|
118
|
+
[1] http://deplate.sf.net/deplate.html
|
119
|
+
[2] http://rubyforge.org/projects/dokkit/.
|
data/lib/model/Rakefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#
|
2
|
+
# File 'Rakefile' created on 09 ott 2007 at 16:06:57.
|
3
|
+
#
|
4
|
+
# See 'dokkit.rb' or +LICENSE+ for licence information.
|
5
|
+
#
|
6
|
+
# (C) 2006, 2007 Andrea Fazzi <andrea.fazzi@alca.le.it> (and contributors).
|
7
|
+
#
|
8
|
+
# Rakefile for simpledocument project model
|
9
|
+
|
10
|
+
require 'dokkit'
|
11
|
+
require 'dokkit/app'
|
12
|
+
require 'dokkit/render_task_factory'
|
13
|
+
|
14
|
+
PDFLATEX = 'pdflatex'
|
15
|
+
|
16
|
+
factory = Dokkit::RenderTaskFactory.instance
|
17
|
+
|
18
|
+
render_html = factory.create_render_html
|
19
|
+
render_tex = factory.create_render_tex
|
20
|
+
render_text = factory.create_render_text
|
21
|
+
|
22
|
+
# Still experimental! The task below must be constructed through a factory instance.
|
23
|
+
desc "Produces pdf files [experimental]"
|
24
|
+
task :render_pdf => [:render_tex] do
|
25
|
+
pwd = Dir.getwd
|
26
|
+
Dir[File.join(render_tex.output_dir,'**/*.tex')].each do |file|
|
27
|
+
Dir.chdir(File.dirname(file))
|
28
|
+
2.times { sh "#{PDFLATEX} #{File.basename(file)}" }
|
29
|
+
Dir.chdir(pwd)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
task :default => [:render_html]
|
34
|
+
|
35
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#
|
2
|
+
# File 'model.yaml' created on 09 ott 2007 at 16:11:01.
|
3
|
+
# See 'dokkit.rb' or LICENSE for licence information.
|
4
|
+
#
|
5
|
+
# (c)2006, 2007 Andrea Fazzi <andrea.fazzi@alca.le.it> (and contributors).
|
6
|
+
#
|
7
|
+
# This is a config file for the current document. This file is written
|
8
|
+
# using YAML so you can easily modify it using YAML syntax. For further
|
9
|
+
# information about YAML please visit http://yaml.org/.
|
10
|
+
#
|
11
|
+
|
12
|
+
model:
|
13
|
+
name: simpledocument
|
14
|
+
version: 0.1.0
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#
|
2
|
+
# File 'simple_document.yaml' created on 09 ott 2007 at 16:11:35.
|
3
|
+
# See 'dokkit.rb' or LICENSE for licence information.
|
4
|
+
#
|
5
|
+
# (c)2006, 2007 Andrea Fazzi <andrea.fazzi@alca.le.it> (and contributors).
|
6
|
+
#
|
7
|
+
# This is a config file for the current document. This file is written
|
8
|
+
# using YAML so you can easily modify it using YAML syntax. For further
|
9
|
+
# information about YAML please visit http://yaml.org/.
|
10
|
+
#
|
11
|
+
|
12
|
+
document:
|
13
|
+
title: The simpledocument model
|
14
|
+
author: Andrea Fazzi
|
15
|
+
|
16
|
+
|
17
|
+
|
@@ -0,0 +1,123 @@
|
|
1
|
+
%% Dynamic generation of the Table of Contents.
|
2
|
+
%% Generate TOC only if formatter is different from html.
|
3
|
+
#IF: fmt==html-notemplate
|
4
|
+
#VAR: headings=plain
|
5
|
+
#ELSE
|
6
|
+
#LIST: toc
|
7
|
+
----8<----
|
8
|
+
#ENDIF
|
9
|
+
|
10
|
+
|
11
|
+
* Description of the model
|
12
|
+
|
13
|
+
This is a simple document model for ''dokkit''. You can use this model
|
14
|
+
as a base to create simple documents like tutorials, howtos, technical
|
15
|
+
reports, etc.
|
16
|
+
|
17
|
+
* Edit and render your document
|
18
|
+
|
19
|
+
To edit the content of the document simply edit
|
20
|
+
''doc/pages/simpledocument.dpl'' (this file) or create a new file with
|
21
|
+
''dpl'' extension in ''doc/pages'' directory.
|
22
|
+
|
23
|
+
To get further information about the wiki syntax to use please check
|
24
|
+
[[http://deplate.sf.net/deplate.html][deplate]] homepage.
|
25
|
+
|
26
|
+
To render this document in ''html'', open a terminal and type:
|
27
|
+
|
28
|
+
#Verbatim <<EOB
|
29
|
+
$ dokkit
|
30
|
+
EOB
|
31
|
+
|
32
|
+
from the top-level directory or from any subdirectory contained in it.
|
33
|
+
|
34
|
+
To render this document in ''latex'' format, type:
|
35
|
+
|
36
|
+
#Verbatim <<EOB
|
37
|
+
$ dokkit render_tex
|
38
|
+
EOB
|
39
|
+
|
40
|
+
To render this document in ''plain text'' format, type:
|
41
|
+
|
42
|
+
#Verbatim <<EOB
|
43
|
+
$ dokkit render_text
|
44
|
+
EOB
|
45
|
+
|
46
|
+
In any case, you should get the output
|
47
|
+
|
48
|
+
- in the ''html'' directory for the ''html'' generated output
|
49
|
+
- in the ''tex'' directory for the ''tex'' generated output
|
50
|
+
- in the ''text'' directory for the ''plain text'' generated output
|
51
|
+
|
52
|
+
** Render a pdf document
|
53
|
+
|
54
|
+
If a ''latex'' distribution is present on your system then the command:
|
55
|
+
|
56
|
+
#Verbatim <<EOB
|
57
|
+
$ dokkit render_pdf
|
58
|
+
EOB
|
59
|
+
|
60
|
+
will try to generate a ''pdf'' file for your document (__still experimental__).
|
61
|
+
|
62
|
+
If you are an ''ubuntu/debian'' user then you can obtain a complete ''latex''
|
63
|
+
distribution running the command:
|
64
|
+
|
65
|
+
#Verbatim <<EOB
|
66
|
+
$ sudo apt-get install texlive
|
67
|
+
EOB
|
68
|
+
|
69
|
+
* Rendering the modified parts of the document and cleaning up
|
70
|
+
|
71
|
+
Once you have rendered the document, running the ''dokkit'' command again will
|
72
|
+
appear to do nothing, because only changed resources are re-rendered.
|
73
|
+
To clean the output and start over run:
|
74
|
+
|
75
|
+
#Verbatim <<EOB
|
76
|
+
$ dokkit clobber
|
77
|
+
EOB
|
78
|
+
|
79
|
+
Note that if you modify any part of the document then you must re-run
|
80
|
+
''dokkit'' command in order to apply changes and to re-generate the
|
81
|
+
desidered output.
|
82
|
+
|
83
|
+
So, once you have modified your document, run:
|
84
|
+
|
85
|
+
#Verbatim <<EOB
|
86
|
+
$ dokkit render_<xxx>
|
87
|
+
EOB
|
88
|
+
|
89
|
+
Only the modified resources will be transformed.
|
90
|
+
|
91
|
+
|
92
|
+
* How to get other ''dokkit'' models
|
93
|
+
|
94
|
+
To search for other document models open a terminal and type:
|
95
|
+
|
96
|
+
#Verbatim <<EOB
|
97
|
+
$ gem list dokkit-model
|
98
|
+
EOB
|
99
|
+
|
100
|
+
To get a particular model named <model_name> run:
|
101
|
+
|
102
|
+
#Verbatim <<EOB
|
103
|
+
$ gem install dokkit-model-<model_name>
|
104
|
+
EOB
|
105
|
+
|
106
|
+
or check http://rubyforge.org/projects/dokkit/.
|
107
|
+
|
108
|
+
* What's next?
|
109
|
+
|
110
|
+
* See what else you can do by typing:
|
111
|
+
|
112
|
+
''$ dokkit --tasks''
|
113
|
+
|
114
|
+
|
115
|
+
- Modify the configuration of the document by editing
|
116
|
+
''doc/config/simpledocument.yaml''.
|
117
|
+
|
118
|
+
- Override the default layout creating in ''doc/layouts'' a custom
|
119
|
+
layout with the same name of your document.
|
120
|
+
|
121
|
+
For further information about ''dokkit'' see http://dokkit.rubyforge.org/.
|
122
|
+
|
123
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
\newcommand{\customListPrefs}{\setlength{\parsep}{0cm}\setlength{\itemsep}{0cm}}
|
2
|
+
\newenvironment{customList}{\begin{list}{}{\customListPrefs{}}}{\end{list}}
|
3
|
+
\newcommand{\customItem}[2]{\item[#1] #2}
|
4
|
+
|
5
|
+
\newenvironment{tasklist}{\begin{list}{}{\customListPrefs{}}}{\end{list}}
|
6
|
+
\newcommand{\task}[2]{\item[\textbf{#1}] #2}
|
7
|
+
|
8
|
+
\definecolor{taskA}{rgb}{1,.5,.5}
|
9
|
+
\definecolor{taskB}{rgb}{.5,1,.5}
|
10
|
+
\definecolor{taskC}{rgb}{.5,.5,1}
|
11
|
+
\definecolor{taskD}{rgb}{.5,1,1}
|
12
|
+
\definecolor{taskE}{rgb}{1,.5,1}
|
13
|
+
\definecolor{taskF}{rgb}{1,1,.5}
|
14
|
+
\definecolor{taskdone}{rgb}{.5,.5,.5}
|
15
|
+
|
16
|
+
\newcommand{\taskdone}[1]{{\footnotesize\textcolor{taskdone}{#1}}}
|
17
|
+
\newcommand{\taskA}[1]{\colorbox{taskA}{#1}}
|
18
|
+
\newcommand{\taskB}[1]{\colorbox{taskB}{#1}}
|
19
|
+
\newcommand{\taskC}[1]{\colorbox{taskC}{#1}}
|
20
|
+
\newcommand{\taskD}[1]{\colorbox{taskD}{#1}}
|
21
|
+
\newcommand{\taskE}[1]{\colorbox{taskE}{#1}}
|
22
|
+
\newcommand{\taskF}[1]{\colorbox{taskF}{#1}}
|
23
|
+
|
24
|
+
\newcommand{\emphStyle}{\em}
|
25
|
+
\newcommand{\emphSpan}[1]{\emph{#1}}
|
26
|
+
\newcommand{\boldSpan}[1]{\textbf{#1}}
|
27
|
+
\newcommand{\remoteSpan}[1]{#1}
|
28
|
+
|
29
|
+
\newenvironment{overlayBlock}{}{}
|
30
|
+
\newenvironment{scriptsizeBlock}{\scriptsize{}}{}
|
31
|
+
\newenvironment{boxBlock}{}{}
|
32
|
+
\newenvironment{footnotesizeBlock}{\footnotesize{}}{}
|
33
|
+
\newenvironment{smallBlock}{\small{}}{}
|
34
|
+
\newenvironment{landscapeBlock}{}{}
|
35
|
+
\newenvironment{gridBlock}{}{}
|
36
|
+
\newenvironment{formalBlock}{}{}
|
37
|
+
|
38
|
+
\newenvironment{todoBlock}{}{}
|
39
|
+
|
40
|
+
\newenvironment{bookBlock}{}{}
|
41
|
+
\newenvironment{booksList}{\begin{list}{}{\customListPrefs{}}}{\end{list}}
|
42
|
+
\newcommand{\booksItem}[2]{\item[\textbf{#1}] #2}
|
43
|
+
|
44
|
+
\newenvironment{exampleBlock}{\bfseries{}}{}
|
45
|
+
\newenvironment{examplesList}{\begin{list}{}{\customListPrefs{}}}{\end{list}}
|
46
|
+
\newcommand{\examplesItem}[2]{\item[#1] #2}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'dokkit'
|
3
|
+
require 'dokkit/app'
|
4
|
+
require 'rake'
|
5
|
+
|
6
|
+
module Rake
|
7
|
+
class Application
|
8
|
+
def collect_tasks(tasks = nil)
|
9
|
+
return @top_level_tasks unless tasks
|
10
|
+
@top_level_tasks.concat tasks
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
module Dokkit
|
16
|
+
class Application
|
17
|
+
def collect_tasks(tasks)
|
18
|
+
Rake.application.collect_tasks(tasks)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class TestBuiltinTask < Test::Unit::TestCase
|
24
|
+
OUTPUT_DIR = 'tests/data/output'
|
25
|
+
def test_builtin_task
|
26
|
+
Dokkit.application.init
|
27
|
+
Dokkit.application.define_builtin_tasks
|
28
|
+
assert_equal('create', Dokkit.application['create'].to_s)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_create_default_project_task
|
32
|
+
Dokkit.application.init
|
33
|
+
Dokkit.application.define_builtin_tasks
|
34
|
+
Dokkit.application.collect_tasks ["create", "#{OUTPUT_DIR}/simple_document"]
|
35
|
+
Dokkit.application.run
|
36
|
+
dir_content = Dir["#{OUTPUT_DIR}/simple_document/*"]
|
37
|
+
assert(!dir_content.empty? && !dir_content.include?('lib'))
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_create_website_task
|
41
|
+
Dokkit.application.init
|
42
|
+
Dokkit.application.do_option('--project',"website")
|
43
|
+
Dokkit.application.define_builtin_tasks
|
44
|
+
Dokkit.application.collect_tasks ["create", "#{OUTPUT_DIR}/website_project"]
|
45
|
+
Dokkit.application.run
|
46
|
+
assert(Dir["#{OUTPUT_DIR}/website_project/*"].size > 1)
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.4
|
3
|
+
specification_version: 1
|
4
|
+
name: dokkit-model-simpledocument
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.1.0
|
7
|
+
date: 2007-12-25 00:00:00 +01:00
|
8
|
+
summary: dokkit simple document model
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: andrea.fazzi@alca.le.it
|
12
|
+
homepage: http://dokkit.rubyforge.org/
|
13
|
+
rubyforge_project: dokkit
|
14
|
+
description: This is a simple document model for dokkit. You can use this model as a base to create simple documents like tutorials, howtos, guides, technical reports.
|
15
|
+
autorequire: dokkit
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: false
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- Andrea Fazzi
|
31
|
+
files:
|
32
|
+
- lib/scripts
|
33
|
+
- lib/scripts/simpledocument.rb
|
34
|
+
- lib/doc
|
35
|
+
- lib/doc/layouts
|
36
|
+
- lib/doc/layouts/simpledocument.text
|
37
|
+
- lib/doc/layouts/simpledocument.tex
|
38
|
+
- lib/doc/layouts/simpledocument.html
|
39
|
+
- lib/doc/config
|
40
|
+
- lib/model
|
41
|
+
- lib/model/README
|
42
|
+
- lib/model/doc
|
43
|
+
- lib/model/doc/config
|
44
|
+
- lib/model/doc/config/model.yaml
|
45
|
+
- lib/model/doc/config/simpledocument.yaml
|
46
|
+
- lib/model/doc/pages
|
47
|
+
- lib/model/doc/pages/simpledocument.dpl
|
48
|
+
- lib/model/doc/res
|
49
|
+
- lib/model/doc/res/tex
|
50
|
+
- lib/model/doc/res/tex/deplate.sty
|
51
|
+
- lib/model/Rakefile
|
52
|
+
- lib/tests
|
53
|
+
- lib/tests/test_structure.rb
|
54
|
+
- lib/tasks
|
55
|
+
- lib/tasks/builtin
|
56
|
+
- lib/tasks/builtin/builtin.rf
|
57
|
+
- lib/tasks/rakefile.rf
|
58
|
+
- README
|
59
|
+
- INSTALL
|
60
|
+
- CHANGES
|
61
|
+
- Rakefile
|
62
|
+
test_files: []
|
63
|
+
|
64
|
+
rdoc_options: []
|
65
|
+
|
66
|
+
extra_rdoc_files: []
|
67
|
+
|
68
|
+
executables: []
|
69
|
+
|
70
|
+
extensions: []
|
71
|
+
|
72
|
+
requirements: []
|
73
|
+
|
74
|
+
dependencies:
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: dokkit
|
77
|
+
version_requirement:
|
78
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.2.0
|
83
|
+
version:
|