paperwork 0.3.4 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.gitlab-ci.yml +51 -27
- data/Gemfile.lock +34 -26
- data/README.md +4 -2
- data/Rakefile +5 -0
- data/lib/paperwork/tasks/document.rb +26 -12
- data/lib/paperwork/tasks/middleman_template/lib/doc_renderer.rb +1 -1
- data/lib/paperwork/tasks/middleman_template/source/fonts/bootstrap-icons.woff +0 -0
- data/lib/paperwork/tasks/middleman_template/source/fonts/bootstrap-icons.woff2 +0 -0
- data/lib/paperwork/tasks/middleman_template/source/layouts/_navbar.erb +12 -10
- data/lib/paperwork/tasks/middleman_template/source/stylesheets/bootstrap-icons.css +1875 -0
- data/lib/paperwork/tasks/middleman_template/source/stylesheets/site.css.scss +1 -0
- data/lib/paperwork/version.rb +1 -1
- data/paperwork.gemspec +1 -0
- metadata +20 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f8c3450109475a508ced5b1797489164894944e7e86794b6961edf23ce44e6a
|
4
|
+
data.tar.gz: f090d5a1eb0f3aa63aee49c784968e0e365f340f060b48bf01d1eb9240096d6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a62ec73b5be3e1fbf41af291436b9c99ddd28559ebc3e5fb444beff51836e6b0138e2a89915b2d5301b2d1e551450fe2c4d0f06b83cebe7990b95e251eddd7cd
|
7
|
+
data.tar.gz: b9f1b73b11969e1016239e4e8e2e687a4c42cb4f86214123bbdcd9f02080da4542271bbf7904a4fbf7305f9b679e889d746071c579e9e681c74c972ae772fe3d
|
data/.gitignore
CHANGED
data/.gitlab-ci.yml
CHANGED
@@ -1,20 +1,26 @@
|
|
1
|
-
image:
|
2
|
-
|
3
|
-
# include:
|
4
|
-
# - template: License-Scanning.gitlab-ci.yml
|
1
|
+
image: ruby:2.6.8
|
5
2
|
|
6
3
|
stages:
|
7
4
|
- build
|
8
5
|
- test
|
6
|
+
- release
|
9
7
|
- deploy
|
10
8
|
|
11
9
|
before_script:
|
12
|
-
- ruby -v
|
13
|
-
- which ruby
|
14
10
|
- apt update
|
15
11
|
- apt install nodejs npm yarn -y
|
16
|
-
-
|
17
|
-
|
12
|
+
# default rubygems CLI in ruby2.6-container-images is 3.0.3, which won't
|
13
|
+
# support API KEY being provided by environment variable GEM_HOST_API_KEY.
|
14
|
+
# --> update it to >3.0.5
|
15
|
+
- gem update --system
|
16
|
+
- gem install bundler -v 2.2.27 --no-document
|
17
|
+
- bundle config set --local path .bundle
|
18
|
+
- bundle install --jobs $(nproc)
|
19
|
+
|
20
|
+
cache:
|
21
|
+
key: ${CI_COMMIT_REF_NAME}
|
22
|
+
paths:
|
23
|
+
- .bundle
|
18
24
|
|
19
25
|
build:
|
20
26
|
stage: build
|
@@ -27,8 +33,6 @@ build:
|
|
27
33
|
|
28
34
|
rspec:
|
29
35
|
stage: test
|
30
|
-
dependencies:
|
31
|
-
- build
|
32
36
|
script:
|
33
37
|
- bundle exec "rspec --format RspecJunitFormatter --out rspec.xml"
|
34
38
|
artifacts:
|
@@ -38,28 +42,48 @@ rspec:
|
|
38
42
|
reports:
|
39
43
|
junit: rspec.xml
|
40
44
|
|
41
|
-
|
42
|
-
|
45
|
+
# requires environment variable GEM_HOST_API_KEY to be set. content
|
46
|
+
# has to be a valid rubygems API key for authentication when publishing the
|
47
|
+
# gem to rubygems.org.
|
48
|
+
#
|
49
|
+
# also requires GIT_REPOSITORY_AUTH in which "access_token_name:access_token"
|
50
|
+
# for this git repository is configured.
|
51
|
+
release:
|
52
|
+
stage: release
|
53
|
+
rules:
|
54
|
+
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
55
|
+
when: manual
|
56
|
+
variables:
|
57
|
+
GIT_REMOTE_URL: ${CI_SERVER_PROTOCOL}://${GIT_REPOSITORY_AUTH}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/${CI_PROJECT_PATH}.git
|
43
58
|
script:
|
44
|
-
- bundle exec
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
59
|
+
- VERSION=$(bundle exec rake version)
|
60
|
+
- bundle exec rake build
|
61
|
+
# remember who is responsible for this release
|
62
|
+
- git config --global user.name "${GITLAB_USER_LOGIN}"
|
63
|
+
- git config --global user.email "${GITLAB_USER_EMAIL}"
|
64
|
+
- git remote add release ${GIT_REMOTE_URL}
|
65
|
+
- git tag ${VERSION}
|
66
|
+
- git push release --tags
|
67
|
+
- gem push pkg/paperwork-${VERSION}.gem
|
68
|
+
|
69
|
+
# rubocop:
|
70
|
+
# stage: test
|
71
|
+
# script:
|
72
|
+
# - bundle exec "rubocop --format junit --out rubocop.xml"
|
73
|
+
# artifacts:
|
74
|
+
# paths:
|
75
|
+
# - rubocop.xml
|
76
|
+
# reports:
|
77
|
+
# junit: rubocop.xml
|
50
78
|
|
51
79
|
pages:
|
52
80
|
stage: deploy
|
53
|
-
|
54
|
-
-
|
55
|
-
|
56
|
-
|
81
|
+
rules:
|
82
|
+
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
83
|
+
artifacts:
|
84
|
+
paths:
|
85
|
+
- public
|
57
86
|
script:
|
58
87
|
- mkdir public
|
59
88
|
- mv .work/doc/build/* public/
|
60
89
|
- mv .work/coverage public/
|
61
|
-
artifacts:
|
62
|
-
paths:
|
63
|
-
- public
|
64
|
-
only:
|
65
|
-
- master
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
paperwork (0.
|
4
|
+
paperwork (0.4.1)
|
5
|
+
listen (~> 3.4.1)
|
5
6
|
rake (~> 12.3)
|
6
7
|
redcarpet (~> 3.5.0)
|
7
8
|
thor (~> 1.1.0)
|
@@ -9,31 +10,38 @@ PATH
|
|
9
10
|
GEM
|
10
11
|
remote: https://rubygems.org/
|
11
12
|
specs:
|
12
|
-
ast (2.4.
|
13
|
+
ast (2.4.2)
|
13
14
|
byebug (11.1.3)
|
14
|
-
diff-lcs (1.
|
15
|
-
docile (1.
|
16
|
-
|
17
|
-
|
15
|
+
diff-lcs (1.5.0)
|
16
|
+
docile (1.4.0)
|
17
|
+
ffi (1.15.5)
|
18
|
+
listen (3.4.1)
|
19
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
20
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
21
|
+
parallel (1.22.1)
|
22
|
+
parser (3.1.2.0)
|
18
23
|
ast (~> 2.4.1)
|
19
|
-
rainbow (3.
|
24
|
+
rainbow (3.1.1)
|
20
25
|
rake (12.3.3)
|
26
|
+
rb-fsevent (0.11.1)
|
27
|
+
rb-inotify (0.10.1)
|
28
|
+
ffi (~> 1.0)
|
21
29
|
redcarpet (3.5.1)
|
22
|
-
regexp_parser (
|
23
|
-
rexml (3.2.
|
24
|
-
rspec (3.
|
25
|
-
rspec-core (~> 3.
|
26
|
-
rspec-expectations (~> 3.
|
27
|
-
rspec-mocks (~> 3.
|
28
|
-
rspec-core (3.
|
29
|
-
rspec-support (~> 3.
|
30
|
-
rspec-expectations (3.
|
30
|
+
regexp_parser (2.5.0)
|
31
|
+
rexml (3.2.5)
|
32
|
+
rspec (3.11.0)
|
33
|
+
rspec-core (~> 3.11.0)
|
34
|
+
rspec-expectations (~> 3.11.0)
|
35
|
+
rspec-mocks (~> 3.11.0)
|
36
|
+
rspec-core (3.11.0)
|
37
|
+
rspec-support (~> 3.11.0)
|
38
|
+
rspec-expectations (3.11.0)
|
31
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
-
rspec-support (~> 3.
|
33
|
-
rspec-mocks (3.
|
40
|
+
rspec-support (~> 3.11.0)
|
41
|
+
rspec-mocks (3.11.1)
|
34
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
35
|
-
rspec-support (~> 3.
|
36
|
-
rspec-support (3.
|
43
|
+
rspec-support (~> 3.11.0)
|
44
|
+
rspec-support (3.11.0)
|
37
45
|
rspec_junit_formatter (0.4.1)
|
38
46
|
rspec-core (>= 2, < 4, != 2.12.0)
|
39
47
|
rubocop (0.87.1)
|
@@ -45,15 +53,15 @@ GEM
|
|
45
53
|
rubocop-ast (>= 0.1.0, < 1.0)
|
46
54
|
ruby-progressbar (~> 1.7)
|
47
55
|
unicode-display_width (>= 1.4.0, < 2.0)
|
48
|
-
rubocop-ast (0.
|
49
|
-
parser (>= 2.7.
|
50
|
-
ruby-progressbar (1.
|
56
|
+
rubocop-ast (0.8.0)
|
57
|
+
parser (>= 2.7.1.5)
|
58
|
+
ruby-progressbar (1.11.0)
|
51
59
|
simplecov (0.18.5)
|
52
60
|
docile (~> 1.1)
|
53
61
|
simplecov-html (~> 0.11)
|
54
|
-
simplecov-html (0.12.
|
62
|
+
simplecov-html (0.12.3)
|
55
63
|
thor (1.1.0)
|
56
|
-
unicode-display_width (1.
|
64
|
+
unicode-display_width (1.8.0)
|
57
65
|
|
58
66
|
PLATFORMS
|
59
67
|
ruby
|
@@ -67,4 +75,4 @@ DEPENDENCIES
|
|
67
75
|
simplecov (~> 0.18.5)
|
68
76
|
|
69
77
|
BUNDLED WITH
|
70
|
-
2.
|
78
|
+
2.2.27
|
data/README.md
CHANGED
@@ -2,13 +2,16 @@
|
|
2
2
|
title: paperwork
|
3
3
|
---
|
4
4
|
|
5
|
-
# paperwork
|
5
|
+
# paperwork
|
6
|
+
|
7
|
+
[![w-10](https://gitlab.com/couchbelag/paperwork/badges/master/pipeline.svg)](https://gitlab.com/couchbelag/paperwork/-/commits/master)[![w-10](https://gitlab.com/couchbelag/paperwork/badges/master/coverage.svg)](https://couchbelag.gitlab.io/paperwork/coverage)
|
6
8
|
|
7
9
|
|
8
10
|
### The *paperwork gem* is an aproach to create appealing documentation from markdown documents.
|
9
11
|
|
10
12
|
Markdown is used throughout many software development projects because of its simple syntax. Though being simple markdown provides sufficient elements necessary to visualize most aspects of software. And it's integrated into many tools, like github, gitlab, Visual Studio Code,... most likely these are already part of nowadays development processes anyway.
|
11
13
|
|
14
|
+
|
12
15
|
Most developers want to focus on code and progress and not on documentation. *paperwork* tries to keep most of the publishing topics of documentation away from them. One important goal with this is to keep the markdown document independent from the target media. So it is possible to write documentation as HTML pages that can be scrolled, printed,... as you would do with usual web sites. On the other hand, markdown could also be transformed to presentations. If you're reading this in a presentation, you're already looking at one example of such a transformation. If you don't, have a look at the [generated presentation](https://couchbelag.gitlab.io/paperwork). The source file for the presentation is the [regular `README.md` file of the project](https://gitlab.com/couchbelag/paperwork/-/blob/master/README.md).
|
13
16
|
|
14
17
|
|
@@ -21,7 +24,6 @@ Well... you wouldn't, I agree. Nevertheless I've been into situations where I cr
|
|
21
24
|
*paperwork* is not simply a renderer like *redcarpet* (which is actually used as renderer within *paperwork*). It provides *"markdown API"* to interface with different media formats. Of course, *paperwork* is not limited to presentations and/or books. Any media could be addressed. The idea simply is *reduce, reuse, recycle*, write documentation once and spread it across multiple channels.
|
22
25
|
|
23
26
|
|
24
|
-
|
25
27
|
## Installation & Usage
|
26
28
|
|
27
29
|
### In a ruby application
|
data/Rakefile
CHANGED
@@ -14,3 +14,8 @@ task default: :spec
|
|
14
14
|
CLEAN.include(".work/coverage")
|
15
15
|
|
16
16
|
paperwork :doc, sources: ["README.md", "nested_example/navdemo.md", "paperwork.yml", "custom.js", "custom.css"]
|
17
|
+
|
18
|
+
desc "returns version information"
|
19
|
+
task :version do
|
20
|
+
puts Paperwork::VERSION
|
21
|
+
end
|
@@ -5,21 +5,24 @@ module Paperwork
|
|
5
5
|
# task generators for building with middleman
|
6
6
|
module Tasks
|
7
7
|
require "rake"
|
8
|
+
require "listen"
|
8
9
|
|
9
10
|
##
|
10
11
|
# main task generator for building the document
|
11
12
|
#
|
12
13
|
class Document < Paperwork::Tasks::Base # rubocop:disable Metrics/ClassLength
|
13
|
-
attr_reader :dir
|
14
|
+
attr_reader :dir, :sources_map
|
14
15
|
|
15
16
|
include Rake::DSL
|
16
17
|
|
17
18
|
def initialize(name, sources, *dependencies)
|
18
19
|
@dir = Paperwork::Tasks::Template.new(name).dir
|
19
20
|
|
21
|
+
@sources_map = {}
|
20
22
|
sources.each do |src|
|
21
23
|
dst = get_destination(File.join(self.dir, "source"), src)
|
22
24
|
BuildFile.new(dst, src)
|
25
|
+
sources_map[src] = dst
|
23
26
|
dependencies << dst
|
24
27
|
end
|
25
28
|
|
@@ -116,22 +119,33 @@ module Paperwork
|
|
116
119
|
else
|
117
120
|
Process.spawn(cmd, out: :out, in: :in, err: :err)
|
118
121
|
end
|
119
|
-
puts
|
120
|
-
puts "+---------------------------------------------------------------+"
|
121
|
-
puts "| |"
|
122
|
-
puts "| IMPORTANT: Edit documents in #{self.dir} for live reload! |"
|
123
|
-
puts "| ---------- The documents there are hard links to your |"
|
124
|
-
puts "| source files, so the changes will be there |"
|
125
|
-
puts "| as well. |"
|
126
|
-
puts "| |"
|
127
|
-
puts "+---------------------------------------------------------------+"
|
128
|
-
puts
|
129
|
-
Process.waitall
|
130
122
|
end
|
123
|
+
|
124
|
+
listen_to_sources
|
125
|
+
|
126
|
+
Process.waitall
|
131
127
|
end
|
132
128
|
end
|
133
129
|
end
|
134
130
|
end
|
131
|
+
|
132
|
+
def listen_to_sources
|
133
|
+
sources = {}
|
134
|
+
self.sources_map.each do |src, dst|
|
135
|
+
sources[File.absolute_path(src)] = dst
|
136
|
+
end
|
137
|
+
|
138
|
+
ignore_list = [/#{Paperwork::Config[:build_root]}/]
|
139
|
+
Listen.to(Dir.pwd, ignore: ignore_list) do |modified, added, removed|
|
140
|
+
(modified + added + removed).each do |src|
|
141
|
+
dst = sources[src]
|
142
|
+
unless dst.nil?
|
143
|
+
puts "## updating #{src}"
|
144
|
+
FileUtils.cp src, dst
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end.start
|
148
|
+
end
|
135
149
|
end
|
136
150
|
end
|
137
151
|
end
|
@@ -1,13 +1,15 @@
|
|
1
1
|
<nav class="sticky-top navbar navbar-expand-lg navbar-dark bg-dark">
|
2
2
|
<a class="navbar-brand" href="<%= root_path %>"><%= navbar_brand || yield_content(:title) %></a>
|
3
|
-
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
3
|
+
<% if navbar_links.size > 0 %>
|
4
|
+
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
5
|
+
<span class="navbar-toggler-icon"></span>
|
6
|
+
</button>
|
7
|
+
<div id="navbarSupportedContent" class="collapse navbar-collapse">
|
8
|
+
<ul class="mr-auto navbar-nav">
|
9
|
+
<% navbar_links.each do |name, link| %>
|
10
|
+
<li class=" nav-item"><a class="nav-link" data-method="get" href="<%= link.gsub(/\.md$/, ".html") %>"><%= name %></a></li>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
13
15
|
</nav>
|