TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Don't write documentation in Markdown

286 pointsby randyzwitchabout 5 years ago

103 comments

dangabout 5 years ago
Concurrent rebuttal thread: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22677970" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22677970</a><p>Follow-up supporting thread with older article: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22677161" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22677161</a>
评论 #22679713 未加载
husarcikabout 5 years ago
This reminds me of a comment on an anti-markdown post I read a few years back.<p><i>&quot;As far as I&#x27;m concerned the best tool for writing documentation is the one that anyone can actually be bothered to use. Markdown might not be perfect but at least it&#x27;s simple and commonly understood so there isn&#x27;t much barrier to writing&#x2F;updating documentation.&quot; - warmans</i><p>[1] <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;programming&#x2F;comments&#x2F;4ck2lu&#x2F;why_you_shouldnt_use_markdown_for_documentation&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;programming&#x2F;comments&#x2F;4ck2lu&#x2F;why_you...</a>
评论 #22679769 未加载
评论 #22676225 未加载
评论 #22680416 未加载
评论 #22675952 未加载
1MoreThingabout 5 years ago
This is missing the point.<p>The goal is &quot;please write your documentation.&quot; What solution has the least friction around that for engineers? Right now, it&#x27;s overwhelmingly Markdown.<p>It&#x27;s not perfect, and often doesn&#x27;t provide the features a technical writer or other content specialist might want, but it handles most use cases and is something developers are willing to write in.<p>So please, write your documentation in whatever you feel like. As long as it gets written.
评论 #22675705 未加载
评论 #22679014 未加载
评论 #22678651 未加载
评论 #22678089 未加载
评论 #22676226 未加载
评论 #22676030 未加载
taylodlabout 5 years ago
Meanwhile programmers are like: Please write documentation! Please. I&#x27;m begging you. Even documentation written in Markdown is better than the nothing that all-too-often gets created.<p>A lot of programmers argue the code is the best documentation. No it&#x27;s not. Source code answers the <i>how</i> and <i>what</i> but it doesn&#x27;t provide any answer to the most important question of all - <i>why?</i><p>Software embodies several architectural and design decisions. What decisions were explicitly made and why were they made? All too often when looking at code I can certainly understand <i>what</i> was done, but it&#x27;s not at all immediately clear as to <i>why</i>.<p>On the teams I&#x27;ve been working with I&#x27;ve gotten them to capture these decisions. It&#x27;s been a great help - sometimes the original implementors can&#x27;t remember why something was done the way it was done - especially when asked three or more years later.<p>Admonishing people to write documentation in Markdown would be a nice problem for me to have. Meanwhile I&#x27;d just like some documentation at all. Please?!
评论 #22680127 未加载
评论 #22684452 未加载
drcongoabout 5 years ago
I can&#x27;t stand reStructuredText, it&#x27;s obtuse. Over the last year or so have converted all of our documentation to Markdown and I couldn&#x27;t be happier about it.
评论 #22675605 未加载
评论 #22675734 未加载
评论 #22675637 未加载
评论 #22678598 未加载
JMTQp8lwXLabout 5 years ago
There&#x27;s hills that seem worth dying on. This doesn&#x27;t seem to be one of them. The author says it&#x27;s &quot;tolerable&quot; to use markdown for a README.md, but in many small projects -- that&#x27;s all there is. Besides the code, there&#x27;s the README. When I think of larger open source projects, I don&#x27;t see intricate or excessive usage of markdown. They have full blown websites-- React, Jest, Material UI-- you name it. I don&#x27;t see a single actual example of the problem.
评论 #22676230 未加载
评论 #22676254 未加载
评论 #22677713 未加载
lhorieabout 5 years ago
This is committing a fallacy I see far too often at my company: that because something is considered &quot;technically superior&quot; it should be the tool of choice. This misses the human aspect of a system. Markdown has low barrier of entry, and in a world where more often than not, documentation is poor or non-existent, it doesn&#x27;t really matter if a documentation system has many bells and whistles if those features get seen as too difficult to learn and result in no docs being written in the first place.<p>Another important human aspect of documentation is docs are often written by people joining a project late who may already be knees deep trying to understand the projects APIs. Burdening them with learning a documentation system on top of that can definitely a tipping point between &quot;I should document this&quot; to &quot;ah whatever, I&#x27;ll just slog through the code&quot;.
评论 #22678571 未加载
rvzabout 5 years ago
&gt; Developers: reStructuredText is better than .txt and .md because it has feature XYZ, and it&#x27;s special syntax is great.<p>&gt; Researchers: .rst and .md are poor with math symbols, please write the technical documentation in beautiful LaTeX with rendered symbols.<p>&gt; Managers: If I can&#x27;t read or edit it easily, I&#x27;ll hire someone to rewrite it using Word or Google Docs.<p>&gt; Everyone: Here&#x27;s the Word document...<p>&gt; Scribe: 𝔜𝔢 𝔬𝔣𝔣𝔦𝔠𝔦𝔞𝔩 𝔡𝔬𝔠𝔲𝔪𝔢𝔫𝔱𝔞𝔱𝔦𝔬𝔫 𝔰𝔥𝔬𝔲𝔩𝔡 𝔟𝔢 𝔴𝔯𝔦𝔱𝔱𝔢𝔫 𝔟𝔶 𝔥𝔞𝔫𝔡 𝔞𝔫𝔡 𝔰𝔢𝔱 𝔦𝔫 𝔰𝔱𝔬𝔫𝔢 𝔴𝔦𝔱𝔥 𝔭𝔢𝔫 𝔞𝔫𝔡 𝔭𝔞𝔭𝔢𝔯.<p>&gt; Me: Meh. if everyone can&#x27;t read or edit it quick enough towards the deadline, then I&#x27;ll stick to Google Docs.
walterbellabout 5 years ago
AsciiDoc is compatible with Markdown and can generate many output formats, including Docbook and Latex, which enables toolchain reuse. This provides more optionality than RST.<p>The most important property of documentation is existence. Markdown has a low barrier to entry and the markup can later be upgraded to Asciidoc.
评论 #22679523 未加载
Athasabout 5 years ago
While I acknowledge that Markdown&#x27;s lack of extensibility is a big problem, one that RST doesn&#x27;t share, RST has its own problems. For example, this is how you write a link in RST:<p><pre><code> `link text &lt;https:&#x2F;&#x2F;news.ycombinator.com&gt;`_ </code></pre> Obscure, but OK. This is how you put something in monospace:<p><pre><code> ``monospace`` </code></pre> So then how do you make the link text contain monospace formatting? Last I checked, there was no clean way. Using non-matching bracketing characters is a terrible idea because it inhibits nesting, which has been known at least since POSIX shell introduced $(). There is really no excuse for the way RST uses backticks. This is a major reason why I prefer Markdown.
评论 #22675739 未加载
karlicossabout 5 years ago
Not sure about proper documentation, but I&#x27;ve found Org-mode to be quite enjoyable for writing readmes, mainly because of its org-babel [0] (aka executable code blocks) support. That way you can include&#x2F;tangle bits of source code and help strings documentation in the readme, avoiding unnecessary duplication. The results of the evaluation are committed to the repository as well, and it&#x27;s plaintext, so you don&#x27;t need Emacs to fix&#x2F;update the docs -- you can patch up the evaluation results, and the maintainer with Emacs can fix it properly later.<p>E.g. here [1] I&#x27;m reusing the argparse help string in the readme. That makes the source code the primary source of truth.<p>Another experiment I did was writing readme as an Ipython notebook [2], and then compiling the output to markdown. That allowed me to link bits of readme straight to the code. E.g. as an example, each of the &#x27;Features&#x27; [3] links straight to the unit test for that specific feature. The downside is that you need to remember to refresh the readme after code changes, otherwise the line numbers break. Perhaps that can be set up automatically as a CI job.<p>In hindsight through, would have been easier to use org-mode as well to avoid keeping two separate files for the readme.<p>- [0] <a href="https:&#x2F;&#x2F;orgmode.org&#x2F;worg&#x2F;org-contrib&#x2F;babel&#x2F;intro.html" rel="nofollow">https:&#x2F;&#x2F;orgmode.org&#x2F;worg&#x2F;org-contrib&#x2F;babel&#x2F;intro.html</a><p>- [1] <a href="https:&#x2F;&#x2F;github.com&#x2F;karlicoss&#x2F;rexport&#x2F;blame&#x2F;master&#x2F;README.org#L15-L17" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;karlicoss&#x2F;rexport&#x2F;blame&#x2F;master&#x2F;README.org...</a><p>- [2] <a href="https:&#x2F;&#x2F;github.com&#x2F;karlicoss&#x2F;cachew&#x2F;blob&#x2F;master&#x2F;README.ipynb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;karlicoss&#x2F;cachew&#x2F;blob&#x2F;master&#x2F;README.ipynb</a><p>- [2] <a href="https:&#x2F;&#x2F;github.com&#x2F;karlicoss&#x2F;cachew#features" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;karlicoss&#x2F;cachew#features</a>
评论 #22683110 未加载
zelphirkaltabout 5 years ago
I&#x27;d also recommend people to make use of reStructuredText for documentation. Also it is actually possible to write something like a thesis or scientific research in it, where you might need arbitrary linking powers, which you simply don&#x27;t have in Markdown. This can also be important for technical documentation. Furthermore you can add custom roles, like I did for my personal wiki implementation, to link to other pages, which are actually other reStructuredText files.<p>The downside of reStructuredText is, that there are almost no libraries in other languages than Python, which can transform it into HTML for the web. The canonical parser is a custom parser, without grammar and lots of states, which is unfortunate, because if there was a grammar, it could easily be implemented in other languages and the format might be much more used. But perhaps it would not be as extensible then?<p>Another, but quite minor, downside is, that it is a little bit harder to learn than Markdown.<p>Perhaps I can suggest Emacs Org-mode? The downside is, that it&#x27;s only available to the extend in Emacs and other implementations are lacking many things.<p>Anyway, I wrote a thesis in reStructuredText and used Pandoc + custom preprocessing for document internal linking to generate the final PDF version and once I had it set up, it worked great.
oefrhaabout 5 years ago
AsciiDoc is pretty good, yes. But reST? Just no.<p>As a Python developer I’m no stranger to reST, and problems like the inability to nest inline constructs (e.g. [`code`](<a href="https:&#x2F;&#x2F;example.com" rel="nofollow">https:&#x2F;&#x2F;example.com</a>) is impossible in reST) are simply ridiculous. (Talking about docutils here. Maybe there are other unofficial implementations that fix some of the problems, but anything not used by Sphinx is rather useless.)<p>I used to have READMEs of Python projects in reST because of PyPI long_description; those were converted to Markdown soon after PyPI started supporting Markdown. Now I write reST exclusively for Sphinx (mostly in the form of autodoc), but need to check documentation all the time.
评论 #22678693 未加载
dfeeabout 5 years ago
I have documented a moderately complex package in RST [0]&#x2F;[1] and another in MDX (and a mix of MD &amp; JS) [2]&#x2F;[3] and have tons of $company docs written in MD.<p>My thought is that RST is probably closer on the spectrum to LaTeX (despite still being far away) as it’s a more powerful syntax with a more esoteric format.<p>If you’re a sole contributor or want to limit your contributors to those who know or have the patience to learn this, then sure, use RST.<p>Otherwise, documentation is a team sport. Write in whichever format will let people get ideas down fastest and can most easily be coerced it formatted text. Right now, the best option for that is MD.<p>These aren’t algorithms, so trade power for participation.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;dfee&#x2F;forge&#x2F;tree&#x2F;master&#x2F;docs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dfee&#x2F;forge&#x2F;tree&#x2F;master&#x2F;docs</a><p>[1] <a href="http:&#x2F;&#x2F;python-forge.rtfd.io&#x2F;" rel="nofollow">http:&#x2F;&#x2F;python-forge.rtfd.io&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;dfee&#x2F;forge" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dfee&#x2F;forge</a><p>[3] <a href="https:&#x2F;&#x2F;dfee.github.io&#x2F;rbx" rel="nofollow">https:&#x2F;&#x2F;dfee.github.io&#x2F;rbx</a>
GordonSabout 5 years ago
I&#x27;ve been writing all my documentation in AsciiDoc for the past few years, and I love it! As another commenter mentioned, it&#x27;s even compatible with markdown.<p>I previously used Microsoft Word for all documentation, but the lack of human-readable diffs in source control was a PITA, and some features are just much better in IDEs that Word (e.g. search and replace with regex).
kickabout 5 years ago
This person&#x27;s criticism is silly. Markdown documents <i>are</i> extensible: the entire point is that it makes the main parts require less cognitive load, and allows you to use HTML for the rest.<p><pre><code> ## CHAPTER IV. #The &lt;white&gt;Rabbit&lt;&#x2F;white&gt; Sends in a Little Bill It was the &lt;white&gt;White Rabbit&lt;&#x2F;white&gt;, trotting slowly back again, and looking anxiously about as it went, as if it had lost something; and she heard it muttering to itself *“&lt;red&gt;The Duchess&lt;&#x2F;red&gt;! &lt;red&gt;The Duchess&lt;&#x2F;red&gt;! Oh my dear paws! Oh my fur and whiskers! She’ll get me executed, as sure as ferrets are ferrets! Where can I have dropped them, I wonder?”* &lt;gold&gt;Alice&lt;&#x2F;gold&gt; guessed in a moment that it was looking for the fan and the pair of white kid gloves, and she very good-naturedly began hunting about for them, but they were nowhere to be seen—everything seemed to have changed since her swim in the pool, and the great hall, with the glass table and the little door, had vanished completely. </code></pre> Just write the two lines of CSS required for those elements, and bam! You&#x27;re all good!<p>They criticize this within, but their criticism isn&#x27;t particularly strong: sure, the point of Markdown is to write less HTML, but in this instance, the HTML is about as semantically concise as you can get: the quickest solution in any system. Their comment on hybrid documents also doesn&#x27;t really work in the context of most parsers.
评论 #22680229 未加载
评论 #22678715 未加载
arthurofbabylonabout 5 years ago
There’s sentiment here on HN that any documentation is good documentation - and while it is better than NO documentation, it’s just not correct to dismiss truly great documentation.<p>For example, Stripe (the workplace of the author) has incredible documentation that single-handedly enabled me to build with it, despite my being a wretched server-side developer.<p>That the documentation alone doubled the potential user-base, thus fostering growth and engagement with the product, is a testament to the power of great document versus just documentation.<p>V1 docs in markdown - fine. But V2 for an ambitious tool should probably start approaching what Stripe is accomplishing.
评论 #22683516 未加载
评论 #22676606 未加载
评论 #22681693 未加载
virtualritzabout 5 years ago
I&#x27;ve been using ReST w. Sphinx since years and it&#x27;s not the answer either.<p>Consider this simple fail of nested styling:<p><pre><code> *I am italic but also **bold**.*. </code></pre> This produces (all in italics but lacking any bold text):<p><pre><code> I am italic but also **bold*.* </code></pre> If you assumed asterisks could be stacked; nope:<p><pre><code> *I am italic but also *bold*.*. </code></pre> Produces (all in italics but lacking any bold text):<p><pre><code> I am italic but also *bold.* </code></pre> ReST&#x2F;Sphinx can&#x27;t do this. Doh! Because of this you can also not have styling in e.g. link texts etc.<p>These limitations seem unnecessary and random. For example, when the parser handles a table, which is also just marker symbols for cells, you can have styled text or links in the cell&#x27;s text. Why this works but nesting styles doesn&#x27;t is completely beyond me.
goodSyntaxabout 5 years ago
Rust documentation uses markdown and it is amazing. Not sure what this person is on about. Everyone also knows Markdown very well. Also, if you are trying to color certain parts of your documentation blue, I think you&#x27;re focusing on the wrong things.... Documentation should be about example code, which is perfectly fine in Markdown, you simply go:<p>```code &lt;example&gt; ```<p>Also I don&#x27;t agree with the author&#x27;s points about links in Markdown whatsoever.
评论 #22680857 未加载
paultopiaabout 5 years ago
This seems quite silly. As many other people have said in these comments, RST is an obscure mess. By contrast, Markdown is supported by every editor, every static site generator, countless other applications, and is trivial to learn and to use.<p>Also silly is to complain about stuff that everyone uses, like tables, not being part of the markdown spec. We have amazing tooling around markdown, like pandoc, who cares whether it&#x27;s part of the spec?
h3raldabout 5 years ago
I beg to (partially) disagree... (shameless plug ahead!)<p><a href="https:&#x2F;&#x2F;h3rald.com&#x2F;hastyscribe&#x2F;HastyScribe_UserGuide.htm" rel="nofollow">https:&#x2F;&#x2F;h3rald.com&#x2F;hastyscribe&#x2F;HastyScribe_UserGuide.htm</a><p>OK, you are right that <i>ordinary</i> markdown is insufficient because a lot of functionalities are missing for proper technical writing and above all proper content reuse...<p>That&#x27;s why in my tool I started from an already fairly-advanced Markdown flavor (Discount) which already comes with a bunch of proprietary extension... then on top of that I added things like snippets, transclusions, fields, and even simple macros.
thangalinabout 5 years ago
My blog dives into Markdown, Pandoc, R, bash, and the ConTeXt typesetting engine.<p><a href="https:&#x2F;&#x2F;dave.autonoma.ca&#x2F;blog&#x2F;" rel="nofollow">https:&#x2F;&#x2F;dave.autonoma.ca&#x2F;blog&#x2F;</a><p>Part 8 (coming soon!) uses annotated Markdown to reproduce a famous poem (original is on the left):<p><a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;idV1mTM.png" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;idV1mTM.png</a><p>The text of the poem is written in Pandoc-flavoured Markdown:<p><pre><code> ::: poem Some say the world will end in fire, Some say in ice. From what I’ve tasted of desire I hold with those who favor fire. But if it had to perish twice, I think I know enough of hate To say that for destruction ice Is also great, And would suffice. ::: </code></pre> &gt; Markdown is good for generating HTML and terrible for making PDFs.²<p>Yes, Pandoc is essential for transforming Markdown into beautiful PDF files. Tooting my own horn a little more, my illustrated photobook, Impacts, is written almost entirely in pure Markdown, with a few annotations for plots and spectra:<p><a href="https:&#x2F;&#x2F;impacts.to&#x2F;preview.html" rel="nofollow">https:&#x2F;&#x2F;impacts.to&#x2F;preview.html</a><p>Tangentially related, what would be amazing is a robust text editor that allows injection of interpolated string variables from various data sources and structured data formats. Here&#x27;s an architecture diagram to clarify:<p><a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;8IMpAkN.png" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;8IMpAkN.png</a><p>My open-source editor, Scrivenvar (<a href="https:&#x2F;&#x2F;github.com&#x2F;DaveJarvis&#x2F;scrivenvar" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;DaveJarvis&#x2F;scrivenvar</a>), implements that architecture to some extent.
soulnothingabout 5 years ago
I&#x27;m a big proponent of contract and document based development. Easing on boarding, and correlating the current architecture with active documentation. I usually keep software centric, in git along side the code.<p>Coming from Python I was a big fan of sphinx. With Graphviz we were able to embed flow charts of micro services. It worked very well. There are a number of extensions made it very powerful.<p>I switched because it felt close to markdown but not markdown. I now use docsify[0].js. There are a few things I miss. But it&#x27;s an easier transition as my docstrings are also markdown. So no context switching.<p>Markdown is very bare. But that I feel keeps the documentation simple. With less knobs to twist, the documentation has less accents to it. With that limited range I feel it&#x27;s more important to have a style guide.<p>[0] <a href="https:&#x2F;&#x2F;docsify.js.org&#x2F;#&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docsify.js.org&#x2F;#&#x2F;</a>
nnqabout 5 years ago
...Org mode anyone? <a href="https:&#x2F;&#x2F;orgmode.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;orgmode.org&#x2F;</a>
chubotabout 5 years ago
The best part of Markdown is that you can embed HTML, and the author gets it wrong by saying you can&#x27;t mix the two freely.<p>In CommonMark (and thus most modern Markdown implementations) you can embed Markdown in HTML like this:<p><pre><code> &lt;table&gt;&lt;tr&gt;&lt;td&gt; *This is markdown* &lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;table&gt; </code></pre> You need blank lines before and after the tags.<p>I think you could do this in markdown.pl but there were some quirks&#x2F;limitations.<p>----<p>Related: <i>CommonMark is a Useful, High-Quality Project</i><p><a href="http:&#x2F;&#x2F;www.oilshell.org&#x2F;blog&#x2F;2018&#x2F;02&#x2F;14.html" rel="nofollow">http:&#x2F;&#x2F;www.oilshell.org&#x2F;blog&#x2F;2018&#x2F;02&#x2F;14.html</a>
csoursabout 5 years ago
Invoking Cunningham&#x27;s Law:<p>Appeal to Mundanity: I&#x27;ve supported dozens of systems over the last 15 years, here are my opinions:<p>The best documentation is the implementation.<p>The second best documentation is any documentation at all.<p>The better you reveal your implementation, the better your documentation.<p>If you want to improve your second best documentation, knock yourself out. Concentrate on documenting interfaces and the location of your primary documentation (the source code, settings, etc)<p>If you want to bikeshed your second best documentation, I&#x27;m afraid I&#x27;m just going to laugh at you.
luckyorlameabout 5 years ago
Please don&#x27;t write &quot;Please don&#x27;t write your documentation in Markdown&quot;
bjoliabout 5 years ago
XML solves these problems a long time ago. It has been abused so much that people don&#x27;t consider it anymore, but I have been using 2 personal DTDs since about 2005 and I have been laughing every time people have complained about whatever shortcomings their markup language of choice has.<p>you can use any programming language to work with it, and using scheme and SSAX makes even XSLT a breeze.
ChuckMcMabout 5 years ago
So many re-inventing SCRIBE from the &#x27;80s. Kind of funny actually.<p>In the 70&#x27;s and 80&#x27;s we used ASCII terminals to edit documentation, and only some terminals supported attributes like bold, italic, and underline. But you needed to be able to read it in its &quot;raw&quot; form.<p>So there were many systems developed that let you put the &quot;markup&quot; inside the document and keep it as reasonable as possible. The one I wrote a number of term papers in was SCRIBE that ran on the TENEX later TOPS20 machine and put the &quot;final&quot; output to a Diablo Hytype printer.<p>Consider that you had a team of 20 software developers working to build a software package for writing text documents that could both be read when being created&#x2F;edited and later processed into beautifully typeset documents using a film typesetter.<p>This in contrast to a developer saying &quot;hmm I&#x27;m putting up all this stuff in HTML and typing too much, I&#x27;ll add a few shortcuts here, here, and here. Ta da! It works for me.&quot;<p>The availability of cheap dot matrix displays and &quot;desktop publishing&quot; set aside all those goals of editing with a text editor and instead using &quot;WYSIWYG&quot; environments of increasing complexity and bloat.<p>I applaud the reStructuredText people for wanting to attack the problem but I really wish they could look at what has already been done in this space to avoid the mistakes of the past. A version of SCRIBE that was UTF-8 clean would be pretty awesome as a starting point.<p>In my own workflow I find working in text faster because if I use a WYSIWYG editor I get so distracted by it looking &quot;wrong&quot; that I can&#x27;t focus on the text itself. I would truly love something that was TMWYW (tell me what you want) rather than something that keeps trying to show me what it thinks I want.
评论 #22681251 未加载
gravypodabout 5 years ago
Many people I&#x27;ve worked with in the past have unfortunately shared the sentiment of the author. I think the issue is sustainability of documentation practices. There&#x27;s a desire path that engineers exhibit when writing docs. We just want to write something and have others be able to read it. Markdown is the lowest barrier of entry because, even without any special characters, my plain text will look &quot;fine&quot; in Markdown. Nothing is truely required.<p>To me the two most important things are:<p>1. Docs are tracked with software updates (track in VCS)<p>2. Enable me to spend less time writing docs and more time writing code<p>Google documented their experiments with markdown documentation here: <a href="https:&#x2F;&#x2F;www.usenix.org&#x2F;sites&#x2F;default&#x2F;files&#x2F;conference&#x2F;protected-files&#x2F;srecon16europe_slides_macnamara.pdf" rel="nofollow">https:&#x2F;&#x2F;www.usenix.org&#x2F;sites&#x2F;default&#x2F;files&#x2F;conference&#x2F;protec...</a>
oweilerabout 5 years ago
With Pandoc you can easily generate LaTeX from Markdown and then turn that into a PDF. This gives you best of both worlds.
评论 #22676911 未加载
评论 #22675696 未加载
biggestlouabout 5 years ago
I implore you: do not use anything but Markdown in environments where software engineers will be writing and maintaining the bulk of the documentation. I once worked on the docs team for a large org that used rST&#x2F;Sphinx. Engineers complained incessantly and it was a constant struggle to cajole them to keep docs up to date.<p>My experience suggests unambiguously that engineers will not take the time to learn a different markup format. They will spend hours or days or weeks learning a new language, deployment tool, protocol, library, etc. But in most cases they will simply refuse to spend one iota of time learning documentation tools. If you think I&#x27;m wrong, try making it your day job to get engineers to write rST (or Asciidoc or anything they don&#x27;t already know).
评论 #22681501 未加载
ceejayozabout 5 years ago
&gt; What if you want to have some things in the documentation be colored blue? You can’t!<p>Maybe that&#x27;s good, though. &quot;Blue&quot; isn&#x27;t semantic, either.
ComputerGuruabout 5 years ago
RST is terrible. The idea is great, but the ball was dropped on the execution.<p>We switched to restructured text for fish, and I remember the insane loopholes I had to jump through to render the markdown equivalent of `followed by a trailing space ` because Sphinx absolutely insisted on eating that trailing space.. and there’s no way to actually explicitly define an inline code block so I could bypass the abstraction (whereas with Markdown I could always just insert a code element).<p>And don’t get me started on the inability to nest markup. What a joke. You can’t bill something as a “more legitimate documentation language” when you’re not even at feature parity with Markdown.
评论 #22681510 未加载
anonuabout 5 years ago
Most people will agree documentation is hard and painful. Engineers like to build and have someone else maintain and support. Im talking in generalities - so don&#x27;t get too offended if thats not you.<p>So it follows that you should reduce the critical path to documentation down to the path of least resistance. Markdown tools are plentiful. If you use GitHub, it is the core of their project management tools.<p>Also, you want documentation to be a &quot;living &amp; breathing document&quot; - in the sense that it should be updated and modifiable by everyone. A LaTeX-like solution doesn&#x27;t lend itself easily to collaborative work.
johnminterabout 5 years ago
Use what works for you and we will use what works for us.<p>Markdown is a great tool for documentation, especially using tools like RStudio and Rmarkdown. These tools typically use pandoc under the hood to let an author generate whatever they need - HTML, PDF, Word documents, Power Point slides...<p>Because Markdown (and the tools mentioned above) produces a text document, this plays well with version control using git and github. Indeed github renders markdown files in the browser. These tools have been embraced by scientists who want to generate reproducible documents.
lucideerabout 5 years ago
I was unconvinced going in, but this is a compelling piece. Not dogmatic, very open to various alternatives. Highlights their advantages and Markdown&#x27;s disadvantages without becoming laborious.
staredabout 5 years ago
<i>Sigh</i>. Markdown is &quot;good enough&quot;. If it helps writing documentation, it is a good tool.<p>What I struggle with is documentations that are incomplete (e.g. miss crucial, &quot;obvious&quot; installing steps), out-of-date, or incomprehensible. Often external contributors help (especially newbies), as they look at your project with a fresh eye, taking nothing for granted.<p>If for a given project .rst is better than .md, cool. And if you generate HTML from it, end-users won&#x27;t care what was your base format.
eeZah7Uxabout 5 years ago
Markdown and reStructuredText are very limited, and the latter is awkward and unfriendly.<p>Use AsciiDoc. It scales up to entire books. It&#x27;s extendable by design.<p>It supports embedding diagrams, maths &amp; so on.
评论 #22678703 未加载
kvzabout 5 years ago
I love Nix but even their core contributors agree the available documentation and broader information in the form of blog posts and tutorials in the ecosystem is subpar. I think the refusal to use Markdown and hence profit from more contributors is a big factor there. Sometimes it’s good to be a purist, and it has gotten Nix where it is today, but hanging on to ‘superior’ documentation formats can hurt growth and a dash of pragmatism would really help.
gfioravabout 5 years ago
It&#x27;s never the best standard that wins, it&#x27;s the most convenient.<p>Figure out how to parse .md (or whatever is the standard) instead of pretending others switch to your standard.
rikrootsabout 5 years ago
Many years ago I made the mistake of documenting my Javascript library thing by building static web pages to explain it all. They became a nightmare to maintain, and made me scared to update anything in my library thing because it meant having to fix the web pages too.<p>A while later, during a significant recode exercise, I tried a different solution. Inline code documentation with YUIDoc - which was much better. Except YUIDoc assumes people are writing their Javascript in an Object Oriented way. My library thing didn&#x27;t have a single class in it. The generated documentation just didn&#x27;t make sense ... but by the time I realised this I had almost completed the documentation exercise and wasn&#x27;t going to waste the work. So I also updated the static web pages too (finally!) and presented both sets of documentation on the Javascript library thing&#x27;s website.<p>The thought of having to document changes and updates in two sets of documentation stopped me working on my Javascript library thing for over TWO years.<p>Last year, when I made the decision to rewrite my Javascript library thing from scratch, I also made the decision to dump all the documentation. Instead I wrote it as inline comments in simple Markdown - the most basic flavour available - and used a tool to auto-generate documentation from that (I&#x27;ve ended up using docco - it does the job).<p>Dumping all the documentation baggage has made me massively happier, and given me renewed love for working on my Javascript library thing.<p>... As for project runbooks? I write them in Google docs. If a client ever demands to see their project&#x27;s runbook (please God no!), I can create a PDF of the latest version and email it to them.
myu701about 5 years ago
I agree with the limitations of Markdown re: it being not great at doing some quality of life things like same-document references or embedding images as base64.<p>I would enjoy those two features, can we add &#x27;em? MD files would basically be able to replace RTFs in all but the older OLE stuff in the latter.<p>But...even though I wish for those two, I have some sense that these things would start us down the slippery slope of bloating markdown to be HTML 2020(TM)
评论 #22675658 未加载
yellowappleabout 5 years ago
&gt; Kidding. LaTeX is extremely powerful but also a nightmare to use and almost impossible to turn into online documentation.<p>htlatex: &quot;Am I a joke to you?&quot;<p>----<p>I can&#x27;t really speak to either rST or AsciiDoc (since I don&#x27;t use either of them nearly enough to be comfortable with their pros and cons), but aside from LaTeX (via htlatex or Pandoc or some similarly-useful way to export to HTML for online use), I&#x27;ve also seen POD (&quot;Plain Ol&#x27; Documentation&quot;) and outright manpages as effective choices here. Both are designed specifically for documentation (in the case of POD, <i>inline</i> documentation), and both are demonstrably able to produce a variety of output formats, including HTML for online use.<p>That said, I also don&#x27;t see why Markdown (or a more robustly-defined version thereof) couldn&#x27;t be used to do the things rST can apparently do, especially when combined with a preprocessor (like what you&#x27;d almost certainly be using when generating documentation from e.g. source code comments like what quite a few modern programming languages support; on that note, quite a few of those languages do use Markdown for inline docs).
tannhaeuserabout 5 years ago
Obviously, the best documentation is the one that exists in the first place, and markdown is a very low-friction way to document things.<p>That said, FWIW, using markdown vs highly &quot;semantically&quot; structured text doesn&#x27;t need to be an exclusive-or choice. Citing from sgmljs.net markdown (markdown-in-SGML):<p>&gt; <i>sgmljs.net Markdown is presented as an application of the SGML SHORTREF feature, which is an SGML mechanism to describe custom Wiki or other domain-specific syntax. Whereas in regular markdown it&#x27;s possible to use HTML markup, in sgmljs.net Markdown it&#x27;s also possible to use SGML markup and other constructs, bringing SGML&#x27;s vast facilities for text organization and processing to markdown in a natural way. [1]</i><p>For example, to annotate HTML&#x27;s text spans semantically with RDFa or whatever, add context-dependent CSS classes, perform transformations, define custom syntax on top of markdown, customize markdown flavours such as github&#x27;s, use text macros, add page boilerplate, etc.<p>[1]: <a href="http:&#x2F;&#x2F;sgmljs.net&#x2F;docs&#x2F;markdown.html" rel="nofollow">http:&#x2F;&#x2F;sgmljs.net&#x2F;docs&#x2F;markdown.html</a> (my site)
umviabout 5 years ago
Markdown is the best. It&#x27;s plain-text, meaning it can be version controlled. You can transform it to other formats with pandoc. It supports most common formatting options.<p>I&#x27;m sorry, but &quot;no color support&quot; is not a compelling reason to switch to something more complicated. Define your own color meta-tag and generate a PDF from the markdown with colors if you care that much.
BeetleBabout 5 years ago
I used to think rst was a great solution. It is in many ways better than markdown.<p>Then I tried using it. For a few years. To be honest, while certainly better than LaTeX and HTML in terms of ease of typing it still felt like typing with road bumps.<p>These days I just use orgmode and then use pandoc to convert to rst for my Pelican blog. It&#x27;s not as powerful as rst but at least it&#x27;s not markdown.
bloakabout 5 years ago
One of the many things that annoy me about Markdown is the complexity of generating it and the difficulty of converting a Markdown document into a normal form. However recently I stumbled across this project:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;bobertlo&#x2F;vmd" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bobertlo&#x2F;vmd</a><p>I&#x27;ve not tried it, but it sounds interesting.
paulsutterabout 5 years ago
Good documentation is whatever actually gets written. This reminds me of all the “semantic web” dreams that never happened.<p>&gt; Good documentation is all about the semantic markup. A “definition” is not just a different formatting or like. It means there’s actually a concept of a “definition” as a discrete concept in your documentation.
评论 #22675873 未加载
jkingsberyabout 5 years ago
As others have said... if you have extra time to optimize how you write documentation, fine, but just get something written. Actually... if you have extra time, take the time to write your documentation <i>well</i> - make it clear, consider who the audience is, spend some time thinking about how to organize the information, and so on. If you <i>still</i> have extra time, then it&#x27;s time to worry about latex vs. xml vs. html vs. plain text vs. Word vs. Wiki vs. RTF.<p>The company I work for has a wiki that most teams use for documentation, and that generally works pretty well - for most uses, you can use the WYSIWYG editor, and if you need something more precise you can use the wiki text editor.
Nikskoabout 5 years ago
The answer, as always, is that it depends.<p>If you need to make some scribbles to describe a project, markdown will do. All of the things in this article are valid, but they&#x27;re really don&#x27;t apply to barebones documentation.<p>If you need some more formatting and bells and whistles, then you graduate to something that supports macros and a is a more fully fledged tool (eg. Hugo). These tools solve these problems, while (generally) keeping the user-friendliness of markdown. At least if you build some sort of complex behemoth of a publishing system with macros and custom styling and all sorts of things, if somebody needs to make a small content change, you using markdown will be a saving grace.
d_burfootabout 5 years ago
I don&#x27;t have a strong opinion about the base format, but one of my strongest technical opinions is that all documentation should be computable - that is, it should be generated by a program that&#x27;s linked together with the code it&#x27;s describing. You should reference particular code structures in the docs, and if the docs gets out of date it should <i>break</i> so that you&#x27;re not lying to the reader about what&#x27;s going on. Depending on how deep you want to go, you can also interact with the base code a bit in the doc-generator, showing particular input&#x2F;output results, or show a few records from a DB table, etc.
manigandhamabout 5 years ago
Any documentation is better than none, so whatever is easiest is the best. And currently that&#x27;s Markdown. RST isn&#x27;t even close.<p>Most projects don&#x27;t need anything more than the headings, lists, paragraphs, and code-blocks anyway.
simiasabout 5 years ago
I thought that the author would make the case that technical doc should we written in some semantic format that could then easily be re-processed for various use cases which I could sort of understand (although any doc is better than no docs, so if Markdown helps with that I&#x27;m all for docs.md).<p>But &quot;my markup language is better than your markup language&quot; is not very productive IMO. The fact that markdown lacks some advanced formatting tools might even be considered a feature, it means that it will render correctly when converted to monochrome output for instance.
threatofrainabout 5 years ago
How about MDX (Markdown + JSX)?<p><a href="https:&#x2F;&#x2F;mdxjs.com" rel="nofollow">https:&#x2F;&#x2F;mdxjs.com</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;mdx-js&#x2F;mdx" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mdx-js&#x2F;mdx</a>
jasonvabout 5 years ago
Anyone have recommendations on how to write a really structured book? I&#x27;ve been working on a text and I really want each section of chapters to be formatted identically, but also be editable, so that I can edit the chapter definitions, re-publish and merge with content I&#x27;ve already been working on.<p>Sometimes I go into a tool like Airtable to define content pieces, but there are a lot of pieces.<p>What I&#x27;m looking for is a way to define a chapter&#x2F;sub-chapter recipe and work on iterative changes to content even as I refine the recipe definitions.
评论 #22679034 未加载
评论 #22677053 未加载
评论 #22680447 未加载
评论 #22676235 未加载
评论 #22675917 未加载
binarycrusaderabout 5 years ago
The wonderful markdeep addresses many of the author’s concerns:<p><a href="https:&#x2F;&#x2F;casual-effects.com&#x2F;markdeep&#x2F;" rel="nofollow">https:&#x2F;&#x2F;casual-effects.com&#x2F;markdeep&#x2F;</a>
gjvcabout 5 years ago
I&#x27;ll use whatever I damn well please. Don&#x27;t tread on me!
lajrabout 5 years ago
I think the limitations of markdown make it great for README documentation. It allows uniform, easy-to-parse instructions on how to use any repository. I don&#x27;t even necessarily agree in terms of full documentation sites. Services like Gitbook or libraries like Gatsby allow you to set up great documentation sites using markdown. The points made about each unique syntax requiring it&#x27;s own parser doesn&#x27;t seem like a significant obstacle to me.
glofishabout 5 years ago
I tried reStructuredText and I found that writing hyperlinks was very tedious and ugly. Here is the example from the tutorial<p><pre><code> External hyperlinks, like `Python &lt;http:&#x2F;&#x2F;www.python.org&#x2F;&gt;`_. </code></pre> Look at how many special characters it needs and how interferes with reading.<p>I found it annoying and tiring to write and to read. It is the main reason I went with Markdown.<p>RST may be superior technology-wise but it inferior when it comes to usability
评论 #22681534 未加载
anderspitmanabout 5 years ago
While making my blog browsable with curl[0] recently, I realized that I haven&#x27;t been appreciating the human-readable aspect of Markdown. Text-heavy content doesn&#x27;t always need another layer of abstractions (HTML&#x2F;CSS&#x2F;JS), nor the huge dependencies that come with them (browsers).<p>[0] <a href="https:&#x2F;&#x2F;anderspitman.net&#x2F;17&#x2F;#curlable" rel="nofollow">https:&#x2F;&#x2F;anderspitman.net&#x2F;17&#x2F;#curlable</a>
k__about 5 years ago
Back in the days we used DocBook for documentation, because it&#x27;s medium independent.<p>When I read that AsciiDoc is a Markdown-like syntax for DocBook, I was instantly sold.
dmitshurabout 5 years ago
I’m glad there are some languages that define a simple convention for writing documentation as comments in code directly above the symbol, and tools for automatically extracting and displaying that documentation.<p>I prefer knowing where to look for documentation in any project, rather than having to guess where some Markdown or HTML or RST files might be, separated from code.
ashildrabout 5 years ago
I and my team use two tools for documentation: - markdown (+ plantuml), because that’s plainext with not enough rules to bother them and keep them away from what they actually want to do. And it can do tables. - LaTeX, because if you already decided to do it properly and put away the IDE you can use the <i>big</i> tools and not something in between
nobodywillobsrvabout 5 years ago
What I really want is a Makefile that is also Markdown.<p>So something with runnable (singleton) entry points and some english sentences giving context.<p>This is what I typically do for small experiments that I will completely forget about.<p>Too many IT folks do work and leave the running-entry-point and build-dev-loop as secret shadow workflows. It is basically fraud or stealing if you are an employee.
markus_zhangabout 5 years ago
To be serious, anything but Confluence. I have had enough with that and have to continue endure its existence for many more years. I use RST when I&#x27;m programming in PyCharm (support out of box I think), and use MD in other places.<p>BTW I think Typora is a nice MD tool as it supports copy-paste of screenshots, extremely useful when writing tech documents.
评论 #22680468 未加载
savhabout 5 years ago
Obviously well written documentation is never easy and documentation format also depends on use case. For most of my needs Markdown is good enough. It&#x27;s easy to learn, easy to use and well supported.<p>I like to think that its simplicity (or lack of features) forces me to just focus on simple text to write easy to understand documentation.
arkanciscanabout 5 years ago
Please don&#x27;t write long articles about why people shouldn&#x27;t do something you don&#x27;t like on the Internet.
rs23296008n1about 5 years ago
Mixed feelings about markdown. I think its great but the number of dialects is likely a possible issue. Perhaps a linter or sanity checker is required? Tables are an example, but no reason to dump markdown.<p>But I&#x27;ll still write markdown since its easy to generate and relatively easy to transform into a lot of something else.
madsbuchabout 5 years ago
I wrote my entire thesis using markdown as a super set of latex. I agree with the sentiment of the article, that for efficient documentation you need for building blocks. But I am still very happy about using markdown as a super set of other markup languages (HTML, latex, etc.) for friction less prose writing.
e2e4about 5 years ago
Amount of documentation (comments) still seems to be an open question.<p>e.g. Bob Martin (Clean Code) wrote: &gt; A comment is a failure to express yourself in code. If you fail, then write a comment; but try not to fail. &gt; <a href="https:&#x2F;&#x2F;mobile.twitter.com&#x2F;unclebobmartin&#x2F;status&#x2F;870311898545258497?lang=en" rel="nofollow">https:&#x2F;&#x2F;mobile.twitter.com&#x2F;unclebobmartin&#x2F;status&#x2F;87031189854...</a><p>I use to be proponent of comments throughout the code. But lately, am leaning more and more towards minimization through proper naming, annotation, function design (e.g. no side effects, single functionality).<p>Here are some related materials:<p>A more complete quote from `Clean Code` &gt; Nothing can be quite so helpful as a well-placed comment. Nothing can clutter up a module more than frivolous dogmatic comments. Nothing can be quite so damaging as an old crufty comment that propagates lies and misinformation. &gt; &gt; Comments are not like Schindler&#x27;s List. They are not &quot;pure good.&quot; Indeed, comments are, at best, a necessary evil. If our programming languages were expressive enough, or if we had the talent to subtly wield those languages to express our intent, we would not need comments very much -- perhaps not at all. &gt; &gt; The proper use of comments is to compensate for our failure to express ourself in code. Note that I used the word failure. I meant it. Comments are always failures. We must have them because we cannot always figure out how to express ourselves without them, but their use is not a cause for celebration. &gt; &gt; So when you find yourself in a position where you need to write a comment, think it through and see whether there isn&#x27;t some way to turn the tables and express yourself in code. Every time you express yourself in code, you should pat yourself on the back. Every time you write a comment, you should grimace and feel the failure of your ability of expression.<p>Previous related Discussions on NH: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8073230" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8073230</a> <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8073620" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8073620</a><p><a href="https:&#x2F;&#x2F;softwareengineering.stackexchange.com&#x2F;questions&#x2F;285787&#x2F;clean-code-comments-vs-class-documentation" rel="nofollow">https:&#x2F;&#x2F;softwareengineering.stackexchange.com&#x2F;questions&#x2F;2857...</a>
评论 #22684612 未加载
turbinerneiterabout 5 years ago
Pandoc solves most of the shortcomings of markdown. I&#x27;ve written papers and Thesis with it. The main problem is that it isn&#x27;t standard and some missing features need additional plugins. So your pandoc-flavourved markdown doesn&#x27;t properly render in GitLab&#x2F;GitHub.
jacoblambdaabout 5 years ago
I went into this article fully expecting to disagree but I think it makes a valid point. Plain Markdown definitely has issues that cause me to gripe to no end. These however are mostly resolved via extensions. The author argues that Markdown isn&#x27;t a good choice since it lacks these features without modifying the standard however I don&#x27;t think extensions are too big of an issue.<p>If the extensions are part of the build script for processing the documentation then ultimately the user and consuming developers won&#x27;t notice the difference between this and using another markup language.<p>Hell one of the documentation pipelines I see quite often is the Doxygen + Breathe + Sphynx pipeline. This handles the markdown and offers most of those extensions mentioned by the author out of the box.<p>If your documentation pipeline works well and the user can&#x27;t tell the difference, there&#x27;s no reason to switch. Markdown works and is more elegant to write in than LaTeX and rST by just about every measure in my eyes.<p>One last note is that every markup language has it&#x27;s own special blemishes and issues. LaTeX and rST are very much not immune to this and when it comes down to it, a properly built doc pipeline will cover these up no matter the language.<p>TL;DR: If Markdown is making your life difficult it&#x27;s probably not Markdown that&#x27;s broken, it&#x27;s probably your documentation pipeline.
oplessabout 5 years ago
If you&#x27;re worrying about what format you&#x27;re writing documentation in, I&#x27;d offer the actual motive is that rather than actually writing documentation you’re finding excuses not to write it.<p>Just write a text file.<p>Pretty it up when you’re trying not to think about a problem that you’re stuck on.
hn_throwaway_99about 5 years ago
I feel like an analogous discussion could be &quot;please don&#x27;t serialize your objects as JSON&quot;. But for all its warts and shortcomings there is a good reason JSON has become the format of choice in many domains. The same can be said of Markdown.
评论 #22680168 未加载
david_dracoabout 5 years ago
rst is great because there are tools to handle it installed already on many Linux distributions, such as: rst2html, rst2latex, rst2man, rst2odt ...<p>Many tools that support markdown actually also support rst. For example, write a README.rst on github instead of a README.md.
评论 #22676009 未加载
nilsandreyabout 5 years ago
Please, write your documentation in whatever tool you like, including Markdown, and being Markdown better than others like a word document or directly PDF for accompanying code. If it&#x27;s about a code, better living with him in the same repo.
cestithabout 5 years ago
I tend to use POD, but that&#x27;s from many years in the Perl ecosystem and the tools like pod2man and pod2html that make it so easy to convert. LaTEX or AsciiDOC - or, heck, XML or SGML or DocBook - also work if you need semantic data.
评论 #22676108 未加载
tunesmithabout 5 years ago
I started switching from markdown to asciidoc for my code project documentation, and it was much easier than I expected. For simple docs it&#x27;s almost exactly like Markdown, <i>and</i> its IntelliJ plugin is better, too.
the_arunabout 5 years ago
When we say documentation, it depends on what kind of documentation it is. IMHO Markdown is perfectly alright for API documentation. But are there better tools for that? I&#x27;m finding Sphinx is an overkill.
emmanueloga_about 5 years ago
I agree markdown is not great for documentation. I&#x27;m writing a little site generator for my blog and after exploring a a lot of different options I decided to come up with my own format!<p>XML is a great way to write structured documentation. It is the best option for &quot;mixed content&quot;, that is, content that has character data, optionally interspersed with structured elements. The problem is that most standard XML documentation formats (docbook, dita, etc.) are heavy and most times overkill. I&#x27;m using RelaxNG [2] to create a schema of my custom format document [2], and a bit of XSLT3 [3] to generate HTML5.<p>RelaxNG is great, and pretty easy to use. You can think of it as a &quot;regular expression over trees&quot;. The syntax is pretty intuitive, specially the compact form (there&#x27;s an XML form too). For instance:<p><pre><code> start = element doc { attribute title { text } ?, element p { text } * } </code></pre> ... defines the schema for a document that should have a &quot;doc&quot; root tag, an optional title attribute, and 0 or more &quot;p&quot; elements, that should contain only text.<p>The way I went about it, I&#x27;m just inspiring my format in a small subset of HTML5, plus some tags that I want to use to provide more structured information.<p>XSLT 3.0 came a long way since the version 1.0 that everybody remembers and loathes. Now, XSLT3 has maps, arrays, functions, higher order functions, and all sort of other goodies that people have come to expect from a modern programming language. Yeah, you still need to get pass the XML syntax, but it is not a big deal once you get the hang of it.<p>Finally, writing XML &quot;by hand&quot; is not a big deal neither. I&#x27;m using Emacs with the nxml and emmet [4] package, and I just needed to learn a few keystrokes for doing things like automatically closing tags. Emmet is amazing and fun to use to create small chunks of content at a time.<p>1: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;RELAX_NG" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;RELAX_NG</a><p>2: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;EmmanuelOga&#x2F;39ddb345c2a499690e728e5908e942f2" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;EmmanuelOga&#x2F;39ddb345c2a499690e728e59...</a><p>3: <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;tags&#x2F;xslt-3.0&#x2F;info" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;tags&#x2F;xslt-3.0&#x2F;info</a><p>4: <a href="https:&#x2F;&#x2F;emmet.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;emmet.io&#x2F;</a>
Skunkletonabout 5 years ago
I would rather have markup free documentation than no documentation at all. Many of the documentation markup languages have a pretty significant overhead. There is a reason markdown is so common for docs.
tbergeronabout 5 years ago
This place is becoming a meme of itself more and more each and every day.
评论 #22683133 未加载
评论 #22676174 未加载
samsquireabout 5 years ago
I&#x27;ve written a flat HTML renderer.<p><a href="http:&#x2F;&#x2F;github.com&#x2F;samsquire&#x2F;flat-html" rel="nofollow">http:&#x2F;&#x2F;github.com&#x2F;samsquire&#x2F;flat-html</a><p>Could be an alternative to HTML and Markdown
Guthurabout 5 years ago
We all know it&#x27;s XML but everyone is too scared to admit it.<p>It&#x27;s simultaneously the best and worst tool we have for structured semantically rich information. And unfortunately probably the only one.
movedxabout 5 years ago
I’d say my website, which is a growing knowledge base for CloudOps related matters, works really rather quite nicely: <a href="https:&#x2F;&#x2F;thecloud.coach&#x2F;" rel="nofollow">https:&#x2F;&#x2F;thecloud.coach&#x2F;</a><p>Thanks to MkDocs and the Material theme, as well as plugins and extension, this whole setup looks great and scales really well to any device.<p>I think the author’s article speaks purely to documenting code. I’d say code is much harder to document and I think I’d agree even MkDocs (and the setup I’m using) wouldn’t be good for pure code documentation. But documentation for a project?<p>Nah. You’re completely wrong on this one.<p>Edit: down voting without providing as rebuttal is childish, at best.
jason_slackabout 5 years ago
As a technical writer, I write everything in Markdown.<p>Sure, it could use some features.<p>Does anyone know how a developer could contribute to the markdown standard and code up some desired markdown features?
jeffdavisabout 5 years ago
It&#x27;s two different philosophies of publishing. Markdown mixes style with meaning. Something like latex separates meaning from style.
sagichmalabout 5 years ago
&gt; Markdown is about formatting, not information<p>&gt; Not extendable<p>&gt; Local processing only<p>&gt; HTML Only<p>I don&#x27;t get it. These are all extraordinary virtues of Markdown, not negatives.
评论 #22676850 未加载
dbg31415about 5 years ago
Hey, do you know how few projects have good documentation? Or any documentation?<p>Write it in whatever you want to write it in, just write it.
phy6about 5 years ago
Beware of things that are fun to argue.
l0b0about 5 years ago
Reality check: what is your budget for documentation? &quot;As little as possible&quot; says the vast majority. OK then, Markdown it is. For anyone else, sure, spend a few days setting up LaTeX to actually produce PDFs (no, PostScript is not end user friendly) and a few weeks duplicating the Markdown you already knew how to write because you know ASCII formatting and basic HTML.
mnotabout 5 years ago
And yet, many RFCs are written in markdown now. And variants like kramdown do support semantic markup.
schnableabout 5 years ago
I almost closed this page when he suggested LaTeX. Glad I read the next line :).
teknopaulabout 5 years ago
Pfff. Imagine the state of the github if everybody wrote documentation in HTML.
AzzieElbababout 5 years ago
Markdown, shmarkdown. Just write some documentation please.
paolabout 5 years ago
TL;DR Don&#x27;t use Markdown, use RST (reStrucruredText)<p>My take: meh.<p>RST is very comparable to Markdown, and the article makes almost no mention of why it is better. There is a downside, that it has a learning curve because most people are not familiar with it, whereas almost everyone has already used markdown.
评论 #22676245 未加载
评论 #22676553 未加载
throwaway3563about 5 years ago
Please don’t tell me what not to do, it’s considered harmful.<p>Especially please don’t tell me to ignore an industry standard only to offer some bespoke solution as an alternative.
评论 #22676738 未加载
mcguireabout 5 years ago
Tl;dr: &quot;<i>Good documentation is all about the semantic markup.</i>&quot;<p>Well, ok, I&#x27;ll buy that.<p>&quot;<i>What to use instead: LaTeX. [Just kidding.] A better answer is reStructuredText or RST. [Or AsciiDoc.]</i>&quot;<p>Er, well, ... RST does have extension syntax that allows you some flexibility to use semantic markup, but then the tools all have to understand the extensions you use. LaTeX at least has the ability to define the meaning of your extensions in its own syntax, but that is not all that much fun.<p>Conclusion: Everything sucks. Sorry.
jasonmp85about 5 years ago
Counterpoint: no.
jhokansonabout 5 years ago
Thanks i
exabrialabout 5 years ago
The only problem I see with markdown is the lack of an IETF spec. But then we run into the XKCD problem...
brian_herman__about 5 years ago
Please don&#x27;t make platitudes and decisions for everyone.