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

[TIMOB-26360] Fix documentation generation #10310

Merged
merged 2 commits into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions apidoc/Titanium/UI/Tab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ events:

- name: unselected
summary: Fired when the tab is no longer selected.
since: {android: "3.5.1 ", iphone: "5.2.0", ipad: "5.2.0"}
since: {android: "3.5.1", iphone: "5.2.0", ipad: "5.2.0"}
properties:
- name: index
summary: Index of the current active tab.
Expand Down Expand Up @@ -348,7 +348,7 @@ events:

- name: selected
summary: Fired when the tab is selected.
since: {android: "3.5.1 ", iphone: "5.2.0", ipad: "5.2.0"}
since: {android: "3.5.1", iphone: "5.2.0", ipad: "5.2.0"}
properties:
- name: index
summary: Index of the current active tab.
Expand Down
2 changes: 1 addition & 1 deletion apidoc/Titanium/UI/View.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ events:
fired when the property [focusable](Titanium.UI.View.focusable) is set to true. On iOS the
event is generated only when using [Ti.UI.TextArea](Titanium.UI.TextArea), [Ti.UI.TextField](Titanium.UI.TextField)
and [Ti.UI.SearchBar](Titanium.UI.SearchBar).
platforms: [android]
platforms: [android, iphone, ipad]
since: {android: "3.1.0", iphone: "5.4.0", ipad: "5.4.0"}
properties:
- name: keyCode
Expand Down
5 changes: 1 addition & 4 deletions apidoc/docgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,9 +576,7 @@ function addOnMerge(baseObj, addObj) {
baseObj[key] = addOnMerge(base, add);
break;
case 'string':
if (!~[ 'name', 'since', '__file' ].indexOf(key)) {
baseObj[key] += ' ' + add;
} else if (key === 'since') {
if (key === 'since') {
const platforms = baseObj.platforms || Object.keys(common.DEFAULT_VERSIONS);
const since = {};

Expand All @@ -598,7 +596,6 @@ function addOnMerge(baseObj, addObj) {
common.log(common.LOG_WARN, 'Cannot set since version. Set since as a dictionary or add the platforms property.');
break;
}

baseObj[key] = since;
}
break;
Expand Down
36 changes: 30 additions & 6 deletions apidoc/lib/changes_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,39 @@ function checkVersions(api, startVersion, endVersion, className) {

if (assert(api, 'deprecated')) {
if (assert(api.deprecated, 'removed')) {
if (nodeappc.lte(startVersion, api.deprecated.removed)) {
if (!endVersion || (endVersion && nodeappc.gt(endVersion, api.deprecated.removed))) {
rv.removed = true;
let versions = [];
if (api.deprecated.removed instanceof Object) {
for (let key in api.deprecated.removed) {
versions.push(api.deprecated.removed[key]);
}
} else {
versions.push(api.deprecated.removed);
}
for (let version of versions) {
if (nodeappc.lte(startVersion, version)) {
if (!endVersion || (endVersion && nodeappc.gt(endVersion, version))) {
rv.removed = true;
break;
}
}
}
}
if (nodeappc.lte(startVersion, api.deprecated.since)) {
if (!endVersion || (endVersion && nodeappc.gt(endVersion, api.deprecated.since))) {
rv.deprecated = true;
if (assert(api.deprecated, 'since')) {
let versions = [];
if (api.deprecated.since instanceof Object) {
for (let key in api.deprecated.since) {
versions.push(api.deprecated.since[key]);
}
} else {
versions.push(api.deprecated.since);
}
for (let version of versions) {
if (nodeappc.lte(startVersion, version)) {
if (!endVersion || (endVersion && nodeappc.gt(endVersion, version))) {
rv.deprecated = true;
break;
}
}
}
}
rv.name = className ? className + '.' + api.name : api.name;
Expand Down