jazzy icon indicating copy to clipboard operation
jazzy copied to clipboard

Source code alignment issue in swift.

Open vnramachandra opened this issue 8 years ago • 5 comments

Hi Jazzy Team,

We are very much happy on jazzy eased our work for documenting Objective-C and Swift code. We are making use of the awesome features that jazzy offers.

I would like to bring it to your notice on some minor changes with respect to swift code documentation. Please find the attached snapshot herewith which depicts the support needed.

screen shot 2016-06-28 at 5 34 11 pm

Could you please provide support for aligning the text and formatting it to the page fit? Because if you look at the function as attached, it's too long and in order to see the swift code, we need to scroll horizontally to see the full definition, it looks awesome in Objective-C though.

Could you please let us know if this can be addressed in coming versions?

Thank you, Ramachandra V N.

vnramachandra avatar Jun 28 '16 12:06 vnramachandra

Also for reference the link for the docs in the image is:

http://pyze.com/api/iOS/Classes/Pyze.html#/c:objc(cs)Pyze(cm)showInAppNotificationUI:forDisplayMessages:msgNavBarButtonsTextColor:msgNavBarButtonsBgColor:msgNavBarBgColor:msgNavBarCounterTextColor:withDelegate:

agentk avatar Jul 03 '16 01:07 agentk

Based of looking at Apple's new docs (https://developer.apple.com/reference/uikit/uiview/1622418-animatewithduration), they are creating manual line split at render time based on the browser width.

screen shot 2016-07-03 at 11 24 45 am

This is going to be VERY hard to manually recreate at template rendering time unless we know the size of the users browser window. We could make a blanket rule that all Swift function declaration get arguments split across multiple lines, but that would make a mess of a LOT of other declarations.

This will take some more thinking, but the best solution might be a React based theme ala #605.

agentk avatar Jul 03 '16 01:07 agentk

@vnramachandra Have you tried running jazzy with the default theme? How does the output alignment compare? Would this be a better option for you use case?

agentk avatar Jul 12 '16 12:07 agentk

@agentk If I used default theme [apple], the content sometimes get's clipped, so I am using 'fullwidth'.

vnramachandra avatar Jul 18 '16 15:07 vnramachandra

I’ve created a theme that looks very similar to the Apple doc (as of Aug 2016). I actually only changed the CSS, but to make it easier, I went ahead and made it its own theme. You can find it here.

https://github.com/lloydsargent/JazzyThemeMod

It is set to wrap on full words. So you get something like this:

____untitled

agentk: This is going to be VERY hard to manually recreate at template rendering time unless we know the size of the users browser window.

It isn’t “hard” just tedious and a lot of unfun - I had to make my website responsive and, NOT being a CSS guru I did it - but not without a whole lot of profanity. From iPhone to Desktop, it works, but I really do not like CSS.

lloydsargent avatar Aug 17 '16 22:08 lloydsargent