Yii Framework Forum: How is Yii's API documentation generated? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

How is Yii's API documentation generated? Rate Topic: -----

#1 User is offline   Alex Muir 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 96
  • Joined: 25-April 09

Posted 01 November 2009 - 09:06 AM

I really like the clean structure of Yii's API documentation. I need to document a project so I tried PhpDoc but it produces cluttered, frame-based HTML. What is being used to produce the Yii documentation?
My sites: The Big Eat and The Big Space
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,428
  • Joined: 17-January 09
  • Location:Russia

Posted 01 November 2009 - 01:04 PM

Using PHPDoc, as I know, you can define your own templates without frames and styled as you like.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#3 User is offline   wei 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 147
  • Joined: 04-October 08

Posted 02 November 2009 - 03:11 AM

It is actually simpler than phpdoc, see http://code.google.c...ld/commands/api
0

#4 User is offline   spamec 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 19-February 09

Posted 04 November 2009 - 03:35 AM

I went through the code (looks great), but can't find part responsible for generating documentation... is it separate closed application?

Ok, found text files in /trunk/docs/guide and latex command to generate .tex files, but still cant find code responisble for managing it and viewing it like on Yii guide..

This post has been edited by spamec: 04 November 2009 - 03:47 AM

0

#5 User is offline   jayrulez 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 348
  • Joined: 29-July 09

Posted 04 November 2009 - 03:51 AM

View Postspamec, on 04 November 2009 - 03:35 AM, said:

I went through the code (looks great), but can't find part responsible for generating documentation... is it separate closed application?



I had a look through it just now, i think you do this to generate the api.

1. Add build to your path config for your environment variables if you are using windows. Run cmd.exe and type in the command line interface "build api <path> <mode>" without the quotes.

path is the path you want the api to be generated to and mode is whether the api is for online or offline use which is optional.
php:
foreach(array('cat', 'dog', 'cow') as $animal) echo $animal."\n";

python:
[(animal, print(animal)) for animal in ['cat', 'dog', 'cow']]

ruby:
['cat', 'dog', 'cow'].each {|animal| puts animal}


You say Tomato, I say Tomato.
0

#6 User is offline   spamec 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 19-February 09

Posted 04 November 2009 - 04:02 AM

I was imprecise, sorry... I was thinking about generating guide part of documentation (not api). As far I can see guys from http://yiiframework.ru/ managed to do this (I mean manipulate guide to create their own).
0

#7 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 04 November 2009 - 05:11 AM

There's a separate project for translating the guide. It also contains an application to display the guide (check the README):

http://code.google.com/p/yiidoc
1

#8 User is offline   spamec 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 19-February 09

Posted 04 November 2009 - 05:23 AM

Thx Mike, that's what I was looking for :)
0

#9 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,428
  • Joined: 17-January 09
  • Location:Russia

Posted 04 November 2009 - 08:30 AM

spamec
At yiiframework.ru we are using modified code that is bundled with yiidoc project. I've made a few image path fixes, added some features like translation actuality checking and refactored it.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#10 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,428
  • Joined: 17-January 09
  • Location:Russia

Posted 04 November 2009 - 08:31 AM

btw., we have not yet managed to automate CHM/PDF guide generation. If someone knows a good way, it will help us a lot.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#11 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,879
  • Joined: 04-October 08
  • Location:DC, USA

Posted 04 November 2009 - 08:45 AM

Everything needed to generate API (HTML, CHM) and guide (HTML, PDF) can be found under http://code.google.c...svn/trunk/build

Take a look at build.xml (this is used by "phing" tool) under "doc" target to know how to use these tools.
0

#12 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,428
  • Joined: 17-January 09
  • Location:Russia

Posted 04 November 2009 - 01:26 PM

Thanks, will check it.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#13 User is offline   Юрий Пюрбеев 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 32
  • Joined: 23-October 10
  • Location:Moscow

Posted 07 December 2010 - 11:31 AM

Had a great trouble while trying to generate documentation with phpdoc ver. >= 3.5.0,
Worked fine with phpdoc ver 3.4.15

By the way, is it possible to use this tool to create docs for my own projects?
0

#14 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,428
  • Joined: 17-January 09
  • Location:Russia

Posted 07 December 2010 - 12:07 PM

phpDocumentor is not used for Yii API docs generation but there should be no trouble generating docs with it. What is your trouble exactly?
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#15 User is offline   Юрий Пюрбеев 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 32
  • Joined: 23-October 10
  • Location:Moscow

Posted 07 December 2010 - 01:34 PM

Problems with generating docs for my own code because yii doc gen is hardcoded for yii.

I changed ApiCommand.php line 125
$model=$this->buildModel(YII_PATH,$options);

to my own path and now I'm having a terrible amount of response text in shell. It's so big - I can't see the beginning of the error and don't know the reason.

I was wondering maybe smb else ( eg the gen author :) ) thought about using the gen not only to yii?
0

#16 User is offline   Юрий Пюрбеев 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 32
  • Joined: 23-October 10
  • Location:Moscow

Posted 07 December 2010 - 01:41 PM

I too dislike phpDocumentor.

It's last release was in 2008, it's written in php4, it has own gui and I had to examine the source to create my own console wrapper around it.

Though, it was about a year ago and I can be mistaking.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users