简体   繁体   English

离线lorem ipsum生成器

[英]Offline lorem ipsum generator

What would be a good offline alternative of the online Lipsum generator ?什么是在线Lipsum 生成器的良好离线替代方案? It's frustrating when I'm not online and need some placeholder text for testing purpose.当我不在线并且需要一些占位符文本进行测试时,这令人沮丧。 A CLI utility would be ideal, so that I can tailor the output to fit my needs. CLI 实用程序是理想的,这样我就可以定制输出以满足我的需要。

In Office 2007 apps, you can type in 在Office 2007应用程序中,您可以键入

=lorem(n)

with n equaling the number of paragraphs of lorem ipsum you would like generated. n等于你想要生成的lorem ipsum的段落数。

Django's lipsum addon seemed pretty straightforward. Django的嘴唇插件看起来很简单。 As I didn't want to install python just to run this script, I ported it to php. 因为我不想安装python只是为了运行这个脚本,我把它移植到php。

Here's my PHP version: 这是我的PHP版本:

http://pastebin.com/eA3nsJ83 http://pastebin.com/eA3nsJ83

If you have python available, google code has a CLI generator. 如果你有python可用,谷歌代码有一个CLI生成器。

http://code.google.com/p/lorem/ http://code.google.com/p/lorem/

Generate a long section online. 在线生成一个长节。 Save it to a txt file. 将其保存为txt文件。 Refer to txt file when offline. 离线时请参阅txt文件。

Textmate has a built in snippet to print this Textmate有一个内置的片段来打印它

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet,consectetur adipisicing elit,sed do eiusmod tempor incididunt ut labore et dolore magna aliqua。 Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat。 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Duis aute irure dolor in repreptderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur。 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint occaecat cupidatat non proident,sunt in culpa qui officia deserunt mollit anim id est laborum。

From

lorem LOREM

I think you could use a Markov Text Generator , fed from the original Lorem Ipsum text. 我想你可以使用原始的Lorem Ipsum文本提供的马尔可夫文本生成器 That way you should be able to find an implementation in any language you prefer. 这样你就可以找到你喜欢的任何语言的实现。

You can try out if that will do, online, here . 你可以尝试在线, 这里做。

不确定命令行版本,但有一个firefox扩展,做Lorem Ipsum: https//addons.mozilla.org/en-US/firefox/addon/2064

Just checked and found that it pulls text from the website so it wouldn't work online... sorry about that, how about this though: 刚刚检查过,发现它从网站上提取文本,因此无法在线工作...对不起,这个怎么样:

#!/usr/bin/env python

import sys
import random

try:
    n = int(sys.argv[1])
except:
    print 'Usage: %s num-words' % sys.argv[0]

words = open('/usr/share/dict/words').readlines()
for i in range(n):
    print words[random.randrange(0, len(words))][:-1],

为了完整性:执行此操作的Perl模块称为Text :: Lorem ,还有一个Text :: Lorem :: More

To make Juan's answer more complete, there is fine wrapper to Text::Lorem module. 为了使Juan的答案更加完整, Text::Lorem模块有很好的包装。 If you're on debian: 如果你是debian:

$> sudo apt-get install libtext-lorem-perl

And after this just type 在此之后只需输入

$> lorem

There's a nice generator available from homebrew if you're on macOS. 如果你在macOS上,有一个很好的发电机可以从自制软件。 brew install lorem . brew install lorem My default python distribution is python 3 which caused a syntax error for the print statements. 我的默认python发行版是python 3,它导致print语句出现语法错误。 After fixing that, it was quite nice for my purposes. 修好之后,这对我的目的来说非常好。

Word 2007 will produce a block of placeholder text when you type in =rand() and this hit the return/enter key. 当您键入= rand()并按下return / enter键时,Word 2007将生成一个占位符文本块。 If you're looking for simple placeholder text, I'd go ahead and generate a bunch ahead of time and stick it in a text file. 如果您正在寻找简单的占位符文本,我会提前生成一堆并将其粘贴到文本文件中。

Django includes the {% lorem %} tag as part of the contrib addons . Django包含{% lorem %}标记作为contrib插件的一部分。 It shouldn't be too hard to make a command-line version. 制作命令行版本应该不会太难。 Here's the source . 这是源头

On http://www.lipsum.com there are links to several offline Lorem Ipsum generators, about halfway down the frontpage. http://www.lipsum.com上有几个离线Lorem Ipsum发生器的链接,大约在首页的一半。 Or you could write one of your own in a matter of minutes. 或者你可以在几分钟内写下你自己的一个。

Edit: This isn't accurate, I wrongfully assumed all of the linked lorem ipsum generators were offline ones, not only the LaTeX one. 编辑:这不准确,我错误地认为所有链接的lorem ipsum生成器都是脱机的,而不仅仅是LaTeX。

If you are on linux and have these tools: 如果你在linux上并拥有这些工具:

pdf2ps | ps2txt < yourarticlecollection/someresearchpaper.pdf

:) :)

Seiously, most of the time I just copy&paste from research papers and articles that interests me. 很奇怪,大多数时候我只是从我感兴趣的研究论文和文章中复制和粘贴。 They have good amount of text that show white rivers and sometimes as incomprehensible as "Lorem ipsum". 他们有大量的文字显示白色的河流 ,有时像“Lorem ipsum”一样难以理解。

The alternative is to use VS Code to generate dummy text within html tag.另一种方法是使用 VS Code 在 html 标签内生成虚拟文本。 You can control how much text you want to generate.您可以控制要生成多少文本。 For example, type lorem10 then press Enter key it will generate 10 words of lorem text.例如,输入lorem10然后按Enter键将生成 10 个单词的 lorem 文本。

在此处输入图片说明

You can also generate a few paragraphs containing lorem text inside.您还可以生成一些包含 lorem 文本的段落。 For example, p*3>lorem5 will create 3 paragraphs each containing 5 words of lorem text.例如, p*3>lorem5将创建 3 个段落,每个段落包含 5 个词的 lorem 文本。

在此处输入图片说明

At the bottom of the lorem ipsum generator you will find links to the generator for other usage. 在lorem ipsum生成器的底部,您可以找到生成器的链接以供其他用途。 My understanding is the following can be used offline: 我的理解是以下可以离线使用:

But you may also find the following helpful: 但您也可以找到以下帮助:

  • WWW::Lipsum CPAN Module WWW :: Lipsum CPAN模块
  • Firefox Add-on Firefox附加组件
  • Dreamweaver Extension Dreamweaver扩展
  • GTK Lipsum GTK Lipsum
  • ActionScript3 的ActionScript3

Each of these, while requiring connectivity, reduce the load on the lipsum generator as they don't require loading the actual website. 这些中的每一个都需要连接,减少了嘴唇发生器的负载,因为它们不需要加载实际的网站。

Slightly off-topic: try to avoid using lorem ipsum for layout testing! 稍微偏离主题:尽量避免使用lorem ipsum进行布局测试!

The letter frequencies in Latin are way different than in eg English or German. 拉丁文中的字母频率与英语或德语中的字母频率不同。 There's lots of 'i' and 'l', ie lots of narrow letters. 有很多'我'和'l',即很多窄字母。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Markdown Lorem Ipsum发电机? - Markdown Lorem Ipsum generator? 括号的 Lorem Ipsum 扩展不起作用 - Lorem Ipsum extension for Brackets not working 这个标签的含义是什么: <t> lorem ipsum </t> - What is the meaning of this tag: <t>lorem ipsum</t> 为什么我在左第一个lorem ipsum上方填充? - Why i have padding above left first lorem ipsum? 如何让 lorem ipsum 在 VS Code 中实例化多行而不是 1? - How to get lorem ipsum to instantiate on multiple lines instead of 1 in VS Code? 仅当我使用大的Lorem Ipsum时,我的文本才会居中 - My text is being centered only when I use a large Lorem Ipsum 我使用 Workbox CLI 及其 service-worker 生成器的 PWA 无法离线工作 - My PWA using Workbox CLI and its service-worker generator doesn't work offline 有没有办法在我应该制作的这个 html 网页中获取这个“Iorem ipsum”虚拟文本? [等候接听] - Is there any way to get this “Iorem ipsum” dummy text inside this html webpage I am supposed to make? [on hold] 我怎样才能阻止我的 header 溢出 lorem https://jsfiddle.net/joshbjs/r9scauqe/3/ - how can i stop my header overflowing with lorem https://jsfiddle.net/joshbjs/r9scauqe/3/ 如何使重定向页面(例如http://lorem.com/contact)成为contact.html? - How to make redirecting page like http://lorem.com/contact for contact.html?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM