Skip to content
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

How to write documentation? #162

Closed
groue opened this issue Feb 10, 2015 · 6 comments
Closed

How to write documentation? #162

groue opened this issue Feb 10, 2015 · 6 comments
Assignees
Milestone

Comments

@groue
Copy link

groue commented Feb 10, 2015

Which format should we use to document our types and methods?

How can we render:

  • paragraphs
  • lists
  • code blocks
  • links to the internet
  • links to other types and methods
  • bold/italic text ?

Maybe the jazzy README could sport sample Swift and Objective-C code, and a link to the generated documentation. That would be a nice introduction.

Today, I have difficulties having jazzy rendering a honest Swift documentation like the one below.

/**
The Template class provides Mustache rendering services.
*/
public class Template: MustacheBoxable {

    /**
    Parses a template string, and returns a template.

    Since templates usually compile fine, you don't have to explicitly perform
    any error handling:

    ::

      let template = Template(string: ...)!
      let rendering = template.render(...)!

    Eventual partial tags refer to resources with extension ``.mustache`` stored
    in the main bundle:

    ::

      // Uses `partial.mustache` resource from the main bundle
      let template = Template(string: "...{{>partial}}...")!

    :param: string The template string
    :param: error  If there is an error loading or parsing template and
                   partials, upon return contains an NSError object that
                   describes the problem.

    :returns: The created template
    */
    public convenience init?(string: String, error: NSErrorPointer = nil)
@segiddins
Copy link
Collaborator

Have a look at http://nshipster.com/swift-documentation/, it has a nice overview. Otherwise, please be more specific about how what jazzy renders differs from what you were expecting.

@groue
Copy link
Author

groue commented Feb 11, 2015

Thanks @segiddins. I did look at mattt's article.

Let's be specific with, paragraphs, for example. Here is a simple example where jazzy does not render correctly paragraphs:

The doc (https://github.com/groue/GRMustache.swift/blob/faaa1b5e320452a017753108dc9d1221282d0c29/Mustache/Template/Template.swift#L240-L248):

    /**
    The template's base context: all rendering start from this context.

    Its default value comes from the configuration of the template
    repository this template comes from.

    :see: repository
    */
    public var baseContext: Context

Xcode shows two paragraphs:

capture d ecran 2015-02-11 a 06 26 38

Jazzy shows a single one:

capture d ecran 2015-02-11 a 06 29 02

@WCByrne
Copy link

WCByrne commented Mar 12, 2015

Is there a reason that things like :see show up as small text rather than a section like the Apple documentation.

Also it would be great to add a quick example usage and maybe a list of supported markup. The NSHipster article only references :params and :returns. Not sure if any sort of code blocks, See Also, Note, or Discussion are supported. Not sure if I am doing something wrong or it just isn't supported yet.

@jpsim
Copy link
Collaborator

jpsim commented Mar 12, 2015

Is there a reason that things like :see show up as small text rather than a section like the Apple documentation.

That's a rendering issue with jazzy's CSS which we haven't gotten to fixing, though you're welcome to do so yourself. Help is always appreciated 😄.

@WCByrne
Copy link

WCByrne commented Mar 12, 2015

Sounds good. If I get some time I'll play around with it. Thanks

@jpsim
Copy link
Collaborator

jpsim commented Apr 30, 2015

Closing as a duplicate of #77.

@jpsim jpsim closed this as completed Apr 30, 2015
@istx25 istx25 modified the milestone: The Past Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants