出版与作家生涯2017docs.racket-lang.org
Pollen:书本身就是一个程序
Pollen: the book is a program
导读
这篇介绍 Racket 的 Pollen:一种把文本与代码混合、让“书成为程序”的写作/出版系统。它把排版、编号、语法高亮等交给程序自动处理,让作者用专用标记语言快速写作;对关心结构化写作、写作工具和自动化流程的写作者有启发。
可以直接用的写作要点
- 01
把重复的排版、编号、引号转换等交给后处理,写作时先保持思路速度。
- 02
为特定文体设计专用标记或模板,减少通用工具的摩擦和切换成本。
- 03
文本、代码与样式是否合并没有教条答案,关键是成品是否易读、易导航、易维护。
- 04
技术写作可考虑让示例更接近可运行、可验证,而不只是静态展示。
HN 评论精选
文本与代码合并重定义了“关注点分离”,成品质量是重要说服力。
有意思的是,出版(多数网站,但多数出版活动眯眼一看也归于此)正从代码、模板、样式和文本分离的模式,转向把它们合并在一起。React 这么做,Pollen 似乎更进一步,把文本也放进代码里——或者更准确说,把代码放进文本里。这个转变出人意料。“关注点分离”仍是人人想要的,只是对什么算同一个“关注点”的定义在翻转:React 认为组件的每一部分是一个关注点……而且似乎有效。我不确定写作上我是否认同,但结果确实很漂亮;作者用 Pollen 出版的书都很好看、很好导航。我一直在折腾 Hugo 把项目文档转成 wiki/CMS 之外的形式(因为我怕用 wiki 或 CMS 处理长文档)。它大概够我用,所以我可能不会花时间学 Pollen 这种更大的系统……但结果质量无可否认。
SwellJoe查看英文原文
It's interesting to see a somewhat widespread shift away from the separation of code, templates, styles, and text model of publishing things (mostly websites, but most publishing can be boiled down to that if you squint), where code/templates/style get merged into one. React does this. Pollen seemingly takes it even further and sticks the text in the code, too. Or, rather sticks the code in the text, I guess. It's a surprising shift. "Separation of concerns" is still a thing everybody wants to do, it's just flipping the idea of what should be the same "concern", where React considers every piece of a component to be one concern...and, it seems to work. I'm not sure I'm on board with this for writing, but the results certainly do look very nice; the books the author has published with Pollen all look gorgeoues and are very navigable. I've been tinkering with Hugo for converting my projects docs to something that isn't in a wiki or a CMS (because I find I dread working with either a wiki or a CMS for large documents). I think it's probably "enough" for all of my needs, so I doubt I'll take the time to learn a bigger system like Pollen...but, it's hard to argue with the quality of the results.
专用标记加后处理能让写作跟上思考,并自动化排版细节。
我是计算机老师,用 Pollen 写作业。它让我用专为这类作业设计的标记语言,以思考速度输入;之后可做各种后处理:语法高亮、把直引号变弯引号但示例代码内不变、题目编号、插入特殊 CSS 让打印页边距好看且标题不和所属段落分页等,几乎不费劲。也很适合在学生学了几个月 Racket 后展示:包括写作业在内,各种有用的事都能用新技能自动化。
alew1查看英文原文
I'm a CS teacher and use Pollen to write my assignments (sample: https://drive.google.com/file/d/0B9DAZWpkQIDuUlA4SU5lcHItRDg/view?usp=sharing). It allows me to type assignments as fast as I can think them, in a specialized mark-up language for exactly the type of assignments I give. I can then apply various post-processing operations (like doing syntax highlighting, converting straight quotation marks to curly but not when inside sample code, numbering of problems, inserting special CSS to make the assignments print with nice margins / without breaking up headings and paragraphs that belong with them, etc.) all with very little pain. It's also neat to show students, after they've spent months learning Racket, that all sorts of useful things -- including the writing of their assignments! -- can be automated with their new skills.
技术文档可探索内嵌可运行示例,而不只呈现静态代码。
我知道这是常态,但有没有人想过:为什么我们仍在传播关于动态程序的静态内容?为什么动态程序片段不能内联运行,哪怕读者用的电脑完全能运行它们?
shalabhc查看英文原文
I realize it's the norm, but anyone wonder why we're pushing around static content about dynamic programs? Why the dynamic program snippets do not work inline, even though the computer you're reading them on is fully capable of running them?
同类还值得读
写书:值得吗?
Writing a book: is it worth it?
Martin Kleppmann(《设计数据密集型应用》作者)复盘写书到底值不值:金钱回报低、耗时极长,但带来了可见度、信任和职业机会。
出版与作家生涯2020 · 642 分 · 287 评4 条写作要点编辑精选写书并不是个好主意
Writing books is not really a good idea
这篇文章讨论靠写书谋生的现实难度,评论区从版税数学、收入预期和写作目标三个角度补充了作者视角。
出版与作家生涯2021 · 577 分 · 609 评4 条写作要点编辑精选如何自助出版一本书:实用资源清单
How to self-publish a book: A handy list of resources
这是一份关于「如何自助出版一本书」的资源清单帖,涵盖从编辑、排版到 ISBN、销售渠道的实操工具与花费。
出版与作家生涯2018 · 558 分 · 88 评4 条写作要点编辑精选我自助出版一本Ruby on Rails书,赚了7万美元
How I Made $70k Self-Publishing a Book about Ruby on Rails
这是一篇 Ruby 开发者自述:他把一套 Rails 性能课程(书+视频+答疑)自出版,一年毛收入约 7 万美元,并总结了选题、定价、营销等经验。
出版与作家生涯2017 · 539 分 · 175 评4 条写作要点编辑精选石黑一雄警告年轻作家因“恐惧”而自我审查
Sir Kazuo Ishiguro warns of young authors self-censoring out of 'fear'
石黑一雄提醒年轻作者因“恐惧”而自我审查,即这条帖子讨论的核心。
出版与作家生涯2021 · 396 分 · 641 评5 条写作要点编辑精选