-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdown or rST? #1
Comments
rst seems better suited for spec docs which will likely feature things, such as tables, that md intentionally doesn't support (or requires that you drop down to html to achieve). For reading that probably doesn't matter as the tedious work of generating say a table in html should be entirely automated when building the spec from the implementation. Additionally markdown is clearly favored by github (so e.g. nicer rendering, shortcuts, comments and issues are all .md). For writing it does matter. The idea is for people to edit the markup files directly to show how things should be done and being forced to drop down to html to do basic things is annoying. There are probably tools for markdown that make this easier. If you identify all the structural features you need to support and find that markdown supports them as first class markup elements then it would probably fine. This thread raises may good points of which is preferable, when and why: http://stackoverflow.com/questions/34276/markdown-versus-restructuredtext In this case I think rst should win. |
@whit537 this repo largely came out of a conversation you and I had. Thoughts? |
I am going to basically point to github's own API repo as an example of stuff that can be done with gfm: http://developer.github.com/v3/. After a cursory look, I think they use a static layout file and then pull in .md content. (I may be mistaken). I think it's a matter of goals... my humble, but very opinionated 2cents =) |
for what it's worth, I'm very used to writing gfm for technical prose and api docs, and I have never missed the lack of table syntax. I've had to drop into html maybe a half dozen times, and it was never a pain. also, I sure do like how that github site looks. |
@bcm 👍 regarding "never missed the lack of table syntax". I've dug a bit deeper into how github itself maintains its API docs. So 95% of their docs are written in @matin You and your devs have probably read this thread and may even know better alternatives... |
@alexnotov I'm a supporter of Markdown, especially GFM. I think @mahmoudimus, @bninja, and @msherry need to elaborate on their case for rST. |
I realized that most of my arguments here were a little incohesive, so I've deleted them and added them into one post. First and foremost, I want to stress that there are serveral use cases for the power of reST when designing something like an API spec that has to be self validating. What does it mean to be self-validating? It means that the documentation is auto-generated and checked against the current version of the "master" branch of the API spec (in this case, it's the balanced-api repository). Here are some technical reasons why I think github flavored markdown is a poor choice for auto-generated api specification from python source code:
Given reStructuredText's extensibility, it is clearly superior to add different domains / directives that allow customized rendering of the way the API spec is set for design. It also allows us to keep our API spec in sync w/ the API spec the master branch dictates |
@matin Love the repo, very excited to see this opening up. :-) The primary concern is excellent end-user experience, not tools. In this case, the end-user is the developer who is using the documentation. I'm with @bcm: "I sure do like how that github site looks." Achieving that level of excellence is a function of taste and competence and hard work, which depend primarily on the people doing the work, and not necessarily on the tools employed. However, tool choice can be a barometer of taste and competence, as Linus famously, um, observed. ;-) My personal strategy when I don't feel competent (as here) is to find examples of excellence and attempt to emulate them. In this case I see plenty of people writing reST or even creole, but the user experiences over there are rather more mundane than on GitHub, I daresay. The fact that I think so highly of GitHub in general predisposes me towards GFM, in the absence of a well-formed opinion otherwise regarding structured text formats.
@mahmoudimus Can you help me understand this better? The idea is that the documentation is maintained in a literate style inside docstrings? What does the checking step entail? Are you validating behavior of the API against documented behavior? Or are you validating auto-generated documentation against manually maintained documentation in the balanced-api repo? What does the balanced-api repo contain? Documentation? |
this: "The fact that I think so highly of GitHub in general predisposes me I have zero experience with reST so can't comment on how powerful or easy |
Here are the two arguments I get out of this conversation:
I propose we move forward with rST for all generated content. It allows Balanced to move forward more quickly, and we can revisit later. GFM will be used for all handwritten content like the TOCs in READMEs and proposals inside the repo that are not in GitHub issues obviously. I'm not a huge fan of compromise, or splitting across two different technologies. However, this allows us to move forward. Final thoughts before I close the issue? |
@whit537 @bcm Thanks for your comments! I completely agree with you both, Github's documentation looks awesome. However, I have to ask @matin to elaborate on how he wants to display the API spec before I can discuss this further.
This will help make the goal of this discussion clearer as those two choices will open up other paths of thought. @whit537, as a reference for great, navigatable, aesthetically pleasing documentation written in reST, take a look at Flask's documentation. @whit537, we leverage Sphinx's python parsing tools, extend it to understand our in house tools, and use the auto-doc module to spit out a very maintainable, reflective specification of the current api code. We do not do much manual orientiation for a few reasons:
|
@matin just saw your comments. If you have a moment to answer the two questions I posted above, I'd love to make another point. |
Yes. Definitely.
No. We can publish the docs as a separate repo like GitHub has, but using GitHub for hosting, I believe, limits us to static content, which means no server side search. |
@matin thanks for your comments and clarifications. Since that is what your intention is, it is important to note that the aesthetic pleasing features of Github's API documentation can not be taken into comparison in this discussion, but can be used as a point of reference, since their documentation is generated for a Github page, see https://github.com/github/developer.github.com. Since there's a pre-compilation process to generate this page, Github leverages CSS and many other web-based frameworks to generate their documentation. It is indeed NOT intended for viewing it from a Github repository, see https://github.com/github/developer.github.com/blob/master/content/v3/issues.md#response as an example. Notice the explicit:
If the intention is to leverage Github's repository viewer stands for the balanced-api specification repository, then I believe I've demonstrated enough evidence that GFM does not provide the correct ecosystem to support what we're trying to accomplish. I'd like to also note that Github's TODO in their README states:
The third TODO is particularly what we're trying to solve for. |
@mahmoudimus just to understand clearly. Are you arguing against using a mix of Markdown and rST including for handwritten content in READMEs? Here's an example of someone outside of the Balanced team doing a pull request to manually written content: #4 |
just to throw one more issue onto the table - whatever system you choose, On Fri, Aug 17, 2012 at 10:56 AM, Matin Tamizi notifications@github.comwrote:
|
@bninja wrote an initial version with rST. Can you issue a pull request and reference this issue to provide an example? |
How does this balanced-api repo relate to, e.g., https://www.balancedpayments.com/docs/python? Are they the same or different? |
@whit537 it would be used as the content for https://www.balancedpayments.com/docs/api It would be great to publish the entire docs site on GitHub, especially for tracking the changelog, but we'll have to revisit that later. I really like how GitHub did this for their own docs. |
@matin submitted pull request showing what it would roughly look like using rst |
For now, we'll use rST for all generated content like this, and all handwritten content will be written in GFM. This let's us move forward more quickly, and we can revisit later if necessary. |
I'm closing out #1 and merging this pull request. For now, we'll use rST for all generated content like this, and all handwritten content will be written in GFM. This let's us move forward more quickly, and we can revisit later if necessary.
http://www.sphinx-doc.org/en/stable/markdown.html IT. Sphinx FTW |
Should the API specs for Balanced be written in GitHub Flavored Markdown or reStructuredText?
In creating this repo, we were having an internal debate around whether we should use Markdown or rst. Balanced is a Python shop, and it's considerably easier for us to generate rst. That means it's also easier to ensure validation and consistancy. However, the specs are being written for GitHub, and Markdown is the standard on GitHub.
The text was updated successfully, but these errors were encountered: