tomaz / appledoc

Objective-c code Apple style documentation set generator.
http://gentlebytes.com
4.19k stars 644 forks source link

Wrong Icons #380

Closed twobitunicorn closed 11 years ago

twobitunicorn commented 11 years ago

File icons are used for classes (and everything produced by AppleDoc) in the "Browse" view of Organizer, yet when searching, they do come up with the class icon "C". Would be super great to have the browse show these also with the class icon. Thanks!

robvdveer commented 11 years ago

Could you post a screenshot of what you mean? The icon is derived from the token identifier of an item and those types shouldn't be changed, or else the quickhelp stops working!

twobitunicorn commented 11 years ago

The command that I am running is:

/usr/local/bin/appledoc --project-name ScratchLibrary --project-company "Test" --company-id com.test --output ${PROJECT_DIR}/Docs --install-docset --docset-platform-family iphoneos --logformat xcode --no-repeat-first-par --no-warn-invalid-crossref --exit-threshold 2 ${PROJECT_DIR}/ScratchLibrary

The image for the browsing view is a file: image

The image for the search view is the class icon: image

robvdveer commented 11 years ago

It is a little confusing that you have a class named exactly as the docset name.. I think the second screenshot 'C' is correct.

robvdveer commented 11 years ago

I look at the specifications, and the Xml node can be file, folder, or bundle. (see http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/Documentation_Sets/810-Documentation-Set_Nodes_Schema_Reference/docset_nodes_schema_ref.html#//apple_ref/doc/uid/TP40005266-CH9-SW5)

The nodes are properly generated by appledoc. That is, the classes, docs, protocols, etc have a 'folder' type node, everything else has 'file' (which is the default). It looks like Xcode is messing things up when you do a search.

robvdveer commented 11 years ago

Not all hope is lost though, we could expand the nodes.xml file so that it includes all the subsections like you see in the screenshot.

organizer_-_documentation

twobitunicorn commented 11 years ago

Sorry, I do not understand. When I do a search, Xcode is doing the right thing. The "ScratchLibrary" is a class, not a file, not a project. So, it should have a "C" class icon. Or, am I missing the point here. Shouldn't classes have the class icon? Sorry, I should have used a different class name than the project. Just the default by creating a new project.

robvdveer commented 11 years ago

I am no expert here. But i read the docset specifications about 6 times now and we're doing it right. I just hope that the documentation itself is correct!

When you do a search, you see your class '(C) ScratchLibrary' under references, and that shows that the page is indeed a class. However, under System Guides it'll come up differently (either as a folder or a file) depending on the references from/to that search topic.

When browsing your own docset (first screenshot) I agree that it should be a C icon. I just don't know how.

robvdveer commented 11 years ago

It's way past my bedtime, but I just had to let you know that i found the fix.

organizer_-_documentation_and_appledoc xcworkspace__nodes-template xml

robvdveer commented 11 years ago

Boy oh boy have i got news for you.

tomaz commented 11 years ago

You should be writing novels - such a sense for suspense ;)

robvdveer commented 11 years ago

Perhaps this wets your appetite for a new pull request?

organizer_-_documentation_and_goodstuff xcworkspace__bounceviewcontroller m

tomaz commented 11 years ago

Sure :)

Was in the middle of an intense debugging session for the project I'm working on all morning here. Was in submarine mode. Finally figured it out, so went and checked emails before plunging in again for the fix :)

twobitunicorn commented 11 years ago

Those screen shots look awesome!

robvdveer, If you send me your patch I can put it through its stretches.

robvdveer commented 11 years ago

I'll probably push the commit in about an hour, i need to do some final tweaks. But first i need a little rest

robvdveer commented 11 years ago

@twobitunicorn, check my pull request for the patch.

Read my blog entry here to read up on what I had to go through to solve this.

tomaz commented 11 years ago

Ah, this brings memories to time I was studying DocSet documentation :) Good work!!

robvdveer commented 11 years ago

It feels good to slash bugs

twobitunicorn commented 11 years ago

Rob: Thanks for looking into this. However, I am still having an issue. The example class ScratchLibrary no longer has the Folder icon, but now has a Section icon. I am not sure it why it is not being picked up as a Class. Attached screenshot shows this.

image

Here is the .h content:

#import <Foundation/Foundation.h>    

/** This is a test class.
*/
@interface ScratchLibrary : NSObject 
@end

And the corresponding .m:

#import "ScratchLibrary.h"    

@implementation ScratchLibrary
@end

I have tried this on a larger project and get a mixed bag of Folder and Section icons for classes. Should we reopen this issue?

Thanks again!

robvdveer commented 11 years ago

It is marked a section because the class has neither properties or methods.. It's an edge case really, and probably an easy fix too. You can make a new issue out of it, but as soon as you add members it will become a class icon.

EDIT: if you are seeing mixed FOLDERS for class nodes, you are probably in the search pane, because i know this code. Send me a screenshot of that too please. — http://simplicate.weebly.com

On Wed, Jul 31, 2013 at 10:22 PM, twobitunicorn notifications@github.com wrote:

Rob: Thanks for looking into this. However, I am still having an issue. The example class ScratchLibrary no longer has the Folder icon, but now has a Section icon. I am not sure it why it is not being picked up as a Class. Attached screenshot shows this. image Here is the .h content:

#import <Foundation/Foundation.h>    
/** This is a test class.
*/
@interface ScratchLibrary : NSObject 
@end

And the corresponding .m:

#import "ScratchLibrary.h"    
@implementation ScratchLibrary
@end

I have tried this on a larger project and get a mixed bag of Folder and Section icons for classes. Should we reopen this issue?

Thanks again!

Reply to this email directly or view it on GitHub: https://github.com/tomaz/appledoc/issues/380#issuecomment-21892425

twobitunicorn commented 11 years ago

Attached is the screen shot. This is part of the Appledoc source code. The red oval a class with the File icon. The orange oval is a class that is has the section icon. This class has no methods declared in the header file. I have modified the source code to take into account that empty classes are still classes, but could not get it to produce the class icon. No matter what I do, I cannot get any class to have the class icons. Even those with methods. Both, however do show up as with class icons in the search pane.

image

robvdveer commented 11 years ago

First, thank you for regressiontesting this stuff. Did you update the template files? XCode reset? When searching, the token class is used (for C icon). In tree mode (last screenshot) the node type is used (believe me!). Somehow, the node type is set to 'reference', but not the documentType. Very strange because the behaviour i see touches both the last code and the templates. I'll get on it tomorrow, now it is bedtime

robvdveer commented 11 years ago

I have modified the source code to take into account that empty classes are still classes, but could not get it to produce the class icon

Perhaps show me what you changed, its impossible for me to track bugs if you modify my logic!

robvdveer commented 11 years ago

I've looked into your folder/icon stuff, and this is what I get by documenting the appledoc sources after a little refactoring of the code. Note that I had to reload XCode for the Class Icons to appear.

organizer_-_documentation

Looks ok to me, search too:

organizer_-_documentation_and_appledoc xcworkspace__appledoc xcodeproj

I'll push the latest to my repo (https://github.com/robvdveer/appledoc) changes for you to review. EDIT: I'm using OS X 10.6.4 and XCode 4.6.3

robvdveer commented 11 years ago

@twobitunicorn : check issue #385, i think that is what happened to you. You rm -rf ~/.appledoc and run appledoc again, xcode restart and your issues should be fixed.

twobitunicorn commented 11 years ago

No problem. Thanks for looking into this! I did an Xcode reset, but not the template files. Let me give that a try later.

On 31.07.2013, at 14:15, robvdveer notifications@github.com wrote:

First, thank you for regressiontesting this stuff. Did you update the template files? XCode reset? When searching, the token class is used (for C icon). In tree mode (last screenshot) the node type is used (believe me!). Somehow, the node type is set to 'reference', but not the documentType. Very strange because the behaviour i see touches both the last code and the templates. I'll get on it tomorrow, now it is bedtime

twobitunicorn commented 11 years ago

I set the data to be a file type and then check for the the number of methods and removed the backup setting to a section type.

robvdveer commented 11 years ago

As a dedicated follower of Professional Excellence And Pride, I aim to please. Grin. — http://simplicate.weebly.com

On Fri, Aug 2, 2013 at 12:04 AM, twobitunicorn notifications@github.com wrote:

@robvdveer: Out of the ballpark! Working great now! On 01.08.2013, at 10:54, robvdveer notifications@github.com wrote:

@twobitunicorn : check issue #385, i think that is what happened to you. You rm -rf ~/.appledoc and run appledoc again, xcode restart and your issues should be fixed.

— Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub: https://github.com/tomaz/appledoc/issues/380#issuecomment-21973294

twobitunicorn commented 11 years ago

@robvdveer, out of the ballpark! Great! Removing ~/.appledoc did the trick. image

twobitunicorn commented 11 years ago

Now that we got that one working (Thanks again!) Protocols are coming up with class icons "C", not protocol "Pr" icons. See attached: image

Same as with the classes, it uses the right icon in search: image

robvdveer commented 11 years ago

That's never going to happen. It is not supported. If you've read my blog post, the icons C does not stand for Class, but for C (see as in reference). The search uses the token descriptor for displaying the icon. Compare with official Apple doc sets. — http://simplicate.weebly.com

On Fri, Aug 2, 2013 at 12:14 AM, twobitunicorn notifications@github.com wrote:

Now that we got that one working (Thanks again!) Protocols are coming up with class icons "C", not protocol "Pr" icons. See attached: image Same as with the classes, it uses the right icon in search:

image

Reply to this email directly or view it on GitHub: https://github.com/tomaz/appledoc/issues/380#issuecomment-21973784

twobitunicorn commented 11 years ago

Rob, totally correct. Blasted that one off without thinking! Awesome, thanks again so much! Close it out?

robvdveer commented 11 years ago

Unless tomaz gives me god powers to the issue tracker, he is the one to close the issue as fixed. Final question: what screenshot tool are you using? Skitch doesn't do dropshadows! (I am only working on mac for 2 months now) — http://simplicate.weebly.com

On Fri, Aug 2, 2013 at 12:21 AM, twobitunicorn notifications@github.com wrote:

Rob, totally correct. Blasted that one off without thinking! Awesome, thanks again so much! Close it out?

Reply to this email directly or view it on GitHub: https://github.com/tomaz/appledoc/issues/380#issuecomment-21974196

twobitunicorn commented 11 years ago

I am using Command-Control-Shift-4, then space, then click the window to save it into clipboard. Then I open Preview and Command-N and it will create a new document with the contents of the clipboard. Preview has some nice annotation tools, Tools:Annotate, where you can select some nice figures, like ovals, or text. Thanks again!

tomaz commented 11 years ago

I had these shortcuts disabled on my computer, had to enable them manually - System Preferences > Keyboard > Shortcuts > Screen Shots. Alternatively you can use Grab.app - preinstalled with OS X.

@robvdveer Added you as collaborator to the project, so you should have more control now.

Otherwise person opening an issue can also close it, not sure if that also goes for participants.

robvdveer commented 11 years ago

Awesome! I felt the power running through my brittle veins. — http://simplicate.weebly.com

On Fri, Aug 2, 2013 at 9:03 AM, tomaz notifications@github.com wrote:

I had these shortcuts disabled on my computer, had to enable them manually - System Preferences > Keyboard > Shortcuts > Screen Shots. Alternatively you can use Grab.app - preinstalled with OS X. @robvdveer Added you as collaborator to the project, so you should have more control now.

Otherwise person opening an issue can also close it, not sure if that also goes for participants.

Reply to this email directly or view it on GitHub: https://github.com/tomaz/appledoc/issues/380#issuecomment-21989685

orta commented 11 years ago

This is SUPER AWESOME BTW. I'm excited to give CocoaDocs.org an update with all this new stuff.