Skip to content

Commit

Permalink
more detail on README, prepare for pdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
sgruhier committed May 1, 2008
1 parent b0bf1d3 commit b62be6a
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 10 deletions.
7 changes: 7 additions & 0 deletions .gitignore
@@ -0,0 +1,7 @@
dist/*
doc/config/Data
doc/files/**/*
doc/*
doc/javascript/*
doc/styles/*
pdoc/*
49 changes: 49 additions & 0 deletions README.markdown
@@ -0,0 +1,49 @@
# Prototype UI

## Distrib files

To generate distrib files, you need to run rake tasks.

> rake dist
To generate one JS file in dist directory with all components (prototype-iu.js)

> rake dist:each
To generate one JS file per component (window.js, carousel.js ...) in dist directory

> rake dist:compress
To compress all JS files from dist directory (window.js ==> window.packed.js ...)

## Documentation

Currently, documentation is based on NaturalDocs. To generate hmtl files just tun

> rake doc
## Help

We want to move to [PDoc](http://pdoc.org/) and we need help to write new documentation.
Nothing has been done yet, only rake tasks.

If you want to generate pdoc files, you need to get pdoc (it's included as a git submodule)
Do it only once to get pdoc

> git submodule init
> git submodule update
then you can generate pdoc files

> rake -f Rakefile.pdoc pdoc
And open pdoc/index.html to check it. Pretty easy.

To avoid conflicts with current doc, do not includ pdoc comment in current JS file. Edit documentation.pdoc in each component directory.
When you're done, pull request :).

Thanks in advance for your help.

## Bugs Report

We are also moving to [lighthouseapp.com](http://lighthouseapp.com/), right now you can fill tockets on our [Trac](http://dev.prototype-ui.com/)
13 changes: 11 additions & 2 deletions Rakefile.pdoc
@@ -1,9 +1,18 @@
load 'Rakefile'

desc "Create HTML documentation using pdoc"
task :pdoc => :dist do
task :pdoc do
require 'lib/pdoc'
FileUtils.rm_rf "pdoc"
FileUtils.mkdir "pdoc"
PDoc::Generators::Html::Website.new(File.expand_path(File.join(File.dirname(__FILE__), "lib", "pdoc_template", "pdoc.js"))).render
tmp_filename = File.join(File.dirname(__FILE__), 'pdoc', 'all.pdoc')
open(tmp_filename, 'w') do |f|
Dir[File.join(File.dirname(__FILE__), "src", "**", "*.pdoc")].each do |file|
puts file
f << File.read(file)
end
end
PDoc::Runner.new(tmp_filename).run

FileUtils.rm tmp_filename
end
2 changes: 1 addition & 1 deletion lib/pdoc.rb
Expand Up @@ -10,7 +10,7 @@
$:.unshift File.expand_path(c)
end

PUI_DOC_VERSION = `svnversion`
require 'erb'
require File.expand_path(File.join(PDOC_DIR, "pdoc", "runner"))
require File.expand_path(File.join(PDOC_DIR, "pdoc", "generators"))
require File.expand_path(File.join(PDOC_DIR, "pdoc", "parser"))
3 changes: 2 additions & 1 deletion lib/pdoc_template/html/assets/stylesheets/main.css
Expand Up @@ -225,8 +225,9 @@ pre code {

#sidebar {
font-size: 0.875em;
width: 220px;
width: 200px;
float: left;
margin-right: 20px;
}

#sidebar ul {
Expand Down
6 changes: 6 additions & 0 deletions lib/pdoc_template/html/item_index.js.erb
@@ -0,0 +1,6 @@
if (!window.PDoc) window.PDoc = {};
PDoc.elements = {
<%= @root.map { |e, i|
"'#{e.full_name}': { 'name': '#{e.full_name}', 'type': '#{e.type}', 'path': '#{path_to(e)}' }" }.join(",\n")
%>
};
11 changes: 5 additions & 6 deletions lib/pdoc_template/html/layout.erb
Expand Up @@ -23,16 +23,15 @@
</div>
</div>
<div id="search_panel">
<form action="" method="get" accept-charset="utf-8">
<div><input type="text" value="search" id="search"></div>
<div id="search_list"></div>
</form>
<!-- <form action="" method="get" accept-charset="utf-8">
<div><input type="text" value="search" id="search"></div>
<div id="search_list"></div>
</form> -->
</div>
<div id="main">
<div id="sidebar">
<ul>
<h2>Prototype UI</h2>
<h3><%= PUI_DOC_VERSION %></h3>
<% @root.sections.each do |section| %>
<%= menu(section) %>
<% end %>
Expand All @@ -43,7 +42,7 @@
</div>
</div>
<div id="footer">
<p>&copy; 2006-<%= Time.now.year %> Prototype Core Team | Licenses:
<p>&copy; 2007-<%= Time.now.year %> Prototype UI | Licenses:
<a rel="license" href="http://dev.rubyonrails.org/browser/spinoffs/prototype/trunk/LICENSE?format=raw">MIT (source code)</a> and <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><abbr title="Creative Commons Attribution-Share Alike 3.0 License">CC BY-SA</abbr> (documentation)</a>.</p>
</div>
</body>
Expand Down
6 changes: 6 additions & 0 deletions src/carousel/documentation.pdoc
@@ -0,0 +1,6 @@
/**
* == Carousel ==
* The Carousel section
**/


5 changes: 5 additions & 0 deletions src/core/documentation.pdoc
@@ -0,0 +1,5 @@
/**
* == Core ==
* The Core section
**/

5 changes: 5 additions & 0 deletions src/util/documentation.pdoc
@@ -0,0 +1,5 @@
/**
* == Util ==
* The Util section
**/

7 changes: 7 additions & 0 deletions src/window/documentation.pdoc
@@ -0,0 +1,7 @@
/**
* == Window ==
* The Window section
**/



0 comments on commit b62be6a

Please sign in to comment.