semantic_linefeeds 0.1.1 → 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 +4 -4
- data/CODE_OF_CONDUCT.md +44 -6
- data/README.md +18 -11
- data/lib/semantic_linefeeds/converter.rb +3 -0
- data/lib/semantic_linefeeds/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9a38fe473b04e8554705406f743b12dd84ce1b3
|
4
|
+
data.tar.gz: 492bad94f8636402aa02f50b481cf32d9ddeaa9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a8fa9fed75225100d8b92167b46877b8221bec6a0e7c515dcb4ce1374704700c17ac3bd04dc1c9fdd590f529d49aa64de5005ca0d2ed142de60299c19493284
|
7
|
+
data.tar.gz: d2739666f595765e169d85fbdb89df65390b111402141944f392d4c8544a4ea71c05d6d56a450a2ec3cc2b74843e02bd998c018b8369fae25952b168d83648e3
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,13 +1,51 @@
|
|
1
1
|
# Contributor Code of Conduct
|
2
2
|
|
3
|
-
As contributors and maintainers of this project,
|
3
|
+
As contributors and maintainers of this project,
|
4
|
+
we pledge to respect all people who contribute through reporting issues,
|
5
|
+
posting feature requests,
|
6
|
+
updating documentation,
|
7
|
+
submitting pull requests or patches,
|
8
|
+
and other activities.
|
4
9
|
|
5
|
-
We are committed to making participation in this project a harassment-free experience for everyone,
|
10
|
+
We are committed to making participation in this project a harassment-free experience for everyone,
|
11
|
+
regardless of level of experience,
|
12
|
+
gender,
|
13
|
+
gender identity and expression,
|
14
|
+
sexual orientation,
|
15
|
+
disability,
|
16
|
+
personal appearance,
|
17
|
+
body size,
|
18
|
+
race,
|
19
|
+
ethnicity,
|
20
|
+
age,
|
21
|
+
or religion.
|
6
22
|
|
7
|
-
Examples of unacceptable behavior by participants include the use of
|
23
|
+
Examples of unacceptable behavior by participants include the use of
|
24
|
+
sexual language or imagery,
|
25
|
+
derogatory comments or personal attacks,
|
26
|
+
trolling,
|
27
|
+
public or private harassment,
|
28
|
+
insults,
|
29
|
+
or other unprofessional conduct.
|
8
30
|
|
9
|
-
Project maintainers have the right and responsibility to remove,
|
31
|
+
Project maintainers have the right and responsibility to remove,
|
32
|
+
edit,
|
33
|
+
or reject comments,
|
34
|
+
commits,
|
35
|
+
code,
|
36
|
+
wiki edits,
|
37
|
+
issues,
|
38
|
+
and other contributions that are not aligned to this Code of Conduct.
|
39
|
+
Project maintainers who do not follow the Code of Conduct
|
40
|
+
may be removed from the project team.
|
10
41
|
|
11
|
-
Instances of abusive,
|
42
|
+
Instances of abusive,
|
43
|
+
harassing,
|
44
|
+
or otherwise unacceptable behavior may be reported by opening an issue
|
45
|
+
or contacting one or more of the project maintainers.
|
12
46
|
|
13
|
-
This Code of Conduct is adapted from the
|
47
|
+
This Code of Conduct is adapted from the
|
48
|
+
[Contributor Covenant](http://contributor-covenant.org),
|
49
|
+
version 1.0.0,
|
50
|
+
available at
|
51
|
+
[http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/README.md
CHANGED
@@ -3,7 +3,8 @@
|
|
3
3
|
This is a simple tool to convert text into
|
4
4
|
[semantic linefeeds](http://rhodesmill.org/brandon/2012/one-sentence-per-line/).
|
5
5
|
|
6
|
-
Rather than having
|
6
|
+
Rather than having formatting paragraphs to fit an arbitrary line-length,
|
7
|
+
like:
|
7
8
|
```
|
8
9
|
First, when you do the purely mechanical operations of typing, type so
|
9
10
|
subsequent editing will be easy. Start each sentence on a new line. Make lines
|
@@ -13,7 +14,7 @@ and adding, deleting and rearranging sentences, these precautions simplify any
|
|
13
14
|
editing you have to do later.
|
14
15
|
```
|
15
16
|
|
16
|
-
You can
|
17
|
+
You can add new-lines (er, linefeeds) after each clause and sentence.
|
17
18
|
```
|
18
19
|
First,
|
19
20
|
when you do the purely mechanical operations of typing,
|
@@ -29,14 +30,18 @@ these precautions simplify any editing you have to do later.
|
|
29
30
|
```
|
30
31
|
|
31
32
|
This makes `diff`ing it show more information.
|
32
|
-
If you're using
|
33
|
-
this is terrific,
|
33
|
+
If you're using Markdown this is terrific,
|
34
34
|
since your source can be formatted independently
|
35
35
|
of how you display it.
|
36
36
|
|
37
37
|
Take a look at the Source of this `README.md` file
|
38
38
|
for an example :)
|
39
39
|
|
40
|
+
This is just a simple script that breaks lines on certain punctuation marks.
|
41
|
+
We aim for the output to be good starting point
|
42
|
+
to convert your text to semantic linefeeds,
|
43
|
+
rather than attempt to do it automatically 100% correct.
|
44
|
+
|
40
45
|
## Installation
|
41
46
|
|
42
47
|
Add this line to your application's Gemfile:
|
@@ -76,8 +81,10 @@ do you?
|
|
76
81
|
```
|
77
82
|
|
78
83
|
### File name example
|
79
|
-
|
80
|
-
|
84
|
+
````
|
85
|
+
echo "Hello, I like this gem. Do you?" > tmp.txt`
|
86
|
+
semantic-linefeeds tmp.txt
|
87
|
+
```
|
81
88
|
|
82
89
|
will output:
|
83
90
|
```
|
@@ -88,12 +95,12 @@ do you?
|
|
88
95
|
|
89
96
|
Note that output currently only goes to STDOUT.
|
90
97
|
|
91
|
-
If you try to do something like
|
98
|
+
If you try to do something like:
|
92
99
|
```
|
93
100
|
semantic-linefeeds README.md > README.md
|
94
101
|
```
|
95
102
|
You'll end up with a blank file,
|
96
|
-
because the `>` clears the `README.md` file
|
103
|
+
because the `>` clears the `README.md` file (for writing)
|
97
104
|
before it can be read into memory.
|
98
105
|
|
99
106
|
We assume you're using git,
|
@@ -102,9 +109,9 @@ in case of errors.
|
|
102
109
|
|
103
110
|
## TODO:
|
104
111
|
|
105
|
-
[
|
106
|
-
[ ]
|
107
|
-
[ ]
|
112
|
+
- [x] Add words to break on ('or, 'and', 'then')
|
113
|
+
- [ ] Allow user defined words to break on, probably via a YAML config file
|
114
|
+
- [ ] Allow writing results to a file, rather than only to STDOUT.
|
108
115
|
|
109
116
|
## Development
|
110
117
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_linefeeds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Collins
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|