Skip to content
This repository was archived by the owner on Jan 15, 2021. It is now read-only.

Commit 2d671fe

Browse files
committed
removing embedded docs in favor of online/pointer version of docs.
1 parent 7bb8471 commit 2d671fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+5268
-1193
lines changed

.ackrc

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
--ignore-file=match:\.d\.ts$
33
--ignore-file=is:tags
44
--ignore-file=is:scripts.cache
5-
--ignore-file=is:help.cache
65
--ignore-file=is:browsers.html
76
--ignore-file=is:error.html
87
--ignore-file=is:beta.json

.vscode/launch.json

+1-19
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,7 @@
2020
"runtimeExecutable": null,
2121
// Environment variables passed to the program.
2222
"env": { }
23-
},
24-
{
25-
// Name of configuration; appears in the launch configuration drop down menu.
26-
"name": "update-docs",
27-
// Type of configuration. Possible values: "node", "mono".
28-
"type": "node",
29-
// Workspace relative or absolute path to the program.
30-
"program": "build/client.js",
31-
// Automatically stop program after launch.
32-
"stopOnEntry": true,
33-
// Command line arguments passed to the program.
34-
"args": ["updatelang"],
35-
// Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace.
36-
"cwd": ".",
37-
// Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH.
38-
"runtimeExecutable": null,
39-
// Environment variables passed to the program.
40-
"env": { }
41-
},
23+
},
4224
{
4325
"name": "attach local",
4426
"type": "node",

.vscode/tasks.json

-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
"taskName": "build",
99
"args": [],
1010
"isTestCommand": false
11-
},
12-
{
13-
"taskName": "docs",
14-
"args": ["update-docs"],
15-
"isTestCommand": false
1611
}
1712
]
1813
}

Jakefile

+1-8
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function runAndComplete(cmds, task) {
123123
});
124124
}
125125

126-
mkSimpleTask('build/genmeta.js', [ 'editor', 'tools', 'generated/help.cache' ], "tools/genmeta.ts");
126+
mkSimpleTask('build/genmeta.js', [ 'editor', 'tools' ], "tools/genmeta.ts");
127127
file('build/api.js', expand([ "build/genmeta.js", "lib" ]), { async: true }, function () {
128128
console.log("[P] generating build/api.js, localization.json and topiclist.json");
129129
runAndComplete(["node build/genmeta.js"], this);
@@ -482,13 +482,6 @@ task('nw', ['default', 'nw-npm'], { async: true }, function() {
482482
runAndComplete([ 'node node_modules/nw/bin/nw build/nw' ], this);
483483
})
484484

485-
task('update-docs', [ 'build/client.js', 'default' ], { async: true }, function() {
486-
var task = this;
487-
runAndComplete(
488-
[ 'node build/client.js updatehelp',
489-
'node build/client.js updatelang'], this);
490-
});
491-
492485
task('update-lang', [ 'build/client.js', 'default' ], { async: true }, function() {
493486
var task = this;
494487
runAndComplete(

README.md

-3
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,6 @@ All the docs are available online at
147147

148148
The docs are authored as Touch Develop scripts in Touch Develop itself. You can
149149
fork them and send pull requests from Touch Develop itself to update them.
150-
You can update the local cache of documents by running this command:
151-
152-
jake update-docs
153150

154151
## More handy commands
155152

ast/api.ts

-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ module TDev {
113113
public operatorKeys:any = {};
114114
public eventMgr:AST.EventMgr;
115115
public restoreFlags = false; // for genStub
116-
public addHelpTopics:any = () => {}
117116
public opStmtPriority = 0.5;
118117

119118
public rt_start = "";

ast/help.ts

+5-50
Original file line numberDiff line numberDiff line change
@@ -1702,8 +1702,6 @@ module TDev {
17021702
public childTopics:HelpTopic[] = [];
17031703

17041704
static contextTopics:HelpTopic[] = [];
1705-
static shippedScripts:any;
1706-
static scriptTemplates:any[];
17071705

17081706
static getScriptAsync:(id:string)=>Promise;
17091707

@@ -1713,8 +1711,6 @@ module TDev {
17131711
constructor(public json:HelpTopicJson)
17141712
{
17151713
this.id = MdComments.shrink(this.json.name);
1716-
if (!json.text && HelpTopic.shippedScripts.hasOwnProperty(json.id))
1717-
json.text = HelpTopic.shippedScripts[json.id]
17181714
}
17191715

17201716
static fromJsonScript(e:JsonScript)
@@ -1793,24 +1789,13 @@ module TDev {
17931789
return t;
17941790
}
17951791

1796-
static getAllTutorials(): HelpTopic[]{
1797-
var tuts = HelpTopic.getAll().filter(ht => ht.isTutorial());
1798-
return tuts;
1799-
}
1800-
18011792
static getAll() : HelpTopic[]
18021793
{
18031794
if (!HelpTopic._initalized) {
18041795
HelpTopic._initalized = true;
1805-
var bestForTag:any = {}
1806-
1807-
HelpTopic._topics.forEach((topic) => {
1808-
bestForTag[topic.id] = topic;
1809-
var ht = topic.hashTags().map(MdComments.shrink);
1810-
if (ht.indexOf("docs") < 0) topic.hashTagsCache.push("#docs");
1811-
var tt = Util.toHashTag(topic.json.name)
1812-
if (ht.indexOf(MdComments.shrink(tt)) < 0) topic.hashTagsCache.push(tt);
1813-
})
1796+
var bestForTag:StringMap<HelpTopic> = {}
1797+
1798+
HelpTopic._topics = [];
18141799

18151800
api.getKinds().forEach((k:Kind) => {
18161801
if (k.isPrivate || k instanceof ThingSetKind || (k.isData && k.getContexts() == KindContext.None)) return;
@@ -1954,17 +1939,6 @@ module TDev {
19541939
return Util.stringCompare(this.id, other.id) < 0;
19551940
}
19561941

1957-
static addMany(scripts:any, topicsJson:HelpTopicJson[], templates:any[])
1958-
{
1959-
HelpTopic.shippedScripts = scripts;
1960-
var sc = (<any>TDev).ScriptCache;
1961-
if (sc) sc.shippedScripts = scripts;
1962-
HelpTopic.scriptTemplates = templates;
1963-
topicsJson.forEach((d) => {
1964-
HelpTopic._topics.push(new HelpTopic(d))
1965-
})
1966-
}
1967-
19681942
public updateKey()
19691943
{
19701944
var j = this.fromJson
@@ -2427,8 +2401,8 @@ module TDev {
24272401
}
24282402

24292403

2430-
static topicCache:any;
2431-
static topicByScriptId:any;
2404+
static topicCache:StringMap<HelpTopic>;
2405+
static topicByScriptId:StringMap<HelpTopic>;
24322406
static findById(id:string):HelpTopic
24332407
{
24342408
// deprecated in lite
@@ -2443,24 +2417,5 @@ module TDev {
24432417
return HelpTopic.topicCache[id];
24442418
return null;
24452419
}
2446-
2447-
static testSplit(id:string)
2448-
{
2449-
var h = HelpTopic.findById(id)
2450-
if (h)
2451-
h.renderAsync().done(text => {
2452-
console.log(MdComments.splitDivs(text))
2453-
})
2454-
}
2455-
2456-
static findByScriptId(id:string):HelpTopic
2457-
{
2458-
if (!HelpTopic.topicByScriptId) HelpTopic.findById("anything");
2459-
if (HelpTopic.topicByScriptId.hasOwnProperty(id))
2460-
return HelpTopic.topicByScriptId[id]
2461-
}
2462-
24632420
}
2464-
2465-
TDev.api.addHelpTopics = HelpTopic.addMany;
24662421
}

editor/hub.ts

+22-48
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module TDev.Browser {
6161

6262
scriptSocialLinks: true,
6363
scriptEmail: true,
64-
scriptAddToChannel:true,
64+
scriptAddToChannel: true,
6565
}
6666
},
6767
'classic': {
@@ -142,7 +142,6 @@ module TDev.Browser {
142142
startTutorialButton: true,
143143
publicationComments: true,
144144
translateComments: true,
145-
searchHelp: true,
146145
outAssign: true,
147146

148147
scriptSocialLinks: true,
@@ -278,7 +277,6 @@ module TDev.Browser {
278277
hubChannels: true,
279278
publicationComments: true,
280279
translateComments: true,
281-
searchHelp: true,
282280
outAssign: true,
283281

284282
scriptSocialLinks: true,
@@ -362,6 +360,7 @@ module TDev.Browser {
362360
ifConditionDefault: "true",
363361

364362
scriptSocialLinks: true,
363+
scriptAddToChannel: true,
365364
}
366365
}
367366
},
@@ -699,7 +698,6 @@ module TDev.Browser {
699698
(Cloud.hasPermission("internal") ? HTML.mkButton(lf("my scripts"), () => { Util.setHash("#list:installed-scripts") }) : null),
700699
(Cloud.hasPermission("internal") ? HTML.mkButton(lf("my groups"), () => { Util.setHash("#list:mygroups") }) : null),
701700
(Cloud.hasPermission("internal") ? HTML.mkButton(lf("create script"), () => { TemplateManager.createScript() }) : null),
702-
(Cloud.hasPermission("root-ptr") ? HTML.mkButton(lf("import docs"), () => { Browser.TheHub.importDocs() }) : null),
703701
// (Cloud.hasPermission("user-mgmt") ? HTML.mkButton(lf("abuse reports"), () => { Util.setHash("#list:installed-scripts:abusereports") }) : null),
704702
(Cloud.hasPermission("user-mgmt") ? HTML.mkButton(lf("abuse review"), () => { AbuseReview.show() }) : null),
705703
(Cloud.hasPermission("admin") ? HTML.mkButton(lf("API config"), () => { editApiConfig() }) : null),
@@ -1561,8 +1559,8 @@ module TDev.Browser {
15611559
function getAvailableTemplates():ScriptTemplate[]
15621560
{
15631561
if (!_templates) {
1564-
_templates = HelpTopic.scriptTemplates.filter(t => isBeta || !t.betaOnly);
1565-
_templates.forEach((t) => { t.source = HelpTopic.shippedScripts[t.scriptid] })
1562+
_templates = (<any>TDev).scriptTemplates.filter(t => isBeta || !t.betaOnly);
1563+
_templates.forEach(t => t.source = ScriptCache.forcedUpdate(t.scriptid).text);
15661564
}
15671565
// filter by editor mode
15681566
var currentCap = PlatformCapabilityManager.current();
@@ -2905,14 +2903,11 @@ module TDev.Browser {
29052903
})
29062904
}
29072905

2908-
private showSimplifiedLearn(container:HTMLElement) {
2906+
private showSimplifiedLearn(container: HTMLElement) {
29092907
var buttons = [];
2910-
var theme = EditorSettings.currentTheme;
2911-
var helpTopic = HelpTopic.findById((theme && theme.tutorialsTopic) ? theme.tutorialsTopic : "tutorials");
2912-
if (!helpTopic) {
2913-
Util.log("help topic not found"); return;
2914-
}
2915-
this.fetchAllTutorials(helpTopic, (tutorial: ITutorial) => {
2908+
var tutorials: ITutorial[] = []; // TODO
2909+
2910+
tutorials.slice(0, 6).forEach((tutorial: ITutorial) => {
29162911
// We just listen for the first eight tutorials.
29172912
if (buttons.length > 6)
29182913
return;
@@ -2927,7 +2922,7 @@ module TDev.Browser {
29272922
btn.style.backgroundSize = "cover";
29282923
btn.style.backgroundPosition = 'center';
29292924
} else {
2930-
TheApiCacheMgr.getAnd(tutorial.topic.json.id + "/screenshots?count=1",(res: JsonList) => {
2925+
TheApiCacheMgr.getAnd(tutorial.topic.json.id + "/screenshots?count=1", (res: JsonList) => {
29312926
var sc = res.items[0];
29322927
if (sc) {
29332928
btn.style.backgroundImage = Cloud.artCssImg(sc.id, true);
@@ -2939,15 +2934,12 @@ module TDev.Browser {
29392934

29402935
ScriptInfo.addTutorialProgress(btn, tutorial.header);
29412936
buttons.push(btn);
2942-
2943-
if (buttons.length == 6) {
2944-
buttons.push(this.createSkillButton());
2945-
buttons.push(this.mkFnBtn(lf("All tutorials"), () => {
2946-
Util.setHash('#topic:' + helpTopic.id);
2947-
}, Ticks.noEvent, false, 1));
2948-
this.layoutTiles(container, buttons);
2949-
}
29502937
});
2938+
2939+
buttons.push(this.createSkillButton());
2940+
buttons.push(this.mkFnBtn(lf("All tutorials"), () => this.browser().showList(Cloud.config.tutorialsid + "/scripts"), Ticks.noEvent, false, 1));
2941+
this.layoutTiles(container, buttons);
2942+
29512943
}
29522944

29532945
private createSkillButton(): HTMLElement {
@@ -2966,7 +2958,6 @@ module TDev.Browser {
29662958
return btn;
29672959
}
29682960

2969-
var sellApps:HTMLElement;
29702961
var docsEl: HTMLElement;
29712962
var ccgaEl: HTMLElement;
29722963
var whatsNew: HTMLElement;
@@ -2976,41 +2967,24 @@ module TDev.Browser {
29762967
var searchEl: HTMLElement;
29772968
var elements = [
29782969
this.startTutorialButton(Ticks.hubDocsTutorial),
2979-
docsEl = toTutBtn(this.mkFnBtn(lf("Search Help"), () => {
2980-
this.hide();
2981-
this.browser().loadHash(["help"]);
2970+
docsEl = toTutBtn(this.mkFnBtn(lf("Docs"), () => {
2971+
Util.navigateNewWindow(Cloud.config.helpPath);
29822972
}, Ticks.hubDocs, false, 2)),
2983-
//advancedEl = toTutBtn(this.mkFnBtn(lf("Advanced Tutorial"), () => {
2984-
// Util.setHash('#topic:devbootcamp')
2985-
//}, Ticks.hubDevBootCamp, false)),
29862973
whatsNew = toTutBtn(this.mkFnBtn(lf("What's new"), () => {
2987-
Util.setHash('#topic:whatsnew')
2974+
Util.navigateNewWindow(Cloud.config.helpPath + "/whatsnew");
29882975
}, Ticks.hubDocsWhatsNew, true)),
2989-
sellApps = this.exportBtn(lf("Export to Windows, Android, iOS, Azure"), () => {
2990-
Hub.winStoreHelp();
2991-
}, Ticks.hubWinStore),
2992-
begginersEl = toTutBtn(this.smallBtn(lf("Getting started"), () => {
2993-
Util.setHash('#topic:gettingstarted');
2976+
begginersEl = toTutBtn(this.mkFnBtn(lf("Getting started"), () => {
2977+
Util.navigateNewWindow(Cloud.config.helpPath + "/gettingstarted");
29942978
}, Ticks.hubBeginnersGettingStarted, true)),
2995-
ccgaEl = toTutBtn(this.smallBtn(lf("Teach Creative Coding!"), () => {
2996-
Util.navigateInWindow("/ccga");
2979+
ccgaEl = toTutBtn(this.mkFnBtn(lf("Teach Creative Coding!"), () => {
2980+
Util.navigateNewWindow("/ccga");
29972981
}, Ticks.hubCCGA, true)),
2998-
/*
2999-
apiEl = toTutBtn(this.smallBtn(lf("API Docs"), () => {
3000-
Util.setHash('#topic:api')
3001-
}, Ticks.hubDocsApi, true)),
3002-
*/
30032982
// this button says "Search", which means "search" not "search docs" - "Help" is for that
30042983
searchEl = this.mkFnBtn(lf("Search everything"), () => { this.hide(); this.browser().showList("search", null); }, Ticks.hubChatSearch, false),
30052984
this.createSkillButton(),
30062985
settings = this.smallBtn(lf("Settings"), () => {
30072986
TheEditor.popupMenu()
3008-
}, Ticks.hubSettings),
3009-
Runtime.rateTouchDevelop && localStorage["rateTouchDevelop"] == 1 ?
3010-
rate = this.mkFnBtn(lf("Rate Touch- Develop"), () => {
3011-
localStorage["rateTouchDevelop"] = 2;
3012-
Runtime.rateTouchDevelop();
3013-
}, Ticks.hubRateTouchdevelop, false) : null,
2987+
}, Ticks.hubSettings)
30142988
];
30152989
elements = elements.filter((e) => e != null);
30162990
searchEl.appendChild(div("hubTileSearch", HTML.mkImg("svg:search,white")));

editor/scriptList.ts

-16
Original file line numberDiff line numberDiff line change
@@ -909,14 +909,6 @@
909909
elts.push(searchDiv);
910910
} else if (items.length == 0 && !direct.hasChildNodes()) {
911911
elts.push(div("sdLoadingMore", lf("no results match your search")));
912-
if (EditorSettings.widgets().searchHelp) {
913-
var t = HelpTopic.findById("howtosearch");
914-
if (t) {
915-
var s = TopicInfo.mk(t);
916-
var b = s.mkSmallBox();
917-
elts.push(b);
918-
}
919-
}
920912
}
921913

922914
sd.setChildren(elts);
@@ -1437,11 +1429,6 @@
14371429
return Promise.as();
14381430
}
14391431

1440-
if (apiPath == "topics" || apiPath == "help") {
1441-
f(HelpTopic.getAll().map(TopicInfo.mk), null);
1442-
return Promise.as();
1443-
}
1444-
14451432
var suspended = <ApiCacheEntry[]>[];
14461433

14471434
var handle = (lst:JsonList, opts?:DataOptions) => {
@@ -7640,9 +7627,6 @@
76407627
setBtn(-1, ha < 0 ? "0" : ha.toString(), () => {});
76417628
Util.httpPostJsonAsync(Cloud.getPrivateApiUrl(id + "/reviews"), { kind: "review", userplatform: Browser.platformCaps })
76427629
.done((resp: JsonReview) => {
7643-
if (localStorage["rateTouchDevelop"] != 2) {
7644-
localStorage["rateTouchDevelop"] = 1;
7645-
}
76467630
TheApiCacheMgr.storeHeart(id, resp.id);
76477631
patchScriptHeartCount(jscript, Math.max(ha,0)+1);
76487632
load(3, getScriptHeartCount(jscript));

editor/tutorial.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1106,12 +1106,12 @@ module TDev
11061106
var moreTutorials = <HTMLUListElement>createElement('ul', 'tutorial-list');
11071107

11081108
var tutLength = 8 - (moreTutorialsId ? 1 : 0);
1109-
var allTutorials = HelpTopic.getAllTutorials();
1109+
var allTutorials = []; // TODO: fix all tutorials
11101110
var theme = Browser.EditorSettings.currentTheme;
11111111
var score = (ht: HelpTopic) => {
11121112
var sc = 0;
11131113
if (this.hourOfCode && ht.isHourOfCode()) sc += 100;
1114-
if (/jetpack/i.test(ht.id)) sc += 25;
1114+
if (/jetpack|flashverse/i.test(ht.id)) sc += 25;
11151115
if (/jump/i.test(ht.id)) sc += 20;
11161116
if (progs[ht.updateKey()]) sc -= 50;
11171117
if (theme && theme.scriptSearch) sc += ht.hashTags().indexOf(theme.scriptSearch) > -1 ? 200 : 0;

0 commit comments

Comments
 (0)