HN 写作课

工程师们二十年里聊过的写作。

工程师、作家、编辑和创业者在 Hacker News 上聊了二十年“怎么写”:怎么写得清楚、怎么讲好一个故事、技术文档怎么写、小说和出版是怎么回事。这里把其中关于写作与讲故事的帖子挑出来,配上中文导读、可以直接用的写作要点和评论翻译。

从必读开始
  • 2,600+篇关于写作的 HN 讨论

Writing tips

写作锦囊

正在抽一条写作要点…

Essential

必读 30 篇

在讨论库里看全部精选

编辑精选里 HN 讨论最热的 30 篇,每篇都有中文导读和写作要点。

  1. 正在载入…

Archive

讨论库

按发帖年份分布,点柱子筛选。

排序

    About

    这些讨论是怎么挑出来的

    1. 01

      从全量里捞

      读取 Hacker News 自 2006 年以来的全部帖子,用关键词先捞出 40 分以上、可能和写作有关的约 1.1 万篇。

    2. 02

      只留真正讲写作的

      由 AI 逐条判断是否和写作、讲故事、文风、出版有实质关系,剔除“写代码”“编辑器”这类字面撞车,并分进十个类别。

    3. 03

      提炼可用的要点

      为值得读的帖子写中文导读,提炼 2-4 条可以直接用到自己写作里的要点,并精选翻译 HN 高赞评论。内容由 AI 生成,可能有误。

    写作方法2020keleshev.com

    用 Pandoc、Make 和 Vim 写一本书

    Writing a Book with Pandoc, Make, and Vim

    阅读原文 HN 讨论
    423HN 得分
    60条评论
    4条写作要点

    导读

    作者介绍自己用 Pandoc + Make + Vim 写完整本书的工具链:正文用纯文本 Markdown,格式与排版交给脚本自动生成。对写作者的价值不在于具体命令,而在于它示范了一种「内容与排版分离、构建可重复」的长文写作方式,值得写书或写长报告的人借鉴。

    关键词 写作工作流Pandoc纯文本写作排版

    可以直接用的写作要点

    1. 01

      正文用纯文本(Markdown)写,格式和版式交给工具链自动生成,写作时只专注文字。

    2. 02

      把出书流程脚本化,一条命令就能生成全书,减少手工排版带来的中断和出错。

    3. 03

      表格和图表要克制:只有当信息量少、自上而下读得通、且不会反复改动时才用表格呈现。

    4. 04

      让构建自动化并即时预览,保存即刷新,保持写作的连贯节奏。

    HN 评论精选

    Pandoc 可用自定义过滤器无限扩展,值得写作者投入学习。

    我喜欢看这类文章,因为能看到别人为出书和写文档搭出什么工作流。我以前都不知道 Vim 里有 set virtualedit=all 这个设置!如果你学会用自己写的过滤器扩展 Pandoc(可以用好几种语言写),能做到的事情几乎没有上限。我在已停刊的《Linux Journal》上描述过我为写一本 gnuplot 的书而搭的系统。

    leephillips查看英文原文

    I’m always interested in reading articles like this, as I like to see the setups that people come up with to produce books and documents. I didn’t know about set virtualedit=all in vim! If you learn how to extend Pandoc with your own filters, which you can write in several languages, there is no limit to what you can do. Here’s the description, published in the sadly defunct Linux Journal, of the system I created to help me write a book about gnuplot: https://lee-phillips.org/panflute-gnuplot/

    密集图表与版式设计的写作工具仍是空白,PPT 并不胜任。

    跑个题:我很希望有人谈谈怎么写那种视觉性更强的书——面向商业世界、满是图片、表格和图表。文章第一张截图里那种表格之所以好用,是因为作者不需要反复迭代它、文字很少、信息自上而下流动得很整齐。这很好,但也很基础。看看摩根大通那种PDF报告,想象一下怎么写:页面上怎么布局?怎么让内容适配版式?根本没有网格。现实是人们用 PowerPoint 做这种事,但 PowerPoint 是幻灯片工具,它假定你一页只有几个要点、一两张图。内容一密集,它的短板就非常痛苦。令人费解的是,投入了那么多资源到 CSS/JS 和 Web 开发上,却没人利用这些经验做出一个21世纪水准的写作工具:带版本控制,原始数据、内容输出、格式化与最终出PDF之间清晰分离又相互关联。我漏掉了什么?

    airstrike查看英文原文

    I know this is tangential, but I would love for someone to talk about writing a more visual type of book, full of images, tables and charts for the business world. A table like the one in the first screenshot of this post works well because the author is not repeatedly iterating on it, there's very little text and information flows top-to-bottom very neatly. That's great, but it's also extremely basic. Take a look at something like https://www.jpmorgan.com/jpmpdf/1320605428574.pdf and imagine writing that. How do you lay things out on a page? How do you make content fit a layout? There's no grid. The reality is people use PowerPoint to do that, but PowerPoint is a slide authoring tool that assumes you have a few bullets, maybe one or two images per slide. Dense presentations make its shortcomings obvious and quite painful. It boggles the mind that with all of the resources dumped into CSS/JS and web development in general, nobody has leveraged that experience to build an authoring tool that's 21st-century ready, with version control, with a clear separation but nonetheless linked relationship of raw data, actual content output and formatting and final publishing into PDF. What am I missing? EDIT: one more example for good measure https://www.jefferies.com/CMSFiles/Jefferies.com/files/W%201420%201%20Al%20Noor%20Hospitals%20Group.pdf

    可用 HTML+CSS 加 weasyprint 替代 LaTeX 出 PDF,排版控制更简单。

    甚至可以用 weasy(Python 的 HTML 转 PDF 工具)替代 (Xe)LaTeX。它支持用 CSS 做双栏、自动断字、页码计数和嵌入 SVG。我只需要在 Markdown 文件里加一个带 CSS 的 HTML 头。先用 pandoc 把 markdown 转成 html5 并设置页边距,再用 weasyprint 把 HTML 写成 PDF。对于 LaTeX 风格的数学公式,我在 pandoc 参数里加了 mathjax-pandoc-filter 作为过滤器。

    Klasiaster查看英文原文

    It's even possible to replace (Xe)LaTeX with weasy¹, a Python HTML-to-PDF converter. It supports two-colums via CSS, automatic CSS hypens, CSS page counters and embedding SVGs. I just needed an HTML header with CSS in the markdown file. $ pandoc --filter pandoc-citeproc --csl ieee.csl --bibliography=paper.bib --smart --normalize -f markdown+multiline_tables+inline_notes -t html5 -V margin-top:0.5in -V margin-bottom:0.5in -V margin-left:0.5in -V margin-right:0.5in -o output.html input.md $ python3 -c "from weasyprint import HTML; HTML('output.html').write_pdf('output.pdf', presentational_hints=True)" For LaTeX-style math equations I added mathjax-pandoc-filter² as filter to the pandoc args: --filter ~/node_modules/.bin/mathjax-pandoc-filter -Mmathjax.centerDisplayMath -Mmathjax.noInlineSVG ¹ https://weasyprint.org/ ² https://github.com/lierdakil/mathjax-pandoc-filter

    同类还值得读

    1. 被低估的工程技能:把文章写好

      Undervalued Engineering Skills: Writing Well

      这篇文章讨论为什么“写得好”是被低估的工程能力,以及它如何在团队协作、系统设计和职业发展中持续带来回报。

      写作方法2019 · 1,109 分 · 371 评4 条写作要点编辑精选
    2. 每行只写一句话:让写作和修改都更轻松的排版法

      Writing one sentence per line

      这是 Derek Sivers 的一篇短文,主张写作时每行只放一个句子,而不是按段落排版。

      写作方法2022 · 849 分 · 297 评4 条写作要点编辑精选
    3. 书面沟通是远程工作的超级能力

      Written communication is remote work super power

      这篇文章讨论远程工作中书面沟通的价值,评论区则补充了异步与同步沟通的适用场景,并提醒读者:备忘录、结论先行、结构化命令格式等书面沟通传统早已有之。

      写作方法2020 · 831 分 · 190 评4 条写作要点编辑精选
    4. 如何写出有用的文字

      How to Write Usefully

      保罗·格雷厄姆在这篇文章里给"有用的写作"下了一个可操作的公式:有用≈重要×新颖×正确×清楚,任一项为零,整篇文章就等于零;他还主张敢下确定判断、删掉让自己心虚的句子。

      写作方法2020 · 821 分 · 285 评4 条写作要点编辑精选
    5. 如何写得更清楚、想得更清楚,并学会复杂材料(PDF)

      How to write more clearly, think more clearly, and learn complex material [pdf]

      这份 PDF 讨论如何把文章写清楚、把思路理清楚,并用写作来学习复杂材料。

      写作方法2022 · 779 分 · 153 评4 条写作要点编辑精选

    打赏支持

    打赏二维码

    觉得有用,请作者喝杯咖啡。

    WeChat

    关注向阳乔木

    微信公众号「向阳乔木推荐看」

    微信公众号「向阳乔木推荐看」二维码

    微信扫一扫;在微信里打开本页时,长按二维码识别。