Skip to content

Commit

Permalink
SCDoc: removed HelpBase stuff, not needed with just-in-time rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
lijon committed Apr 2, 2011
1 parent 67ed8e2 commit 857f65e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 44 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ if(SC_DOC)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS sclang ${SCDocSources} ${SCDocClasses})

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/HelpBase
DESTINATION ${auxresourcesdir})
endif()

set_directory_properties(
Expand Down
2 changes: 1 addition & 1 deletion HelpSource/compileHelp.scd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SCDoc.helpSourceDir = thisProcess.argv[0];
SCDoc.helpTargetDir = thisProcess.argv[1];
~exitOnDone = {0.exit};
SCDoc.updateAll(doneFunc: ~exitOnDone, threaded: false, gui: false, findExtensions: false, useHelpBase: false);
SCDoc.updateAll(doneFunc: ~exitOnDone, threaded: false, gui: false, findExtensions: false);
47 changes: 6 additions & 41 deletions SCClassLibrary/SCDoc/SCDoc.sc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
SCDoc {
classvar <helpTargetDir;
classvar <helpSourceDir;
classvar <helpBaseDir;
classvar helpSourceDirs;
classvar doc_map = nil;
classvar <p, <r;
Expand All @@ -23,10 +22,6 @@ SCDoc {
^helpSourceDirs;
}

*helpBaseDir_ {|path|
helpBaseDir = path.standardizePath;
}

*helpTargetDir_ {|path|
if(path!=helpTargetDir) {didRun = false};
helpTargetDir = path.standardizePath;
Expand Down Expand Up @@ -85,7 +80,6 @@ SCDoc {

*initClass {
this.helpSourceDir_(thisProcess.platform.classLibraryDir.dirname +/+ "HelpSource");
this.helpBaseDir_(thisProcess.platform.classLibraryDir.dirname +/+ "HelpBase");
this.helpTargetDir_(thisProcess.platform.userAppSupportDir +/+ "Help");
r = SCDocHTMLRenderer.new;
p = SCDocParser.new;
Expand Down Expand Up @@ -251,7 +245,7 @@ SCDoc {
progressWindow.onClose = {progressWindow = nil};
StaticText(progressWindow).string_("Please wait while updating help files...");
progressBar = RangeSlider(progressWindow,300@20).orientation_(\horizontal).background_(Color(0.8,0.8,0.8)).knobColor_(Color(0.5,0.5,0.8));
progressTopic = StaticText(progressWindow).font_(Font.defaultSansFace.boldVariant);
progressTopic = StaticText(progressWindow).font = Font(Font.defaultSansFace,12).boldVariant;
progressText = TextView(progressWindow).editable_(false);
closeButton = Button(progressWindow).states_([["Close"]]).enabled_(false).action = {progressWindow.close; progressWindow = nil};
progressWindow.front;
Expand Down Expand Up @@ -289,36 +283,11 @@ SCDoc {

*tickProgress { progressCount = progressCount + 1 }

*initHelpTargetDir {
var sysdir = helpBaseDir.escapeChar($ );
var stamp = helpTargetDir.escapeChar($ )+/+"helpbase_timestamp";
/*
NOTE:
if the system-wide HelpBase dir was updated since last time we based our help-dir on it,
then copy it again. Any pre-rendered help that was updated (due to a new version of SC, etc)
will thus be copied over and overwrite the outdated html file in helpTargetDir.
Note that rsync does not check if sourcefile is newer, only if it differs.
This means that scdoc_cache, classlist_cache, helpdirlist_cache will also be replaced,
thus triggering a re-compile of all docs not part of HelpBase (main SC without extensions).
This is probably a good thing, since a new SC version might mean that SCDoc changed internally
and that all docs should be re-compiled.
*/
if(File.exists(helpTargetDir).not or: {("test"+sysdir+"-nt"+stamp+"-o \\! -e"+stamp).systemCmd==0}) {
this.postProgress("Initializing user's help directory", true);
if(File.exists(helpBaseDir)) {
this.postProgress("Basing help tree on pre-rendered help, please wait...");
// ("rsync -ax --link-dest="++sysdir+sysdir++"/"+helpTargetDir.escapeChar($ )+"2>/dev/null").systemCmd;
("rsync -rlt"+sysdir++"/"+helpTargetDir.escapeChar($ )+"2>/dev/null").systemCmd;
this.postProgress("Done, creating timestamp");
("touch -r"+sysdir+stamp).systemCmd;
} {
this.postProgress("No pre-rendered help found, creating from scratch...");
}
};
}

*updateAll {|force=false,doneFunc=nil,threaded=true,gui=true,findExtensions=true,useHelpBase=true|
*updateAll {|force=false,doneFunc=nil,threaded=true,gui=true,findExtensions=true|
//FIXME: rewrite to re-use code from prepareHelpForURL..
//use getAllMetaData here, remove SCDocRenderer.methodlist
//skip the classlist_cache, helpdirlist_cache and similar, and just check mtime for each doc
//according to the mtime stored in doc_map. (or compare with target html)
var func;
var docmap_path = helpTargetDir.escapeChar($ )+/+"scdoc_cache";
var classlist_path = helpTargetDir+/+"classlist_cache";
Expand All @@ -328,10 +297,6 @@ SCDoc {
func = {
var fileList, count, maybeDelete, x, f, n, old_classes, current_classes;

if(useHelpBase) {
this.initHelpTargetDir;
};

if(force.not) {
force = this.readDocMap;
} {
Expand Down

0 comments on commit 857f65e

Please sign in to comment.