lorem-ipsum-tc
Advanced tools
Comparing version 1.0.3 to 1.0.4
25
index.js
@@ -25,3 +25,3 @@ const tcCharacterList = require('./characterList.js') | ||
withLoren = true, | ||
numOfLine = Math.floor(Math.random() * 5) + 2, | ||
numOfLine = Math.floor(Math.random() * 5) + 3, | ||
charList = tcCharacterList | ||
@@ -36,4 +36,27 @@ ) { | ||
}, | ||
createArticle: function ( | ||
withLoren = true, | ||
numOfParagraph = Math.floor(Math.random() * 5) + 3, | ||
indent = ' ', | ||
skippingLine = '\n', | ||
charList = tcCharacterList | ||
) { | ||
let article = withLoren | ||
? indent + | ||
'羅倫' + | ||
this.createParagraph(false, undefined, charList) + | ||
'\n' | ||
: indent + this.createParagraph(false, undefined, charList) + '\n' | ||
for (let i = 0; i < numOfParagraph - 1; i++) { | ||
article += | ||
skippingLine + | ||
indent + | ||
this.createParagraph(false, undefined, charList) + | ||
'\n' | ||
} | ||
return article | ||
}, | ||
} | ||
module.exports = loremIpsumTC |
{ | ||
"name": "lorem-ipsum-tc", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Tool for creating Traditional Chinese lorem ipsum", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,2 +20,5 @@ # lorem-ipsum-tc | ||
// Create a random paragraph. | ||
loremIpsumTC.createArticle() | ||
// Create a random article. | ||
``` | ||
@@ -35,2 +38,9 @@ | ||
loremIpsumTC.createParagraph(withLoren, numOfLine, charList) | ||
loremIpsumTC.createArticle( | ||
withLoren, | ||
numOfParagraph, | ||
indent, | ||
skippingLine, | ||
charList | ||
) | ||
``` | ||
@@ -56,4 +66,19 @@ | ||
The number of lines would be created. | ||
The default is random from 2 to 6. | ||
The default is random from 3 to 7. | ||
- numOfParagraph: number | ||
The number of paragraphs would be created. | ||
The default is random from 3 to 7. | ||
- indent: string | ||
The indent of each paragraph. | ||
The default is 4 spaces. | ||
- skippingLine: string | ||
The skipping line between paragraphs. | ||
The default is '\n'. | ||
## Contributing | ||
@@ -60,0 +85,0 @@ |
13041
106
88