paperwork 0.2.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.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.gitlab-ci.yml +65 -0
- data/.rspec +3 -0
- data/.rubocop.yml +68 -0
- data/.travis.yml +6 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +68 -0
- data/LICENSE.txt +21 -0
- data/README.md +86 -0
- data/Rakefile +16 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/custom.css +1 -0
- data/custom.js +1 -0
- data/lib/paperwork.rb +39 -0
- data/lib/paperwork/assets/paperwork/presentation.css +58 -0
- data/lib/paperwork/assets/presentation.css +153 -0
- data/lib/paperwork/config.rb +45 -0
- data/lib/paperwork/tasks.rb +25 -0
- data/lib/paperwork/tasks/base.rb +47 -0
- data/lib/paperwork/tasks/build_dir.rb +27 -0
- data/lib/paperwork/tasks/build_file.rb +32 -0
- data/lib/paperwork/tasks/document.rb +106 -0
- data/lib/paperwork/tasks/middleman_template/Gemfile +11 -0
- data/lib/paperwork/tasks/middleman_template/Gemfile.lock +131 -0
- data/lib/paperwork/tasks/middleman_template/config.rb +82 -0
- data/lib/paperwork/tasks/middleman_template/data/.keep +0 -0
- data/lib/paperwork/tasks/middleman_template/lib/doc_renderer.rb +137 -0
- data/lib/paperwork/tasks/middleman_template/lib/info_helpers.rb +43 -0
- data/lib/paperwork/tasks/middleman_template/package.json +12 -0
- data/lib/paperwork/tasks/middleman_template/source/images/.keep +0 -0
- data/lib/paperwork/tasks/middleman_template/source/javascripts/site.js +8 -0
- data/lib/paperwork/tasks/middleman_template/source/layouts/_document.erb +49 -0
- data/lib/paperwork/tasks/middleman_template/source/layouts/_header.erb +28 -0
- data/lib/paperwork/tasks/middleman_template/source/layouts/_info.erb +23 -0
- data/lib/paperwork/tasks/middleman_template/source/layouts/_navbar.erb +13 -0
- data/lib/paperwork/tasks/middleman_template/source/layouts/layout.erb +11 -0
- data/lib/paperwork/tasks/middleman_template/source/stylesheets/rogue.css.erb +1 -0
- data/lib/paperwork/tasks/middleman_template/source/stylesheets/site.css.scss +31 -0
- data/lib/paperwork/tasks/middleman_template/webpack.config.js +17 -0
- data/lib/paperwork/tasks/middleman_template/yarn.lock +1337 -0
- data/lib/paperwork/tasks/root_helpers.rb +53 -0
- data/lib/paperwork/tasks/template.rb +46 -0
- data/lib/paperwork/version.rb +5 -0
- data/navdemo.md +5 -0
- data/paperwork.gemspec +38 -0
- data/site.yml +7 -0
- metadata +193 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a6ca73b108fa2e53bfc6882abb4e1dfd84c34e58d4306bc29a4ec54ae0b55a28
|
4
|
+
data.tar.gz: 75c019845942a4b8596fc04e7c7b8cdc22198dd8fad7b94918e2c4a93cbac3f0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bc72644eaa74956c6360083a90450f127df96ebcd15742ca5e63f50a16c4c7cbf43bdd105264610df53ca6362b682af52c217e65cfd717a67a0acf4d82c97c29
|
7
|
+
data.tar.gz: 5aeecba6354e787619122d7fbb977e4025bc902ee28b5f1d6cdd4d32e4c1cc218b4d85f1c13c856d461c1862219e7cbe2cab0bb0f83654d28d50429942a6a1be
|
data/.gitignore
ADDED
data/.gitlab-ci.yml
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
image: "ruby:2.6"
|
2
|
+
|
3
|
+
# include:
|
4
|
+
# - template: License-Scanning.gitlab-ci.yml
|
5
|
+
|
6
|
+
stages:
|
7
|
+
- build
|
8
|
+
- test
|
9
|
+
- deploy
|
10
|
+
|
11
|
+
before_script:
|
12
|
+
- ruby -v
|
13
|
+
- which ruby
|
14
|
+
- apt update
|
15
|
+
- apt install nodejs npm yarn -y
|
16
|
+
- gem install bundler --no-document
|
17
|
+
- bundle install --jobs $(nproc) ${FLAGS}
|
18
|
+
|
19
|
+
build:
|
20
|
+
stage: build
|
21
|
+
script:
|
22
|
+
- bundle exec rake build
|
23
|
+
artifacts:
|
24
|
+
paths:
|
25
|
+
- pkg/
|
26
|
+
- .work/doc/build/
|
27
|
+
|
28
|
+
rspec:
|
29
|
+
stage: test
|
30
|
+
dependencies:
|
31
|
+
- build
|
32
|
+
script:
|
33
|
+
- bundle exec "rspec --format RspecJunitFormatter --out rspec.xml"
|
34
|
+
artifacts:
|
35
|
+
paths:
|
36
|
+
- .work/coverage/
|
37
|
+
- rspec.xml
|
38
|
+
reports:
|
39
|
+
junit: rspec.xml
|
40
|
+
|
41
|
+
rubocop:
|
42
|
+
stage: test
|
43
|
+
script:
|
44
|
+
- bundle exec "rubocop --format junit --out rubocop.xml"
|
45
|
+
artifacts:
|
46
|
+
paths:
|
47
|
+
- rubocop.xml
|
48
|
+
reports:
|
49
|
+
junit: rubocop.xml
|
50
|
+
|
51
|
+
pages:
|
52
|
+
stage: deploy
|
53
|
+
dependencies:
|
54
|
+
- build
|
55
|
+
- rspec
|
56
|
+
- rubocop
|
57
|
+
script:
|
58
|
+
- mkdir public
|
59
|
+
- mv .work/doc/build/* public/
|
60
|
+
- mv .work/coverage public/
|
61
|
+
artifacts:
|
62
|
+
paths:
|
63
|
+
- public
|
64
|
+
only:
|
65
|
+
- master
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
Metrics/ClassLength:
|
2
|
+
CountAsOne:
|
3
|
+
- array
|
4
|
+
- heredoc
|
5
|
+
|
6
|
+
Metrics/MethodLength:
|
7
|
+
CountAsOne:
|
8
|
+
- array
|
9
|
+
- heredoc
|
10
|
+
Max: 20
|
11
|
+
|
12
|
+
Layout/IndentationWidth:
|
13
|
+
Width: 4
|
14
|
+
|
15
|
+
Style/StringLiterals:
|
16
|
+
EnforcedStyle: double_quotes
|
17
|
+
|
18
|
+
Style/StringLiteralsInInterpolation:
|
19
|
+
EnforcedStyle: double_quotes
|
20
|
+
|
21
|
+
Style/RedundantSelf:
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
Layout/EmptyLines:
|
25
|
+
Enabled: false
|
26
|
+
|
27
|
+
Layout/EmptyLineBetweenDefs:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
Style/RegexpLiteral:
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
Style/IfUnlessModifier:
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
Layout/EmptyLinesAroundClassBody:
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
Style/ClassVars:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
Style/MultilineBlockChain:
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
Style/RaiseArgs:
|
46
|
+
EnforcedStyle: compact
|
47
|
+
|
48
|
+
Metrics/BlockLength:
|
49
|
+
ExcludedMethods:
|
50
|
+
- describe
|
51
|
+
|
52
|
+
Style/CommandLiteral:
|
53
|
+
EnforcedStyle: percent_x
|
54
|
+
|
55
|
+
Style/SymbolArray:
|
56
|
+
Enabled: false
|
57
|
+
|
58
|
+
Layout/SpaceBeforeBlockBraces:
|
59
|
+
Enabled: false
|
60
|
+
|
61
|
+
Style/PercentLiteralDelimiters:
|
62
|
+
PreferredDelimiters:
|
63
|
+
default: "()"
|
64
|
+
"%i": "()"
|
65
|
+
"%I": "()"
|
66
|
+
"%r": "()"
|
67
|
+
"%w": "()"
|
68
|
+
"%W": "()"
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
paperwork (0.2.0)
|
5
|
+
rake (~> 12.3)
|
6
|
+
redcarpet (~> 3.5.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
ast (2.4.1)
|
12
|
+
byebug (11.1.3)
|
13
|
+
diff-lcs (1.4.4)
|
14
|
+
docile (1.3.2)
|
15
|
+
parallel (1.19.2)
|
16
|
+
parser (2.7.1.4)
|
17
|
+
ast (~> 2.4.1)
|
18
|
+
rainbow (3.0.0)
|
19
|
+
rake (12.3.3)
|
20
|
+
redcarpet (3.5.1)
|
21
|
+
regexp_parser (1.7.1)
|
22
|
+
rexml (3.2.4)
|
23
|
+
rspec (3.9.0)
|
24
|
+
rspec-core (~> 3.9.0)
|
25
|
+
rspec-expectations (~> 3.9.0)
|
26
|
+
rspec-mocks (~> 3.9.0)
|
27
|
+
rspec-core (3.9.2)
|
28
|
+
rspec-support (~> 3.9.3)
|
29
|
+
rspec-expectations (3.9.2)
|
30
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
31
|
+
rspec-support (~> 3.9.0)
|
32
|
+
rspec-mocks (3.9.1)
|
33
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
+
rspec-support (~> 3.9.0)
|
35
|
+
rspec-support (3.9.3)
|
36
|
+
rspec_junit_formatter (0.4.1)
|
37
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
38
|
+
rubocop (0.87.1)
|
39
|
+
parallel (~> 1.10)
|
40
|
+
parser (>= 2.7.1.1)
|
41
|
+
rainbow (>= 2.2.2, < 4.0)
|
42
|
+
regexp_parser (>= 1.7)
|
43
|
+
rexml
|
44
|
+
rubocop-ast (>= 0.1.0, < 1.0)
|
45
|
+
ruby-progressbar (~> 1.7)
|
46
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
47
|
+
rubocop-ast (0.1.0)
|
48
|
+
parser (>= 2.7.0.1)
|
49
|
+
ruby-progressbar (1.10.1)
|
50
|
+
simplecov (0.18.5)
|
51
|
+
docile (~> 1.1)
|
52
|
+
simplecov-html (~> 0.11)
|
53
|
+
simplecov-html (0.12.2)
|
54
|
+
unicode-display_width (1.7.0)
|
55
|
+
|
56
|
+
PLATFORMS
|
57
|
+
ruby
|
58
|
+
|
59
|
+
DEPENDENCIES
|
60
|
+
byebug (~> 11.1.3)
|
61
|
+
paperwork!
|
62
|
+
rspec (~> 3.0)
|
63
|
+
rspec_junit_formatter (~> 0.4.1)
|
64
|
+
rubocop (~> 0.87.1)
|
65
|
+
simplecov (~> 0.18.5)
|
66
|
+
|
67
|
+
BUNDLED WITH
|
68
|
+
2.1.4
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 The paperwork gem authors
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
---
|
2
|
+
title: paperwork
|
3
|
+
---
|
4
|
+
|
5
|
+
# paperwork [](https://gitlab.com/couchbelag/paperwork/-/commits/master)[](https://couchbelag.gitlab.io/paperwork/coverage)
|
6
|
+
|
7
|
+
|
8
|
+
### The *paperwork gem* is an aproach to create appealing documentation from markdown documents.
|
9
|
+
|
10
|
+
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
|
+
|
12
|
+
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
|
+
|
14
|
+
|
15
|
+
### Why would I want to transform my project documentation into a presentation?
|
16
|
+
|
17
|
+
Well... you wouldn't, I agree. Nevertheless I've been into situations where I created a presentation for a project and thought afterwards *"Damn, that would fit into the documentation perfectly!!"*... and I did it a second time. So the real benefit in this is to have a presentation that can be reused and integrated seamlessly into a project's documentation. In gitlab for example documentation and presentations would have same layout in the web UI, so you wouldn't notice what's presentation and what's documentation.
|
18
|
+
|
19
|
+
### *paperwork* is not another markdown renderer
|
20
|
+
|
21
|
+
*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
|
+
|
23
|
+
|
24
|
+
|
25
|
+
## Installation & Usage
|
26
|
+
|
27
|
+
### In a ruby application
|
28
|
+
|
29
|
+
Add this line to your application's Gemfile:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
gem 'paperwork'
|
33
|
+
```
|
34
|
+
|
35
|
+
And then execute:
|
36
|
+
|
37
|
+
```bash
|
38
|
+
$ bundle install
|
39
|
+
```
|
40
|
+
|
41
|
+
|
42
|
+
### In other languages
|
43
|
+
|
44
|
+
In other languages you will need to setup a `Gemfile` like the one above and a `Rakefile` for the build process:
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
require "paperwork/tasks"
|
48
|
+
|
49
|
+
Paperwork.book do |p|
|
50
|
+
p.title = "fancy title"
|
51
|
+
p << "README.md"
|
52
|
+
end
|
53
|
+
```
|
54
|
+
|
55
|
+
Change into the directory where the Rakefile and the Gemfile (and of course the `README.md`) are located and execute:
|
56
|
+
|
57
|
+
```bash
|
58
|
+
$ bundle install
|
59
|
+
$ rake paperwork
|
60
|
+
```
|
61
|
+
|
62
|
+
If you'd like to know what tasks are shipped with *paperwork* do a `rake -T` to get a list of all tasks.
|
63
|
+
|
64
|
+
**For more information about how to use *paperwork* have a look into the [user's guide](guides/users_guide.md).**
|
65
|
+
|
66
|
+
|
67
|
+
## Development
|
68
|
+
|
69
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
70
|
+
|
71
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
72
|
+
|
73
|
+
If you'd like to contribute to the project, please have a look at the project's [developer guide](https://gitlab.com/couchbelag/gog/-/tree/2.0.0/developer-guide). The automated build process provides some information about the current *master* branch:
|
74
|
+
|
75
|
+
* [Example presentation from README.md (this file)](https://couchbelag.gitlab.io/paperwork)
|
76
|
+
* [code coverage report](https://couchbelag.gitlab.io/paperwork/coverage)
|
77
|
+
|
78
|
+
## Contributing
|
79
|
+
|
80
|
+
Bug reports and pull requests are welcome on gitlab at https://gitlab.com/couchbelag/paperwork.
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
## License
|
85
|
+
|
86
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rspec/core/rake_task"
|
5
|
+
require "paperwork"
|
6
|
+
|
7
|
+
RSpec::Core::RakeTask.new(:spec)
|
8
|
+
|
9
|
+
|
10
|
+
Rake::Task[:build].enhance(["paperwork:doc"])
|
11
|
+
Rake::Task[:clean].enhance(["paperwork:doc:clean"])
|
12
|
+
task rebuild: [:clean, :build]
|
13
|
+
task default: :spec
|
14
|
+
CLEAN.include(".work/coverage")
|
15
|
+
|
16
|
+
paperwork :doc, sources: ["README.md", "navdemo.md", "site.yml", "custom.js", "custom.css"]
|
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "paperwork"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/custom.css
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
|
data/custom.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
|
data/lib/paperwork.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# The MIT License (MIT)
|
5
|
+
#
|
6
|
+
# Copyright (c) 2020 The paperwork gem authors
|
7
|
+
#
|
8
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
+
# of this software and associated documentation files (the "Software"), to deal
|
10
|
+
# in the Software without restriction, including without limitation the rights
|
11
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
+
# copies of the Software, and to permit persons to whom the Software is
|
13
|
+
# furnished to do so, subject to the following conditions:
|
14
|
+
#
|
15
|
+
# The above copyright notice and this permission notice shall be included in
|
16
|
+
# all copies or substantial portions of the Software.
|
17
|
+
#
|
18
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
+
# THE SOFTWARE.
|
25
|
+
#
|
26
|
+
#
|
27
|
+
|
28
|
+
require "paperwork/version"
|
29
|
+
require "paperwork/config"
|
30
|
+
require "paperwork/tasks"
|
31
|
+
require "paperwork/tasks/base"
|
32
|
+
require "paperwork/tasks/build_dir"
|
33
|
+
require "paperwork/tasks/build_file"
|
34
|
+
require "paperwork/tasks/root_helpers"
|
35
|
+
require "paperwork/tasks/document"
|
36
|
+
require "paperwork/tasks/template"
|
37
|
+
|
38
|
+
|
39
|
+
include Paperwork # rubocop:disable Style/MixinUsage
|