@probablycorey and I talked today about API doc generation, here are some thoughts from that conversation.
Doc string changes
Essential / Extended
We decided in the meeting to eschew the Public
designation in favor of Essential
and Extended
labels. So something like this:
# Essential: For each selection, replace the selected text with the given text.
#
# text - A {String} representing the text to insert.
API Sections
We really liked the idea of sections or topics of methods. We propose copying the structure of apple's new API docs.
- All methods would be in sections
- All methods would expand to show the method's doc
- All methods would be collapsed on load unless
#methodName
in the url
- Classes would be on the left side
It might look something like this (envision with atom.io styling):
How to specify the sections in the doc? There are two options. One is to specify the section in the method body itself:
# Essential: Modifying Text: For each selection, replace the selected text with the given text.
#
# text - A {String} representing the text to insert.
Or by grouping methods into the sections in the code, and specifying a sort of section header above that section:
###
Section: Modifying Text
###
I vote for the latter as it will force us to structure methods in a way consistent with the docs, we will repeat less, we can have private methods in the same sections.
Tech
We're using biscotto to generate the metadata, but we need something else to generate the actual doc pages.
We could use ruby to parse the tomdoc, but I think we have enough changes to it (essential, links to other things), that it should be something we control.
I propose we create two new repos (names of these repos can change)
- atom/tomdoc - pull the tomdoc parsing bits out of biscotto and place them into a repo.
- atom/api-generator - coffeescript to consume the metadata and generate a docs site using atom/tomdoc
Let me know what you guys think.