8

Mi scuso per la semplicità della mia domanda, ma stavo cercando di generare la documentazione utilizzando Appledocs (https://github.com/tomaz/appledoc#quick-install)Utilizzando Appledocs per generare la documentazione

io non sono sicuro di come esattamente ottenerlo setup. Il modo in cui lo faccio è:

  • clono il repo github e quindi installare appledocs utilizzando lo script (confermo questo utilizzando appledocs --help) installare nel terminale.

Tuttavia, ora come faccio in realtà usare questo, nel senso che ho il mio progetto in Xcode:

  • Come faccio a generare il file di documentazione
  • in cui si ha generato?

risposta

15

Quello che faccio sempre è aggiungere un nuovo target al mio progetto che può generare documentazione. Puoi andare alle fasi di costruzione del tuo progetto e fare clic su "Aggiungi target". Scegli Aggrega in Altro e dagli un nome (ad esempio ProjectDocumentation).

Sempre nella scheda Fasi di costruzione, passare a "Aggiungi fase di costruzione" e fare clic su "Aggiungi script di esecuzione". A questo punto è possibile incollare il seguente ed adattarlo alle proprie impostazioni:

/usr/local/bin/appledoc \ 
--project-name HereProjectName \ 
--project-company "HereProjectCompany" \ 
--company-id com.companyName \ 
--keep-undocumented-objects \ 
--keep-undocumented-members \ 
--search-undocumented-doc \ 
--exit-threshold 2 \ 
--ignore .m \ 
--output "AppleDoc" . 

uso il ignorare * .m perché ho solo scrivere solo la documentazione nei miei file di intestazione. La documentazione nei miei file * .m è solo per me (e quindi privato). Quando si crea questo target, la documentazione viene generata come un docset XCode. Questo è accessibile facendo clic con il tasto Alt su un nome di classe. Controlla il AppleDoc website per la sintassi dei commenti.

Per la spiegazione delle opzioni della riga di comando, eseguire il comando appledoc --help.

+0

Ho reso dinamico '--project-name', ma non riesco a trovare alcuna variabile simile per gli altri 2 campi.Aiuto D: – Alexander

-1

Il modo consigliato è clone GitHub project and compile the tool from Xcod e. Poiché la clonazione del progetto GitHub creerà il collegamento al repository principale, semplifica enormemente anche l'aggiornamento futuro. Per installare, digitare quanto segue nel terminale:

git clone git://github.com/tomaz/appledoc.git 

Questo crea directory appledoc. All'interno è possibile trovare il progetto Xcode appledoc.xcodeproj; aprilo e compila target appledoc - questo dovrebbe funzionare immediatamente, tuttavia il tuo sistema deve soddisfare i requisiti minimi di sistema, vedi sotto. Vi consiglio di copiare l'eseguibile appledoc risultante dalla directory di build in una delle directory del vostro percorso (echo $ PATH) per renderlo facilmente accessibile.

Opzionale: Appledoc è autonomo e contiene i file modello necessari. SE si desidera modificare questi di default da modelli sottodirectory a una delle posizioni previste:

~/Library/Application Support/appledoc 
~/.appledoc 

per ulteriori informazioni visit

+0

Questa risposta non sembra molto utile, il richiedente ha già individuato la guida di installazione rapida, e questo sembra essere poco più di una copia-incolla di quello. – Connor

3

per esempio, come questo, si tratta di un colpo di testa valida con la documentazione del codice sorgente per i latests Appledoc.

// 
// GSUserDefaults.h 
// 
// Created by Gabor Szabo on 30/01/2013. 
// 
// 

#import <Foundation/Foundation.h> 


/*! 
@discussion This class manages the user defaults on the device with some extra convenient methods. 

## Version information 

__Version__: 1.0 

__Found__: 2013-01-30 

__Last update__: 2013-01-30 

__Developer__: Gabor Szabo, TMTI Ltd. 

*/ 

#pragma mark - Interface 

@interface GSUserDefaults : NSObject { 

} 

#pragma mark - Class Methods 

#pragma mark - Getters 

/// @name Getter methods 

/*! 
@abstract Returns the value for the key. 
@discussion It reads the values from the `NSUserDefaults`. 
@param key The key, it must be not `nil`. 
@return The value object for the key. 
@exception NSException Thrown when the key is `nil`. 
@since 1.0+ 
*/ 
+ (id)valueForKey:(NSString *)key; 

/*! 
@abstract Returns a value collection for the keys. 
@discussion It reads the values from the `NSUserDefaults`. 
@param keys The set of keys, which are affected. 
@return The value collection for the desired keys. 
@exception NSException Thrown when the key is `nil`. 
@since 1.0+ 
*/ 
+ (NSDictionary *)valuesForKeys:(NSSet *)keys; 

#pragma mark - Setters 

/// @name Setter methods 

/*! 
@abstract Sets a value for the selected key. 
@discussion The value always will be overridden. It sets the value to the `NSUserDefaults`. 
@param value The value object, it can be `nil`, in case of `nil` the key will be removed from the `NSUserDefaults`. 
@param key The key for the value, it cannot be `nil`. 
@exception NSException Thrown when the key is `nil`. 
@since 1.0+ 
*/ 
+ (void)setValue:(id)value forKey:(NSString *)key; 

/*! 
@abstract Sets `nil` values for the selected keys. 
@discussion The value always will be overridden. It removs the from the `NSUserDefaults`. 
@param keys The set of keys, which are affected. 
@since 1.0+ 
*/ 
+ (void)setNilValueForKeys:(NSSet *)keys; 

/*! 
@abstract Sets a default value for the selected keys. 
@discussion It the key already exists, it won't be overridden, if the value was `nil` for the key, the key gets the value. It sets the values to the `NSUserDefaults`. 
@param defaultValue The value object, it could be `nil`, in case of the `nil` just nothing will happen, the keys won't be removed. 
@param keys The set of keys, which are affected. 
@since 1.0+ 
*/ 
+ (void)setDefaultValue:(id)defaultValue forKeys:(NSSet *)keys; 

/*! 
@abstract Sets the value for the selected keys. 
@discussion The values always will be overridden, if the value was `nil` for the key, the key gets the value. It sets the values to the `NSUserDefaults`. 
@param value The value object, it can be `nil`, in case of `nil` the key will be removed from the `NSUserDefaults`. 
@param keys The set of keys, which are affected. 
@since 1.0+ 
*/ 
+ (void)setValue:(id)value forKeys:(NSSet *)keys; 

@end 
+0

Come si documenta una proprietà @ nei commenti di intestazione? – kervich

+0

in questo modo è esattamente come sarebbe per l'interfaccia @. – holex

Problemi correlati