tomaz / appledoc

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

Documentation generated but pages are empty #593

Closed TitouanVanBelle closed 8 years ago

TitouanVanBelle commented 8 years ago

I'm facing an issue where the documentation (HTML structure) is generated but the pages are empty and throwing the following error when loading

TypeError: null is not an object (evaluating 'taskTreeItem.getElementsByTagName')

I am running appledoc 2.2.1 (build 1333) macOS Sierra Version 10.12 Beta (16A286a) and Xcode 7.3.1 and also tried appledoc 2.2.1 (build 1333). I tried installing appledoc the following ways:

I created a small project sample for you to reproduce

Command

ruby doc.rb

doc.rb

def appledoc_command
  company = 'MyCompany'
  company_id = 'com.myCompany'
  company_url = 'http://www.mycompany.com/'
  target = 'iphoneos'
  output_path = 'docs/'

  "appledoc \
  --project-name 'AppledocSample' \
  --project-company '#{company}' \
  --company-id '#{company_id}' \
  --docset-atom-filename '#{company}.atom' \
  --docset-feed-url '#{company_url}/#{company}/%DOCSETATOMFILENAME' \
  --docset-package-url '#{company_url}/#{company}/%DOCSETPACKAGEFILENAME' \
  --docset-fallback-url '#{company_url}/#{company}' \
  --output '#{output_path}' \
  --docset-platform-family '#{target}' \
  --logformat xcode \
  --keep-intermediate-files \
  --keep-undocumented-objects \
  --keep-undocumented-members \
  --search-undocumented-doc \
  --no-repeat-first-par \
  --create-html \
  --create-docset \
  --install-docset \
  --publish-docset \
  --no-warn-invalid-crossref \
  --exit-threshold 2 \
  'sdk/SDK.h'"
end

system appledoc_command

Result

09:51:49 - tito@lt0311 AppledocSample(master)> ruby doc.rb 
appledoc version: 2.2.1 (build 1333)

Initializing...
Parsing source files...
Initializing parser with settings provider GBApplicationSettingsProvider...
Initializing objective-c parser with settings provider GBApplicationSettingsProvider...
Parsing objects from 1 paths...
Parsing 'sdk/SDK.h'...
Parsing file 'sdk/SDK.h'...
Parsing source code from 'sdk/SDK.h'...
Parsing objective-c objects...
Initializing tokenizer...
Initializing class with name SDK...
Initializing adopted protocols provider for SDK...
Initializing ivars provider for SDK...
Initializing methods provider for SDK...
Matched SDK class definition at line 18.
Assigned comment 'This is the SDK' to 'SDK'...
Resetting comments...
Matched superclass NSObject.
Resetting comments...
Matched property definition property at line 24.
Assigned comment 'This is a property' to 'property'...
SDK: Registering method property...
SDK: Registering section default...
Resetting comments...
Matched method +method at line 32.
Assigned comment 'This is a method …returns an NSStri' to 'method'...
SDK: Registering method method...
Registering class SDK...
Parsed 1 source files.
Parsing static documents from 0 paths...
Parsed 0 static document files.
Finished parsing in 4ms.

Processing parsed data...
Initializing processor with settings provider GBApplicationSettingsProvider...
Initializing comments processor with settings provider GBApplicationSettingsProvider...
Processing parsed objects...
Checking for known superclasses and adopted protocols...
Merging known categories to classes...
Processing class SDK...
Processing method @propertySDK.property...
Processing Comment 'This is a property' found in SDK.h...
- Comment has 2 lines.
- Found comment block in lines 22..23...
- Registering short description from This is a property...
- Registering text block This is a property at SDK.h@22...
  - Converting cross references in 'This is a property'...
Validating processed parameters...
Finished processing method @propertySDK.property.
Processing method +[SDK method]...
Processing Comment 'This is a method …returns an NSStri' found in SDK.h...
- Comment has 4 lines.
- Found comment block in lines 28..30...
- Registering short description from This is a method...
- Registering text block This is a method at SDK.h@28...
  - Converting cross references in 'This is a method'...
- Found comment block in lines 30..31...
- Registering return description that returns an NSString at SDK.h@30...
- Registering text block that returns an NSString at SDK.h@30...
  - Converting cross references in 'that returns an NSString'...
Registering component <GBCommentComponent: 0x7f8ed9d431a0>...
Validating processed parameters...
Finished processing method +[SDK method].
Processing Comment 'This is the SDK' found in SDK.h...
- Comment has 2 lines.
- Found comment block in lines 16..17...
- Registering short description from This is the SDK...
- Registering text block This is the SDK at SDK.h@16...
  - Converting cross references in 'This is the SDK'...
- Registering text block This is the SDK at SDK.h@16...
  - Converting cross references in 'This is the SDK'...
Registering component <GBCommentComponent: 0x7f8ed9f0ed40>...
Finished processing class SDK.
Finished processing in 5ms.

Generating output...
Initializing generator with settings provider GBApplicationSettingsProvider...
Generating output from parsed objects...
Initializing generation steps...
Initializing output generators array...
Initializing output generator with settings provider GBApplicationSettingsProvider...
Initializing output generator with settings provider GBApplicationSettingsProvider...
Initializing output generator with settings provider GBApplicationSettingsProvider...
Initializing output generator with settings provider GBApplicationSettingsProvider...
Initializing output generator with settings provider GBApplicationSettingsProvider...
Running generation steps...
Generation step 1/5: Running GBHTMLOutputGenerator...
Copying template files from '~/.appledoc/html' to 'docs/html'...
Removing output at 'docs/html'...
Copying template files from '~/.appledoc/html' to 'docs/html'...
Removing temporary files from 'docs/html'...
Creating template handler for template file '~/.appledoc/html/document-template.html'...
Parsing template from /Users/tito/.appledoc/html/document-template.html...
Clearing parsed values...
Clearing parsed values...
Found section template GBCommentComponentsList at line 45...
Found section template GBCommentComponent at line 49...
Removing template file 'document-template.html' from output...
Creating template handler for template file '~/.appledoc/html/hierarchy-template.html'...
Parsing template from /Users/tito/.appledoc/html/hierarchy-template.html...
Clearing parsed values...
Clearing parsed values...
Found section template Classes at line 87...
Found section template Navigation at line 97...
Removing template file 'hierarchy-template.html' from output...
Creating template handler for template file '~/.appledoc/html/index-template.html'...
Parsing template from /Users/tito/.appledoc/html/index-template.html...
Clearing parsed values...
Clearing parsed values...
Found section template Navigation at line 112...
Removing template file 'index-template.html' from output...
Creating template handler for template file '~/.appledoc/html/object-template.html'...
Parsing template from /Users/tito/.appledoc/html/object-template.html...
Clearing parsed values...
Clearing parsed values...
Found section template Method at line 280...
Found section template MethodDeclaration at line 362...
Found section template TaskTitle at line 367...
Found section template TaskMethod at line 372...
Found section template TaskSelector at line 382...
Found section template GBCommentComponentsList at line 387...
Found section template Constant at line 391...
Found section template GBCommentComponent at line 412...
Found section template ObjectSpecification at line 416...
Found section template Navigation at line 424...
Found section template JumpTo at line 431...
Found section template TableOfContents at line 469...
Removing template file 'object-template.html' from output...
GBHTMLOutputGenerator is generating output...
Generating output for class SDK...
Initializing variables provider...
Initializing variables provider with settings provider GBApplicationSettingsProvider...
Rendering { object = SDK; p…0x7f8ed9c010e0>";...
Finished generating output for class SDK.
Generating output for index...
Rendering { blocks = ( ); c…0x7f8ed9c010e0>";...
Finished generating output for index.
Generating output for hierarchy...
Rendering { blocks = ( ); c…0x7f8ed9c010e0>";...
Finished generating output for hierarchy.
Generation step 2/5: Running GBDocSetOutputGenerator...
Copying template files from '~/.appledoc/docset' to 'docs/docset'...
Removing output at 'docs/docset'...
Copying template files from '~/.appledoc/docset' to 'docs/docset'...
Removing temporary files from 'docs/docset'...
Creating template handler for template file '~/.appledoc/docset/Contents/info-template.plist'...
Parsing template from /Users/tito/.appledoc/docset/Contents/info-template.plist...
Clearing parsed values...
Clearing parsed values...
Removing template file 'Contents/info-template.plist' from output...
Creating template handler for template file '~/.appledoc/docset/Contents/Resources/Documents/documents-template'...
Parsing template from /Users/tito/.appledoc/docset/Contents/Resources/Documents/documents-template...
Clearing parsed values...
Clearing parsed values...
Removing template file 'Contents/Resources/Documents/documents-template' from output...
Creating template handler for template file '~/.appledoc/docset/Contents/Resources/nodes-template.xml'...
Parsing template from /Users/tito/.appledoc/docset/Contents/Resources/nodes-template.xml...
Clearing parsed values...
Clearing parsed values...
Found section template Node at line 75...
Found section template NodeRef at line 117...
Removing template file 'Contents/Resources/nodes-template.xml' from output...
Creating template handler for template file '~/.appledoc/docset/Contents/Resources/tokens-template.xml'...
Parsing template from /Users/tito/.appledoc/docset/Contents/Resources/tokens-template.xml...
Clearing parsed values...
Clearing parsed values...
Found section template TokenIdentifier at line 46...
Found section template DeclaredIn at line 50...
Found section template RelatedTokens at line 54...
Found section template Abstract at line 63...
Found section template Availability at line 67...
Found section template Reference at line 71...
Found section template MethodDeclaration at line 75...
Found section template GBCommentComponentsList at line 79...
Removing template file 'Contents/Resources/tokens-template.xml' from output...
GBDocSetOutputGenerator is generating output...
Initializing simplified object representations...
Initializing simplified representation of SDK with id 1...
Moving HTML files to DocSet bundle...
Copying 'docs/html' to 'docs/docset/Contents/Resources/Documents'...
Removing 'docs/docset/Contents/Resources/Documents'...
Writing DocSet Info.plist...
Rendering { bundleIdentifie…publisherName = M...
Writing DocSet Nodes.xml file...
Rendering { blocks = ( ); c…0x7f8ed9c010e0>";...
Writing DocSet Tokens.xml files...
Registering component <GBCommentComponent: 0x7f8ed9f0b610>...
Registering component <GBCommentComponent: 0x7f8ed9e19a50>...
Registering component <GBCommentComponent: 0x7f8ed9e19a50>...
Registering component <GBCommentComponent: 0x7f8ed9e19a50>...
Registering component <GBCommentComponent: 0x7f8ed9f090e0>...
Rendering { filePath = "Cla…"//apple_ref/occ/...
Indexing DocSet...
Running command '/usr/bin/xcrun docsetutil index docs/docset'
> Indexing AppledocSample Documentation (3 nodes)
> 1: index.html
> 2: Classes/SDK.html
> 3: index.html
> Loading symbols from /Users/tito/Documents/workspace/fyber/AppledocSample/docs/docset/Contents/Resources/Tokens1.xml
> *      5 tokens processed (   0.0 sec)
> Linking up related token references
> Sorting tokens
Generation step 3/5: Running GBDocSetFinalizeGenerator...
Copying template files from '~/.appledoc' to '/Users/tito/Library/Developer/Shared/Documentation/DocSets/com.myCompany.AppledocSample.docset'...
Removing output at '/Users/tito/Library/Developer/Shared/Documentation/DocSets/com.myCompany.AppledocSample.docset'...
Copying template files from '~/.appledoc' to '/Users/tito/Library/Developer/Shared/Documentation/DocSets/com.myCompany.AppledocSample.docset'...
Removing temporary files from '/Users/tito/Library/Developer/Shared/Documentation/DocSets/com.myCompany.AppledocSample.docset'...
Creating template handler for template file '~/.appledoc/docset/Contents/info-template.plist'...
Parsing template from /Users/tito/.appledoc/docset/Contents/info-template.plist...
Clearing parsed values...
Clearing parsed values...
Removing template file 'docset/Contents/info-template.plist' from output...
Creating template handler for template file '~/.appledoc/docset/Contents/Resources/Documents/documents-template'...
Parsing template from /Users/tito/.appledoc/docset/Contents/Resources/Documents/documents-template...
Clearing parsed values...
Clearing parsed values...
Removing template file 'docset/Contents/Resources/Documents/documents-template' from output...
Creating template handler for template file '~/.appledoc/docset/Contents/Resources/nodes-template.xml'...
Parsing template from /Users/tito/.appledoc/docset/Contents/Resources/nodes-template.xml...
Clearing parsed values...
Clearing parsed values...
Found section template Node at line 75...
Found section template NodeRef at line 117...
Removing template file 'docset/Contents/Resources/nodes-template.xml' from output...
Creating template handler for template file '~/.appledoc/docset/Contents/Resources/tokens-template.xml'...
Parsing template from /Users/tito/.appledoc/docset/Contents/Resources/tokens-template.xml...
Clearing parsed values...
Clearing parsed values...
Found section template TokenIdentifier at line 46...
Found section template DeclaredIn at line 50...
Found section template RelatedTokens at line 54...
Found section template Abstract at line 63...
Found section template Availability at line 67...
Found section template Reference at line 71...
Found section template MethodDeclaration at line 75...
Found section template GBCommentComponentsList at line 79...
Removing template file 'docset/Contents/Resources/tokens-template.xml' from output...
Creating template handler for template file '~/.appledoc/html/document-template.html'...
Parsing template from /Users/tito/.appledoc/html/document-template.html...
Clearing parsed values...
Clearing parsed values...
Found section template GBCommentComponentsList at line 45...
Found section template GBCommentComponent at line 49...
Removing template file 'html/document-template.html' from output...
Creating template handler for template file '~/.appledoc/html/hierarchy-template.html'...
Parsing template from /Users/tito/.appledoc/html/hierarchy-template.html...
Clearing parsed values...
Clearing parsed values...
Found section template Classes at line 87...
Found section template Navigation at line 97...
Removing template file 'html/hierarchy-template.html' from output...
Creating template handler for template file '~/.appledoc/html/index-template.html'...
Parsing template from /Users/tito/.appledoc/html/index-template.html...
Clearing parsed values...
Clearing parsed values...
Found section template Navigation at line 112...
Removing template file 'html/index-template.html' from output...
Creating template handler for template file '~/.appledoc/html/object-template.html'...
Parsing template from /Users/tito/.appledoc/html/object-template.html...
Clearing parsed values...
Clearing parsed values...
Found section template Method at line 280...
Found section template MethodDeclaration at line 362...
Found section template TaskTitle at line 367...
Found section template TaskMethod at line 372...
Found section template TaskSelector at line 382...
Found section template GBCommentComponentsList at line 387...
Found section template Constant at line 391...
Found section template GBCommentComponent at line 412...
Found section template ObjectSpecification at line 416...
Found section template Navigation at line 424...
Found section template JumpTo at line 431...
Found section template TableOfContents at line 469...
Removing template file 'html/object-template.html' from output...
Creating template handler for template file '~/.appledoc/publish/xml-template.xml'...
Parsing template from /Users/tito/.appledoc/publish/xml-template.xml...
Clearing parsed values...
Clearing parsed values...
Removing template file 'publish/xml-template.xml' from output...
Finalizing DocSet...
GBDocSetFinalizeGenerator is generating output...
Moving DocSet files from 'docs/docset' to '/Users/tito/Library/Developer/Shared/Documentation/DocSets/com.myCompany.AppledocSample.docset'...
Initializing directory at '/Users/tito/Library/Developer/Shared/Documentation/DocSets/com.myCompany.AppledocSample.docset'...
Removing existing directory...
Creating directory...
Copying 'docs/docset' to '/Users/tito/Library/Developer/Shared/Documentation/DocSets/com.myCompany.AppledocSample.docset'...
Removing '/Users/tito/Library/Developer/Shared/Documentation/DocSets/com.myCompany.AppledocSample.docset'...
Generation step 4/5: Running GBDocSetInstallGenerator...
Installing DocSet...
GBDocSetInstallGenerator is generating output...
Installing DocSet to Xcode...
Generation step 5/5: Running GBDocSetPublishGenerator...
Copying template files from '~/.appledoc/publish' to 'docs/publish'...
Removing output at 'docs/publish'...
Copying template files from '~/.appledoc/publish' to 'docs/publish'...
Removing temporary files from 'docs/publish'...
Creating template handler for template file '~/.appledoc/publish/xml-template.xml'...
Parsing template from /Users/tito/.appledoc/publish/xml-template.xml...
Clearing parsed values...
Clearing parsed values...
Removing template file 'xml-template.xml' from output...
Preparing DocSet for publishing...
GBDocSetPublishGenerator is generating output...
Initializing directory at 'docs/publish'...
Enumerating directory contents...
Running command '/usr/bin/xcrun docsetutil package -verbose -output docs/publish/com.myCompany.AppledocSample-1.0.xar -atom docs/publish/MyCompany.atom -download-url http:/www.mycompany.com/MyCompany/com.myCompany.AppledocSample-1.0.xar /Users/tito/Library/Developer/Shared/Documentation/DocSets/com.myCompany.AppledocSample.docset'
Finished generating in 761ms.

Finished in 770ms.
Parsing:    4ms (0%)
Processing: 5ms (0%)
Generating: 761ms (98%)
Exiting with result 0 (reported result was 0 - higher than 2)...
tomaz commented 8 years ago

That's an error from javascript. Might be 10.12 related - can you try using the same generated html on older OS?

TitouanVanBelle commented 8 years ago

Hmm after cleaning my laptop from everything appledoc related and reinstalling from the master branch with the following command it seems to work

sudo sh install-appledoc.sh -t ~/Library/Application\ Support/appledoc

Sorry for nothing..

tomaz commented 8 years ago

No worries... It was indeed something with templates then...

Cylix commented 7 years ago

Just got the same issue, don't really know why.

I had my Appledoc installed with Brew. I didn't do any updates but suddenly, the generated HTML files were empty. Uninstalling and then reinstalling with brew didn't solve the issue.

However, uninstalling and then reinstalling from the GitHub repository solved the issue.

tomaz commented 7 years ago

I ran into similar issues with other ruby based tools on 10.12, though can't say for sure if it happened during update to 10.12/10.12.1 or sometime in between or after. Perhaps for my case the problem can also be in Sierra not playing nice with preexistent rvm installations; some of my rubies were simply removed and I had to reinstall them...