prawndown 0.1.1 → 0.1.2
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +23 -7
- data/lib/prawndown/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88359f7f3979707787791cdc6107950215ec028c8dac17526e8d6f0b47c73e6d
|
4
|
+
data.tar.gz: f69836edc22f7fe696dbc5d99fec57ca1b2ee6a30682618da658e1d03fbf21a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b4dfd134a80c614c24d774e327fe2e9deaf951281fd0b31fbf2e37dabdc0d1fd4cb6497847381353fc5afc71fdb65cd9942fcc143e7719ae8645aa340ccfaa8
|
7
|
+
data.tar.gz: 0fc4a4e43d096e6c43c6348ff59465237e0ccfd5271f63d6d12f0c21716945693a7adcff585c1966b3eafd7e3acdb063c86072639fcd82d4a23eb5926e6c362a
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ For more information about changelogs, check
|
|
6
6
|
[Keep a Changelog](http://keepachangelog.com) and
|
7
7
|
[Vandamme](http://tech-angels.github.io/vandamme).
|
8
8
|
|
9
|
+
## 0.1.2 - 2018.03.29
|
10
|
+
|
11
|
+
* [ENHANCEMENT] Improve documentation
|
12
|
+
|
9
13
|
## 0.1.1 - 2018.03.29
|
10
14
|
|
11
15
|
* [ENHANCEMENT] Add generatable examples
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
# Prawndown
|
2
2
|
|
3
|
-
A tiny Ruby gem to render a subset of Markdown in PDF files
|
3
|
+
A tiny Ruby gem to render a subset of Markdown in PDF files.
|
4
4
|
|
5
|
-
Prawn is a Ruby library to generate PDF files. It supports text formatting trough its own HTML-esque language, which has tags for different formatting options like **bold**, _italic_ and [links](https://github.com/kaspermeyer/prawndown). Read more about the supported tags in the [Prawn documentation](http://prawnpdf.org/api-docs/2.0/Prawn/Text.html#text-instance_method).
|
5
|
+
Prawn is a Ruby library to generate PDF files. It supports text formatting trough its own HTML-esque language, which has tags for different formatting options like **bold**, _italic_, ~~strikethrough~~ and [links](https://github.com/kaspermeyer/prawndown). Read more about the supported tags in the [Prawn documentation](http://prawnpdf.org/api-docs/2.0/Prawn/Text.html#text-instance_method).
|
6
6
|
|
7
7
|
## Usage
|
8
8
|
|
9
|
-
Prawndown extends Prawn with the `markdown` method.
|
9
|
+
Prawndown extends Prawn with the `markdown` method. It accepts the same options as [`Prawn::Document#text`](http://prawnpdf.org/api-docs/2.0/Prawn/Text.html#text-instance_method).
|
10
|
+
|
11
|
+
Use it to render Markdown in the document:
|
10
12
|
|
11
13
|
```ruby
|
12
14
|
Prawn::Document.generate('markdown.pdf') do
|
13
15
|
markdown '# Welcome to Prawndown!'
|
14
|
-
markdown '**Important:** We _hope_ you enjoy your stay!'
|
16
|
+
markdown '**Important:** We _hope_ you enjoy your stay!', color: 'AAAAAA'
|
15
17
|
end
|
16
18
|
```
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
-
If you prefer, you can also use the parser directly:
|
20
|
+
If prefered, the parser can also be invoked directly:
|
21
21
|
|
22
22
|
```ruby
|
23
23
|
Prawndown::Parser.new('_Welcome_ to **Prawndown**').to_prawn #=> '<i>Welcome</i> to <b>Prawndown</b>'
|
@@ -25,6 +25,22 @@ Prawndown::Parser.new('_Welcome_ to **Prawndown**').to_prawn #=> '<i>Welcome</i>
|
|
25
25
|
|
26
26
|
More thorough examples can be found under the `examples` folder. Run `rake examples` to generate the examples PDF.
|
27
27
|
|
28
|
+
### Supported Markdown syntax
|
29
|
+
```markdown
|
30
|
+
# Header 1
|
31
|
+
## Header 2
|
32
|
+
### Header 3
|
33
|
+
#### Header 4
|
34
|
+
##### Header 5
|
35
|
+
###### Header 6
|
36
|
+
_Italic_
|
37
|
+
*Italic*
|
38
|
+
__Bold__
|
39
|
+
**Bold**
|
40
|
+
~~Strikethrough~~
|
41
|
+
[Links](https://github.com/kaspermeyer/prawndown)
|
42
|
+
```
|
43
|
+
|
28
44
|
*Note: Prawdown can't output the tags `<sub>`, `<sup>`, `<font>` and `<color>` as they lack native support in Markdown.*
|
29
45
|
|
30
46
|
## Installation
|
data/lib/prawndown/version.rb
CHANGED