Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for angular docs #44

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "minami",
"version": "1.2.3",
"description": "Clean and minimal JSDoc 3 Template / Theme",
"name": "angular-minami",
"version": "1.0.0",
"description": "Clean and minimal JSDoc 3 Template / Theme supporting Angular JS 1.x",
"main": "publish.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
59 changes: 59 additions & 0 deletions publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ function buildNav(members) {

nav.push(buildNavLink('home', '<a href="index.html">Home</a>'))

// angular
nav = nav.concat(buildMemberNav(members.services, "Services", seen, linkto))
nav = nav.concat(buildMemberNav(members.controllers, "Controllers", seen, linkto))
nav = nav.concat(buildMemberNav(members.directives, "Directives", seen, linkto))
nav = nav.concat(buildMemberNav(members.filters, "Filters", seen, linkto))

nav = nav.concat(buildMemberNav(members.tutorials, "Tutorials", seenTutorials, linktoTutorial))
nav = nav.concat(buildMemberNav(members.classes, "Classes", seen, linkto))
nav = nav.concat(buildMemberNav(members.modules, "Modules", {}, linkto))
Expand All @@ -353,6 +359,8 @@ function buildNav(members) {
nav = nav.concat(buildMemberNav(members.mixins, "Mixins", seen, linkto))
nav = nav.concat(buildMemberNav(members.interfaces, "Interfaces", seen, linkto))



if (members.globals.length) {
nav.push(buildNavHeading(linkto('global', 'Globals')))

Expand Down Expand Up @@ -380,6 +388,7 @@ function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) {
nav.push(buildNavHeading(itemHeading))

items.forEach(function(item) {

var methods = find({ kind: "function", memberof: item.longname })
var members = find({ kind: "member", memberof: item.longname })
var displayName
Expand Down Expand Up @@ -681,6 +690,12 @@ exports.publish = function(taffyData, opts, tutorials) {
var members = helper.getMembers(data)
members.tutorials = tutorials.children

// angular
members.services = find({ngdoc: 'service'})
members.directives = find({ngdoc: 'directive'})
members.controllers = find({ngdoc: 'controller'})
members.filters = find({ngdoc: 'filter'})

// output pretty-printed source files by default
var outputSourceFiles = conf.default &&
conf.default.outputSourceFiles !== false
Expand Down Expand Up @@ -734,6 +749,10 @@ exports.publish = function(taffyData, opts, tutorials) {
var mixins = taffy(members.mixins)
var externals = taffy(members.externals)
var interfaces = taffy(members.interfaces)
var services = taffy(members.services)
var controllers = taffy(members.controllers)
var directives = taffy(members.directives)
var filters = taffy(members.filters)

Object.keys(helper.longnameToUrl).forEach(function(longname) {
var myModules = helper.find(modules, { longname: longname })
Expand Down Expand Up @@ -795,6 +814,46 @@ exports.publish = function(taffyData, opts, tutorials) {
helper.longnameToUrl[longname]
)
}

var myFilters = helper.find(filters, { longname: longname })
if (myFilters.length) {
generate(
"Filter",
myFilters[0].name,
myFilters,
helper.longnameToUrl[longname]
)
}

var myServices = helper.find(services, { longname: longname })
if (myServices.length) {
generate(
"Service",
myServices[0].name,
myServices,
helper.longnameToUrl[longname]
)
}

var myContollers = helper.find(controllers, { longname: longname })
if (myContollers.length) {
generate(
"Controller",
myContollers[0].name,
myContollers,
helper.longnameToUrl[longname]
)
}

var myDirectives = helper.find(directives, { longname: longname })
if (myDirectives.length) {
generate(
"Directive",
myDirectives[0].name,
myDirectives,
helper.longnameToUrl[longname]
)
}
})

// TODO: move the tutorial functions to templateHelper.js
Expand Down