Skip to content

Commit bc1bdc5

Browse files
committed
Transformed into a Tatin package
1 parent 2af2773 commit bc1bdc5

Some content is hidden

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

48 files changed

+423
-233
lines changed

APLSource/Admin/Make.aplf

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,57 @@
1-
{r}←Make flag;⎕IO;⎕ML;targetPath;name;projName;myUCMDsFolder;M;home;version
2-
⍝ Version 4.0.0 ⋄ 2022-08-23
3-
⎕IO←1 ⋄ ⎕ML←1
4-
r←⍬
1+
Make flag;M;C;path;zipFilename;res;version;cfg;parms
2+
⍝ "Make" a new version of this project
53
:If flag
6-
home←##.CiderConfig.HOME,'/'
7-
targetPath←home,'Dist/'
8-
myUCMDsFolder←⎕SE.MakeHelpers.GetMyUCMDsFolder''
9-
name←'CodeBrowser'
104
M←⎕SE.MakeHelpers
11-
⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝
12-
M.RecreateFolder targetPath
13-
M.RecreateFolder targetPath,'/',name,'/APLSource'
14-
:If ⎕NEXISTS myUCMDsFolder,'/',name,'/',name,'_uc.dyalog'
15-
M.CopyBetter(myUCMDsFolder,'/',name,'/',name,'_uc.dyalog')(home,'APLSource/',name,'_uc.dyalog')'User command version' 'APL Code'
16-
{}⎕SE.Link.Refresh #.CodeBrowser
5+
C←##.CiderConfig
6+
path←C.HOME,'/',C.CIDER.distributionFolder
7+
cfg←⎕JSON⍠('Dialect' 'JSON5')⊢⊃⎕NGET C.HOME,'/apl-package.json'
8+
M.FetchLaterUserCommand(⊃,/1↓⎕NPARTS cfg.userCommandScript)cfg C('[MyUCMDs]',cfg.name)
9+
version←M.CompileVersionNumberPattern cfg
10+
M.RecreateFolder path
11+
{}M.CreateAPIfromCFG(⍎'##.',cfg.name)cfg
12+
parms←⎕SE.Tatin.CreateBuildParms C.HOME
13+
parms.targetPath←path
14+
parms.version←version
15+
zipFilename←⎕SE.Tatin.BuildPackage parms
16+
⎕←'*** New version build successfully:',M.CR,' ',zipFilename
17+
:If 1 M.YesOrNo'Install new version in MyUCMDs?'
18+
{}M.##.FilesAndDirs.RmDirByForce M.GetMyUCMDsFolder cfg.name
19+
res←⎕SE.Tatin.InstallPackages zipFilename'[MyUCMDs]'
20+
⎕←' New version installed as user command in MyUCMDs/: ',res
1721
:EndIf
18-
version←M.IncreaseBuildID'#.',name,'.',name,'.Version'
19-
version←{⍵↑⍨¯1+⍵⍳'+'}version ⍝ Ridden build id
20-
CodeBrowserOnCodeBrowser targetPath,name,'/CodeBrowser_CodeReview.html'
21-
M.CreateAPI ##.CodeBrowser ##.CodeBrowser.Public
22-
(targetPath,name,'/APLSource/')⎕NCOPY⍠('Wildcard' 1)⊣home,'APLSource/',name,'/*'
23-
(targetPath,name,'/')⎕NCOPY home,'APLSource/',name,'_uc.dyalog'
24-
(targetPath,name,'/')⎕NCOPY home,'Files/codebrowser_styles.css'
25-
(targetPath,name,'/')⎕NCOPY home,'packages/'
26-
M.CreateZipFile name targetPath version
27-
:If 1 M.YesOrNo'Copy the user command to MyUCMDs?'
28-
M.RecreateFolder myUCMDsFolder,'/',name
29-
myUCMDsFolder ⎕NCOPY targetPath,name
22+
:EndIf
23+
⍝Done
24+
25+
:If 0
26+
⍝ {r}←Make flag;⎕IO;⎕ML;targetPath;name;projName;myUCMDsFolder;M;home;version
27+
⍝ Version 4.0.0 ⋄ 2022-08-23
28+
⎕IO←1 ⋄ ⎕ML←1
29+
r←⍬
30+
:If flag
31+
home←##.CiderConfig.HOME,'/'
32+
targetPath←home,'Dist/'
33+
myUCMDsFolder←⎕SE.MakeHelpers.GetMyUCMDsFolder''
34+
name←'CodeBrowser'
35+
M←⎕SE.MakeHelpers
36+
⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝
37+
M.RecreateFolder targetPath
38+
M.RecreateFolder targetPath,'/',name,'/APLSource'
39+
:If ⎕NEXISTS myUCMDsFolder,'/',name,'/',name,'_uc.dyalog'
40+
M.CopyBetter(myUCMDsFolder,'/',name,'/',name,'_uc.dyalog')(home,'APLSource/',name,'_uc.dyalog')'User command version' 'APL Code'
41+
{}⎕SE.Link.Refresh #.CodeBrowser
42+
:EndIf
43+
version←M.IncreaseBuildID'#.',name,'.',name,'.Version'
44+
version←{⍵↑⍨¯1+⍵⍳'+'}version ⍝ Ridden build id
45+
CodeBrowserOnCodeBrowser targetPath,name,'/CodeBrowser_CodeReview.html'
46+
M.CreateAPI ##.CodeBrowser ##.CodeBrowser.Public
47+
(targetPath,name,'/APLSource/')⎕NCOPY⍠('Wildcard' 1)⊣home,'APLSource/',name,'/*'
48+
(targetPath,name,'/')⎕NCOPY home,'APLSource/',name,'_uc.dyalog'
49+
(targetPath,name,'/')⎕NCOPY home,'Files/codebrowser_styles.css'
50+
(targetPath,name,'/')⎕NCOPY home,'packages/'
51+
M.CreateZipFile name targetPath version
52+
:If 1 M.YesOrNo'Copy the user command to MyUCMDs?'
53+
M.RecreateFolder myUCMDsFolder,'/',name
54+
myUCMDsFolder ⎕NCOPY targetPath,name
55+
:EndIf
3056
:EndIf
3157
:EndIf

APLSource/CodeBrowser/ADOC_Doc.apla

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@
66
'a stand-alone HTML page from it.'
77
''
88
'It''s a tool to view all the code of such namespace(s) in a single HTML document. Extensive linking allows you to jump'
9-
'around easily, making it ideal for a code reviewing.'
9+
'around easily, making it ideal for code reviewing.'
1010
''
1111
''
1212
'## Requirements'
1313
''
14-
'Codebrowser relies on the [Tatin packet manager](https://github.com/aplteam/Tatin) to be available.'
14+
'`Codebrowser` is a Tatin package and therefore required [Tatin packet manager](https://github.com/aplteam/Tatin) to be available.'
15+
'Tatin runs only in Dyalog 18.0 and later, therefore `CodeBrowser` is 18.0 or later as well.'
1516
''
1617
''
1718
'## Installation'
1819
''
19-
'In order to use it you need to download it from [GitHub](https://github.com/aplteam/CodeBrowser). The folder '
20-
'"CodeBrowser" needs to go into any folder that is scanned by Dyalog for user commands.'
20+
'In order to use execute the following statement:'
21+
''
22+
'```'
23+
']LoadPackages [tatin]aplteam-CodeBrowser [MyUCMDs]'
24+
'```'
2125
''
2226
'Restart Dyalog APL or execute the command `]UReset` which will make it available in an already running session.'
2327
''
@@ -41,10 +45,10 @@
4145
''
4246
'There are several flags available which allow you to adapt the behaviour and/or the information shown by `CodeBrowser`.'
4347
''
44-
'For details regarding those options and flags execute `]CodeBrowser -?`.'
48+
'For details regarding those options and flags execute `]CodeBrowser -??`.'
4549
''
4650
'However, not all parameters can be set this way. If you need to set one of the parameters that are not available via'
47-
'the user command interface then you have to consider the two other ways to use `CodeBrowser` because they give you full'
51+
'the user command interface then you have to consider the two other ways to use `CodeBrowser` because they give you '
4852
'access to all parameters.'
4953
''
5054
''
@@ -65,27 +69,18 @@
6569
'## CodeBrowser''s API'
6670
''
6771
'Use this when you want to take advantage of parameters that are not available via the user command interface and the GUI'
68-
'is not an option for you or you want to create CodeBrowser''s HTML page under program control. In this case the GUI is not '
72+
'is not an option for you, or you want to create CodeBrowser''s HTML page under program control. In this case the GUI is not '
6973
'suitable of course.'
7074
''
71-
'For the API to become available you may execute `]CoderBrowser -version`. This is the lazy approach. '
72-
''
73-
'To make CodeBrowser available from the start of your APL session you need to add it to Dyalog''s start-up procedure.'
74-
'Refer to the Dyalog documentation for this.'
75-
''
76-
'`CodeBrowser` does not only comprise a namespace `CodeBrowser`, it also comes with a number of Tatin packages.'
77-
'That''s why Tatin is a requirement: only then can Tatin packages be loaded.'
78-
''
7975
'### Example'
8076
''
8177
'```'
82-
' ]CoderBrowser -version ⍝ Loads the code into ⎕SE'
8378
' parms←⎕SE.CodeBrowser.CreateParms ⍬'
8479
' parms.caption←''My First Ty'''
8580
' parms ⎕SE.CodeBrowser.Run #'
8681
'```'
8782
''
88-
'Note that you can get a list of all (almost) parameters with their current values by calling the `∆List` function:'
83+
'Note that you can get a list of (almost) all parameters with their current values by calling the `∆List` function:'
8984
''
9085
'```'
9186
' (⎕SE.CodeBrowser.CreateParms'''').∆List '''''
@@ -112,7 +107,7 @@
112107
' recursive 1 '
113108
' showParms 0 '
114109
' twoSidedPrint 0 '
115-
' version CodeBrowser 2.0.0+83 from 2022-01-17 '
110+
' version CodeBrowser 3.0.0+94 from 2023-06-17 '
116111
' viewInBrowser 0 '
117112
'```'
118113
''
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
r←Version
2+
r←##.Version

APLSource/CodeBrowser/AddMainMenu_.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
html←⊂'<ol>'
33
i←1
44
:Repeat
5-
:If ~0∊⍴refs
5+
:If 0≠≢refs
66
html,←{'<li>'('<a href="#',(collect.remove RemoveLevels⍕⍵),'">',((⊃{⍺,'.',⍵}/⍕¨level),'. ',⍕⍵),'</a>')}refs[i;2]
77
:If 0<noOf←{+/∧\1↓⍵[;1]>⊃⍵}(i-1)↓refs
88
html,←(level,1)AddMainMenu_(noOf↑i↓refs)collect
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CreateParms←{##.CreateParms ⍵}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MoreHelp←{##.MoreHelp ⍵}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Run←{⍺←⊢ ⋄ ⍺ ##.Run ⍵}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Selfie←{##.Selfie ⍵}

APLSource/CodeBrowser/CreateToc.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
:EndIf
2727
:If parms.processScripts
2828
:AndIf 0≠≢lists.scripts←ListScriptsIn ref
29-
:AndIf 0≠≢lists.scripts←(~(ref.{0∊⍴⊃,/⍵:⍵ ⋄ ⍎¨⍵}lists.scripts)∊parms.ignore)/lists.scripts
29+
:AndIf 0≠≢lists.scripts←(~(ref.{0=≢⊃,/⍵:⍵ ⋄ ⍎¨⍵}lists.scripts)∊parms.ignore)/lists.scripts
3030
(html flag)←html OpenNavSub flag
3131
html,←CreateToc_ ref parms lists.scripts'Script'collect width
3232
:EndIf

APLSource/CodeBrowser/GUI/CreateToBeIgnored.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
∆,←⊂'Size'(⍬(parent.Size[2]-2×n.∆hgap))
1313
∆,←⊂'FontObj'n.∆APL_Font
1414
∆,←⊂'TipObj'n.∆Tip
15-
∆,←⊂'Tip'('Specify everything inside the namespaces to be scanned that you want to be ignored.' 'Specify fully qualified names. Use spaces or commata as separators.')
15+
∆,←⊂'Tip'('Specify namespaces and scripts that you want to be ignored.' 'Specify fully qualified names. Use spaces or commata as separators.')
1616
n.toBeIgnored←⍎'tobeignored'parent.⎕WC ∆
1717
n.toBeIgnored.Size[1]-←5
1818

0 commit comments

Comments
 (0)