X-Git-Url: http://nitlanguage.org
diff --git a/src/nitcatalog.nit b/src/nitcatalog.nit
index 6aba6f1..9dd3351 100644
--- a/src/nitcatalog.nit
+++ b/src/nitcatalog.nit
@@ -12,69 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Basic catalog generator for Nit projects
+# Basic catalog generator for Nit packages
#
# See:
#
-# The tool scans projects and generates the HTML files of a catalog.
+# The tool scans packages and generates the HTML files of a catalog.
#
-# ## Features
-#
-# * [X] scan projects and their `.ini`
-# * [X] generate lists of projects
-# * [X] generate a page per project with the readme and most metadata
-# * [ ] link/include/be included in the documentation
-# * [ ] propose `related projects`
-# * [ ] show directory content (a la nitls)
-# * [X] gather git information from the working directory
-# * [ ] gather git information from the repository
-# * [ ] gather project information from github
-# * [ ] gather people information from github
-# * [ ] reify people
-# * [ ] separate information gathering from rendering
-# * [ ] move up information gathering in (existing or new) service modules
-# * [ ] add command line options
-# * [ ] harden HTML (escaping, path injection, etc)
-# * [ ] nitcorn server with RESTful API
-#
-# ## Issues and limitations
-#
-# The tool works likee the other tools and expects to find valid Nit source code in the directories
-#
-# * cruft and temporary files will be collected
-# * missing source file (e.g. not yet generated by nitcc) will make information
-# incomplete (e.g. invalid module thus partial dependency and metrics)
-#
-# How to use the tool as the basis of a Nit code archive on the web usable with a package manager is not clear.
+# See `catalog` for details
module nitcatalog
-import loader # Scan&load projects, groups and modules
-import doc::doc_down # Display mdoc
-import md5 # To get gravatar images
-import counter # For statistics
-import modelize # To process and count classes and methods
-
-redef class MProject
- # Return the associated metadata from the `ini`, if any
- fun metadata(key: String): nullable String
- do
- var ini = self.ini
- if ini == null then return null
- return ini[key]
- end
-
- # The list of maintainers
- var maintainers = new Array[String]
-
- # The list of contributors
- var contributors = new Array[String]
+import loader # Scan&load packages, groups and modules
+import catalog
- # The date of the most recent commit
- var last_date: nullable String = null
-
- # The date of the oldest commit
- var first_date: nullable String = null
-end
+import doc::templates::html_model
# A HTML page in a catalog
#
@@ -83,9 +33,18 @@ end
class CatalogPage
super Template
+ # The associated catalog, used to groups options and other global data
+ var catalog: Catalog
+
# Placeholder to include additional things before the ``.
var more_head = new Template
+ # Relative path to the root directory (with the index file).
+ #
+ # Use "" for pages in the root directory
+ # Use ".." for pages in a subdirectory
+ var rootpath: String
+
redef init
do
add """
@@ -94,7 +53,7 @@ class CatalogPage