mason now generates HTML documentation using help.html
parent
b917e1f051
commit
e38bc79e06
|
@ -92,16 +92,14 @@ M: topic browser-link-href topic>filename ;
|
||||||
all-topics [ help>html ] each ;
|
all-topics [ help>html ] each ;
|
||||||
|
|
||||||
: generate-help ( -- )
|
: generate-help ( -- )
|
||||||
{ "resource:core" "resource:basis" "resource:extra" } vocab-roots [
|
"docs" temp-file
|
||||||
load-everything
|
[ make-directories ]
|
||||||
|
[
|
||||||
"/tmp/docs/" make-directory
|
[
|
||||||
|
|
||||||
"/tmp/docs/" [
|
|
||||||
generate-indices
|
generate-indices
|
||||||
generate-help-files
|
generate-help-files
|
||||||
] with-directory
|
] with-directory
|
||||||
] with-variable ;
|
] bi ;
|
||||||
|
|
||||||
MEMO: load-index ( name -- index )
|
MEMO: load-index ( name -- index )
|
||||||
binary file-contents bytes>object ;
|
binary file-contents bytes>object ;
|
||||||
|
@ -119,10 +117,10 @@ M: result link-href href>> ;
|
||||||
[ [ title>> ] compare ] sort ;
|
[ [ title>> ] compare ] sort ;
|
||||||
|
|
||||||
: article-apropos ( string -- results )
|
: article-apropos ( string -- results )
|
||||||
"articles.idx" offline-apropos ;
|
"articles.idx" temp-file offline-apropos ;
|
||||||
|
|
||||||
: word-apropos ( string -- results )
|
: word-apropos ( string -- results )
|
||||||
"words.idx" offline-apropos ;
|
"words.idx" temp-file offline-apropos ;
|
||||||
|
|
||||||
: vocab-apropos ( string -- results )
|
: vocab-apropos ( string -- results )
|
||||||
"vocabs.idx" offline-apropos ;
|
"vocabs.idx" temp-file offline-apropos ;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
USING: kernel namespaces sequences splitting system accessors
|
USING: kernel namespaces sequences splitting system accessors
|
||||||
math.functions make io io.files io.launcher io.encodings.utf8
|
math.functions make io io.files io.launcher io.encodings.utf8
|
||||||
prettyprint combinators.short-circuit parser combinators
|
prettyprint combinators.short-circuit parser combinators
|
||||||
calendar calendar.format arrays mason.config ;
|
calendar calendar.format arrays mason.config locals ;
|
||||||
IN: mason.common
|
IN: mason.common
|
||||||
|
|
||||||
: short-running-process ( command -- )
|
: short-running-process ( command -- )
|
||||||
|
@ -13,6 +13,13 @@ IN: mason.common
|
||||||
15 minutes >>timeout
|
15 minutes >>timeout
|
||||||
try-process ;
|
try-process ;
|
||||||
|
|
||||||
|
:: upload-safely ( local username host remote -- )
|
||||||
|
[let* | temp [ remote ".incomplete" append ]
|
||||||
|
scp-remote [ { username "@" host ":" temp } concat ] |
|
||||||
|
{ "scp" local scp-remote } short-running-process
|
||||||
|
{ "ssh" host "-l" username "mv" temp remote } short-running-process
|
||||||
|
] ;
|
||||||
|
|
||||||
: eval-file ( file -- obj )
|
: eval-file ( file -- obj )
|
||||||
dup utf8 file-lines parse-fresh
|
dup utf8 file-lines parse-fresh
|
||||||
[ "Empty file: " swap append throw ] [ nip first ] if-empty ;
|
[ "Empty file: " swap append throw ] [ nip first ] if-empty ;
|
||||||
|
@ -71,6 +78,7 @@ SYMBOL: stamp
|
||||||
: test-time-file "test-time" ;
|
: test-time-file "test-time" ;
|
||||||
: help-lint-time-file "help-lint-time" ;
|
: help-lint-time-file "help-lint-time" ;
|
||||||
: benchmark-time-file "benchmark-time" ;
|
: benchmark-time-file "benchmark-time" ;
|
||||||
|
: html-help-time-file "html-help-time" ;
|
||||||
|
|
||||||
: benchmarks-file "benchmarks" ;
|
: benchmarks-file "benchmarks" ;
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,23 @@ target-os get-global [
|
||||||
! Keep test-log around?
|
! Keep test-log around?
|
||||||
SYMBOL: builder-debug
|
SYMBOL: builder-debug
|
||||||
|
|
||||||
! Boolean. Do we release binaries and update the clean branch?
|
SYMBOL: upload-help?
|
||||||
SYMBOL: upload-to-factorcode
|
|
||||||
|
|
||||||
! The below are only needed if upload-to-factorcode is true.
|
! The below are only needed if upload-help is true.
|
||||||
|
|
||||||
|
! Host with HTML help
|
||||||
|
SYMBOL: help-host
|
||||||
|
|
||||||
|
! Username to log in.
|
||||||
|
SYMBOL: help-username
|
||||||
|
|
||||||
|
! Directory to upload docs to.
|
||||||
|
SYMBOL: help-directory
|
||||||
|
|
||||||
|
! Boolean. Do we release binaries and update the clean branch?
|
||||||
|
SYMBOL: upload-to-factorcode?
|
||||||
|
|
||||||
|
! The below are only needed if upload-to-factorcode? is true.
|
||||||
|
|
||||||
! Host with clean git repo.
|
! Host with clean git repo.
|
||||||
SYMBOL: branch-host
|
SYMBOL: branch-host
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
USING: help.html sequences io.files io.launcher make namespaces
|
||||||
|
kernel arrays mason.common mason.config ;
|
||||||
|
IN: mason.help
|
||||||
|
|
||||||
|
: make-help-archive ( -- )
|
||||||
|
"factor/temp" [
|
||||||
|
{ "tar" "cfz" "docs.tar.gz" "docs" } try-process
|
||||||
|
] with-directory ;
|
||||||
|
|
||||||
|
: upload-help-archive ( -- )
|
||||||
|
"factor/temp/docs.tar.gz"
|
||||||
|
help-username get
|
||||||
|
help-host get
|
||||||
|
help-directory get "/docs.tar.gz" append
|
||||||
|
upload-safely ;
|
||||||
|
|
||||||
|
: upload-help ( -- )
|
||||||
|
upload-help? get [
|
||||||
|
make-help-archive
|
||||||
|
upload-help-archive
|
||||||
|
] when ;
|
|
@ -45,4 +45,4 @@ IN: mason.release.branch
|
||||||
] with-directory ;
|
] with-directory ;
|
||||||
|
|
||||||
: update-clean-branch ( -- )
|
: update-clean-branch ( -- )
|
||||||
upload-to-factorcode get [ (update-clean-branch) ] when ;
|
upload-to-factorcode? get [ (update-clean-branch) ] when ;
|
||||||
|
|
|
@ -1,38 +1,4 @@
|
||||||
IN: mason.release.upload.tests
|
IN: mason.release.upload.tests
|
||||||
USING: mason.release.upload mason.common mason.config
|
USING: mason.release.upload tools.test ;
|
||||||
mason.common namespaces calendar tools.test ;
|
|
||||||
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"scp"
|
|
||||||
"factor-linux-ppc-2008-09-11-23-12.tar.gz"
|
|
||||||
"slava@www.apple.com:/uploads/linux-ppc/factor-linux-ppc-2008-09-11-23-12.tar.gz.incomplete"
|
|
||||||
}
|
|
||||||
{
|
|
||||||
"ssh"
|
|
||||||
"www.apple.com"
|
|
||||||
"-l" "slava"
|
|
||||||
"mv"
|
|
||||||
"/uploads/linux-ppc/factor-linux-ppc-2008-09-11-23-12.tar.gz.incomplete"
|
|
||||||
"/uploads/linux-ppc/factor-linux-ppc-2008-09-11-23-12.tar.gz"
|
|
||||||
}
|
|
||||||
] [
|
|
||||||
[
|
|
||||||
"slava" upload-username set
|
|
||||||
"www.apple.com" upload-host set
|
|
||||||
"/uploads" upload-directory set
|
|
||||||
"linux" target-os set
|
|
||||||
"ppc" target-cpu set
|
|
||||||
T{ timestamp
|
|
||||||
{ year 2008 }
|
|
||||||
{ month 09 }
|
|
||||||
{ day 11 }
|
|
||||||
{ hour 23 }
|
|
||||||
{ minute 12 }
|
|
||||||
} datestamp stamp set
|
|
||||||
upload-command
|
|
||||||
rename-command
|
|
||||||
] with-scope
|
|
||||||
] unit-test
|
|
||||||
|
|
||||||
\ upload must-infer
|
\ upload must-infer
|
||||||
|
|
|
@ -11,37 +11,11 @@ IN: mason.release.upload
|
||||||
: remote-archive-name ( -- dest )
|
: remote-archive-name ( -- dest )
|
||||||
remote-location "/" archive-name 3append ;
|
remote-location "/" archive-name 3append ;
|
||||||
|
|
||||||
: temp-archive-name ( -- dest )
|
|
||||||
remote-archive-name ".incomplete" append ;
|
|
||||||
|
|
||||||
: upload-command ( -- args )
|
|
||||||
"scp"
|
|
||||||
archive-name
|
|
||||||
[
|
|
||||||
upload-username get % "@" %
|
|
||||||
upload-host get % ":" %
|
|
||||||
temp-archive-name %
|
|
||||||
] "" make
|
|
||||||
3array ;
|
|
||||||
|
|
||||||
: rename-command ( -- args )
|
|
||||||
[
|
|
||||||
"ssh" ,
|
|
||||||
upload-host get ,
|
|
||||||
"-l" ,
|
|
||||||
upload-username get ,
|
|
||||||
"mv" ,
|
|
||||||
temp-archive-name ,
|
|
||||||
remote-archive-name ,
|
|
||||||
] { } make ;
|
|
||||||
|
|
||||||
: upload-temp-file ( -- )
|
|
||||||
upload-command short-running-process ;
|
|
||||||
|
|
||||||
: rename-temp-file ( -- )
|
|
||||||
rename-command short-running-process ;
|
|
||||||
|
|
||||||
: upload ( -- )
|
: upload ( -- )
|
||||||
upload-to-factorcode get
|
upload-to-factorcode? get [
|
||||||
[ upload-temp-file rename-temp-file ]
|
archive-name
|
||||||
when ;
|
upload-username get
|
||||||
|
upload-host get
|
||||||
|
remote-archive-name
|
||||||
|
upload-safely
|
||||||
|
] when ;
|
||||||
|
|
|
@ -46,6 +46,7 @@ IN: mason.report
|
||||||
test-time-file time.
|
test-time-file time.
|
||||||
help-lint-time-file time.
|
help-lint-time-file time.
|
||||||
benchmark-time-file time.
|
benchmark-time-file time.
|
||||||
|
html-help-time-file time.
|
||||||
|
|
||||||
nl
|
nl
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel namespaces assocs io.files io.encodings.utf8
|
USING: kernel namespaces assocs io.files io.encodings.utf8
|
||||||
prettyprint help.lint benchmark tools.time bootstrap.stage2
|
prettyprint help.lint benchmark tools.time bootstrap.stage2
|
||||||
tools.test tools.vocabs mason.common ;
|
tools.test tools.vocabs help.html mason.common ;
|
||||||
IN: mason.test
|
IN: mason.test
|
||||||
|
|
||||||
: do-load ( -- )
|
: do-load ( -- )
|
||||||
|
@ -33,6 +33,7 @@ IN: mason.test
|
||||||
[ do-tests ] benchmark test-time-file to-file
|
[ do-tests ] benchmark test-time-file to-file
|
||||||
[ do-help-lint ] benchmark help-lint-time-file to-file
|
[ do-help-lint ] benchmark help-lint-time-file to-file
|
||||||
[ do-benchmarks ] benchmark benchmark-time-file to-file
|
[ do-benchmarks ] benchmark benchmark-time-file to-file
|
||||||
|
[ generate-help ] benchmark html-help-time-file to-file
|
||||||
] with-directory ;
|
] with-directory ;
|
||||||
|
|
||||||
MAIN: do-all
|
MAIN: do-all
|
Loading…
Reference in New Issue