Search in sources :

Example 1 with LoremIpsum

use of de.svenjacobs.loremipsum.LoremIpsum in project orgzly-android by orgzly.

the class LipsumBookGenerator method generateOrgString.

public static String generateOrgString(int content, int[] notesAndContent) {
    StringBuilder result = new StringBuilder();
    LoremIpsum loremIpsum = new LoremIpsum();
    OrgParserWriter parserWriter = new OrgParserWriter();
    result.append(parserWriter.whiteSpacedFilePreface(loremIpsum.getWords(content / CHARS_PER_WORD)));
    if (notesAndContent != null) {
        for (int i = 0; i < notesAndContent.length; i += 2) {
            OrgHead head = new OrgHead();
            head.setTitle(loremIpsum.getWords(notesAndContent[i] / CHARS_PER_WORD));
            head.setContent(loremIpsum.getWords(notesAndContent[i + 1] / CHARS_PER_WORD));
            result.append(parserWriter.whiteSpacedHead(head, 1, false));
        }
    }
    return result.toString();
}
Also used : LoremIpsum(de.svenjacobs.loremipsum.LoremIpsum) OrgHead(com.orgzly.org.OrgHead) OrgParserWriter(com.orgzly.org.parser.OrgParserWriter)

Aggregations

OrgHead (com.orgzly.org.OrgHead)1 OrgParserWriter (com.orgzly.org.parser.OrgParserWriter)1 LoremIpsum (de.svenjacobs.loremipsum.LoremIpsum)1