-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Convert RST files to Markdown. #246
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
Conversation
@@ -0,0 +1,1176 @@ | |||
orphan | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like detritus from the automatic conversion. You might need to check how other ..
annotations got mangled too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the preferred way to resolve those? Just remove them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paulyoung I think the orphan
directive can just be removed.
When Sphinx builds the RST files into HTML, it emits a warning if it finds any files that don’t appear in the table of contents. The :orphan:
directive suppresses this warning. See Miscellaneous markup.
Some other directives (e.g. :note:
) affect the formatting of a block of text. Perhaps those could be blockquotes with "Note:" written at the top? e.g.
.. note::
This is a note.
becomes:
> **Note:** This is a note.
I'm seeing a couple of similar artifacts that weren't handled well in the conversion, so will address those too. Unfortunately the diff is too big for GitHub, but an example can be seen here. |
Yep, a pandoc conversion is just a starting point; after that, we need to manually fix up the output to look good in GitHub-Flavored Markdown again. There are a few docs that make extensive use of ReST features and we definitely don't want to regress usability for those—possibly even to the point of leaving them as ReST for now. (Why GitHub-Flavored Markdown? Because most likely the most common way to view them will be on GitHub. If we can also get Kramdown compatibility that's great, because that's what our website uses, but that's just a bonus.) |
Could I get some advice on how to convert the following type of thing? .. default-role:: term
.. title:: Library Evolution Support in Swift ("Resilience")
:Author: Jordan Rose
:Author: John McCall |
(I wish GitHub Flavored Markdown supported definition lists in a non-HTML way, but we should probably reformat without them.) |
Speaking of manual links and anchors, I just implemented some of that here. I made some adjustments to respect the existing line limit. If that's not really a requirement anymore, please let me know. |
@jrose-apple please let me know what you think of my efforts here. |
This type of thing is also possible:
but much more code:
when compared to front matter:
|
It is a weekend today. :-) I'll come back and look through this carefully on Monday. Thanks for taking this on! |
@jrose-apple thanks for reminding me 😄 In no way did I expect any immediate feedback. I was actually going to leave this for the day anyway. Enjoy the weekend! |
@paulyoung The YAML front matter is probably preferable – that’s a fairly standard format for specifying info at the top of documents. Markdown tables are just icky. |
All right, I got through the "A" docs and I have a fair number of comments already:
Thanks for taking this on. Since I'm being fairly nitpicky about this conversion, it's okay if at any point you want to set it down and leave it to someone else. Another possibility might be to do this work in a public branch, so that others can help, but leave the main repo as ReST for now so that there remains only one way to build the docs for a normal user. |
@jrose-apple yeah, I really only did some manual work on ABI.md and LibraryEvolution.md up until now. I was actually thinking it may be best to do this one document at a time to make it easier to review. It would also (hopefully) have a shorter turnaround time and reduce the probability of conflicts. How does that sound to you? |
Another suggestion is that it is probably best to tackle one or two documents at a time, to reduce conflicts with other parallel changes to the documents. |
I'm happy to do things that way, but again I don't want to have the master branch have a mix of ReST and Markdown for an extended period of time. If both of you agree I'll make an What do you think? |
@jrose-apple |
I've added the branch. Let's start doing small pull requests there. Thanks, @paulyoung! |
a question: why? rST and ASCIIdoc are due to their extrensible nature a natural fit for technical documentation. creating yet another incompatible dialect of markdown is something nobody wants to see. they easily allow to specify internal links that can be displayed with meaningful formatting, as well as external ones using intersphinx. using rST or ASCIIdoc leads to works of beauty like this. observe how functions, classes, code samples, and links differ visually. using markdown leads to generic, unlinked stuff like this. i want to click on |
Good question. ReST is harder to write*, isn't what we're using for anything else (doc comments, proposals, website), and doesn't buy us much when most people will be reading the docs directly on GitHub anyway, which only supports very basic ReST. Most of the docs don't refer to the stdlib as it is today, nor to each other, meaning auto-cross-linking isn't so useful; they are designs, rationales, notes, and proposals. It'd be a little different if we generated the docs somewhere for people to read, but even then I bet quite a few of them would end up looking at the version on GitHub anyway. * My number 1 pet peeve with ReST is not being able to nest markup easily. Number 2 is that Sphinx exits early if you have any errors in your syntax. |
IMO the main argument for Markdown is that it’s more broadly known and adopted. -Dave |
it’s sad to see semantic information being sacrificed that could have been used to improve quality and visuals. e.g. a i think hosting the docs somewhere different and linking to them from the repo’s readme and all the blog posts and whatever that will undoubtedly refer to them will serve well to make the official location pop up early on google. about rST being hard to write: i only have problems with the inline link syntax, which matter more for things like forums/issue trackers, where you don’t have bigger sections of text with many link targets that are well-suited for the non-inline syntax. and the rest of the syntax is pretty nice, and, like markdown, learnable in a few minutes (“learnable” as in: you grasp enough to make meaningful changes)
oh? that explains why you don’t see the awesomeness that rST has to offer. e.g. here you could have created links with minimal effort once the domain roles for swift were written. instead of |
build: fix typo in build system
build: fix typo in build system Signed-off-by: Daniel A. Steffen <[email protected]>
Update Perfect hash to build against 4.2
As requested by @lattner on the mailing list.
This is currently the result of running the following command in the root directory: