Skip to content

Commit fe90c0f

Browse files
committed
]CodeBrowser -<three-question-marks> did not work as expected
1 parent 11a3b11 commit fe90c0f

70 files changed

Lines changed: 814 additions & 864 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
.acre/
21
aplcore
32
Dist/
4-
change_history/
5-
.gitignore
3+
CONTINUE.dws
4+
conga.crash
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{r}←CodeBrowserOnCodeBrowser filename;parms;C
2+
r←⍬
3+
C←#.CodeBrowser.CodeBrowser
4+
parms←C.CreateParms''
5+
parms.lines←¯1
6+
parms.filename←filename
7+
parms.footer←'Created ',(##.APLTreeUtils2.FormatDateTime ⎕TS),' by ',⎕AN
8+
parms.caption←'CodeBrowser on itself'
9+
parms.showParms←1
10+
{}parms C.Run C
11+
⍝Done
File renamed without changes.
File renamed without changes.

APLSource/Admin/Make.aplf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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←⍬
5+
:If flag
6+
home←##.CiderConfig.HOME,'/'
7+
targetPath←home,'Dist/'
8+
myUCMDsFolder←⎕SE.MakeHelpers.GetMyUCMDsFolder''
9+
name←'CodeBrowser'
10+
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
17+
: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
30+
:EndIf
31+
:EndIf
Lines changed: 117 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,119 @@
11
(
2-
'## Overview'
3-
''
4-
'`CodeBrowser` is designed to collect the code of all functions, operators, classes, namespace scripts, Interfaces and'
5-
'even GUI instances (optionally, and only when `KeepOnClose←1`) within the given non-scripted namespace(s) and compile '
6-
'a stand-alone HTML page from it.'
7-
''
8-
'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; ideal for a code reviewing.'
10-
''
11-
''
12-
'## Requirements'
13-
''
14-
'Codebrowser relies on the [Tatin packet manager](https://github.com/aplteam/Tatin) to be available.'
15-
''
16-
''
17-
'## Installation'
18-
''
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.'
21-
''
22-
'Restart Dyalog APL or execute the command `]UReset` which will make it available in an already running session.'
23-
''
24-
'You then have three different ways of using `CodeBrowser`:'
25-
''
26-
'## Use the user command `]CodeBrowser`'
27-
''
28-
'This is by far the easiest way to use but it comes with a few limitations.'
29-
''
30-
'To create an HTML page for a namespace `#.Foo`:'
31-
''
32-
'```'
33-
']CodeBrowser #.Foo'
34-
'```'
35-
''
36-
'There are several flags available which allow you to adapt the behaviour and/or the information shown by `CodeBrowser`.'
37-
''
38-
'For details regarding those options and flags execute `]CodeBrowser -?`.'
39-
''
40-
'However, not all parameters can be set this way. If you need to set one of the parameters that are not available via'
41-
'the user command interface then you have to consider the two other ways to use `CodeBrowser` because they give you full'
42-
'access to all parameters.'
43-
''
44-
''
45-
'## Using the GUI '
46-
''
47-
'Note that this is only available under Windows.'
48-
''
49-
'Execute:'
50-
''
51-
'```'
52-
' ]CodeBrowser -gui'
53-
'```'
54-
''
55-
'That will show a GUI that allows you to specify or amend all parameters available. You may specify one or more '
56-
'namespaces together with the `-gui` flag but no other flags. If you try anway an error is thrown.'
57-
''
58-
''
59-
'## Use CodeBrowser''s API'
60-
''
61-
'Use this when you want to take advantage of parameters that are not available via the user command interface or'
62-
'you want to create CodeBrowser''s HTML page under program control. In this case the GUI is not suitable of course.'
63-
''
64-
'For the API to become available you may execute `]CoderBrowser -version`. This is the lazy approach. To make CodeBrowser '
65-
'available from the start you need to add it to Dyalog''s start-up procedure. Refer to the Dyalog documentation for this.'
66-
''
67-
'`CodeBrowser` does not only comprise a namespace `CodeBrowser`, it also comes with a number of Tatin packages.'
68-
'That''s why the presence of Tatin is a requirement: only then can Tatin packages be loaded.'
69-
''
70-
'### Example'
71-
''
72-
'```'
73-
' ]CoderBrowser -version ⍝ Loads the code into ⎕SE'
74-
' parms←⎕SE.CodeBrowser.CreateParms ⍬'
75-
' parms.caption←''My First Ty'''
76-
' parms ⎕SE.CodeBrowser.Run #'
77-
'```'
78-
''
79-
'Note that you can get a list of all (almost) parameters with their current values by calling the `∆List` function:'
80-
''
81-
'```'
82-
' ⎕SE.CodeBrowser.CreateParms.∆List'
83-
'```'
84-
''
2+
'## Overview'
3+
''
4+
'`CodeBrowser` is designed to collect the code of all functions, operators, classes, namespace scripts, Interfaces and'
5+
'even GUI instances (optionally, and only when `KeepOnClose←1`) within the given non-scripted namespace(s), and compile '
6+
'a stand-alone HTML page from it.'
7+
''
8+
'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.'
10+
''
11+
''
12+
'## Requirements'
13+
''
14+
'Codebrowser relies on the [Tatin packet manager](https://github.com/aplteam/Tatin) to be available.'
15+
''
16+
''
17+
'## Installation'
18+
''
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.'
21+
''
22+
'Restart Dyalog APL or execute the command `]UReset` which will make it available in an already running session.'
23+
''
24+
'You then have three different ways of using `CodeBrowser`:'
25+
''
26+
'* Execute the user command `]CodeBrowser`'
27+
'* Use the GUI '
28+
'* Use CodeBrowser''s API'
29+
''
30+
'We will discuss these in detail.'
31+
''
32+
'## The user command `]CodeBrowser`'
33+
''
34+
'This is by far the easiest way but it comes with a few limitations.'
35+
''
36+
'To create an HTML page for a namespace `#.Foo`:'
37+
''
38+
'```'
39+
']CodeBrowser #.Foo'
40+
'```'
41+
''
42+
'There are several flags available which allow you to adapt the behaviour and/or the information shown by `CodeBrowser`.'
43+
''
44+
'For details regarding those options and flags execute `]CodeBrowser -?`.'
45+
''
46+
'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'
48+
'access to all parameters.'
49+
''
50+
''
51+
'## CodeBrowser''s GUI '
52+
''
53+
'Note that this is only available under Windows.'
54+
''
55+
'Execute:'
56+
''
57+
'```'
58+
' ]CodeBrowser -gui'
59+
'```'
60+
''
61+
'That will show a GUI that allows you to specify or amend all parameters available. You may specify one or more '
62+
'namespaces together with the `-gui` flag but no other flags. If you try anway an error is thrown.'
63+
''
64+
''
65+
'## CodeBrowser''s API'
66+
''
67+
'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 '
69+
'suitable of course.'
70+
''
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+
''
79+
'### Example'
80+
''
81+
'```'
82+
' ]CoderBrowser -version ⍝ Loads the code into ⎕SE'
83+
' parms←⎕SE.CodeBrowser.CreateParms ⍬'
84+
' parms.caption←''My First Ty'''
85+
' parms ⎕SE.CodeBrowser.Run #'
86+
'```'
87+
''
88+
'Note that you can get a list of all (almost) parameters with their current values by calling the `∆List` function:'
89+
''
90+
'```'
91+
' (⎕SE.CodeBrowser.CreateParms'''').∆List '''''
92+
' backgroundColorPrint 1 '
93+
' caption ¯1 '
94+
' cssfilename C:\Users\..\codebrowser_styles.css '
95+
' filename '
96+
' footer '
97+
' ignore '
98+
' ignoreEmpty 1 '
99+
' ignoreTatinPkgs 1 '
100+
' info '
101+
' infoIsHTML 0 '
102+
' lang en '
103+
' lines ¯1 '
104+
' linkcssfile 0 '
105+
' namespaces '
106+
' printFontSize 8 '
107+
' processFunctions 1 '
108+
' processGuiInstances 0 '
109+
' processOperators 1 '
110+
' processScripts 1 '
111+
' processVars 1 '
112+
' recursive 1 '
113+
' showParms 0 '
114+
' twoSidedPrint 0 '
115+
' version CodeBrowser 2.0.0+83 from 2022-01-17 '
116+
' viewInBrowser 0 '
117+
'```'
118+
''
85119
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CreateParms←{⍺←⊣ ⋄ ⍺ ##.CreateParms ⍵}
1+
CreateParms←{##.CreateParms ⍵}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
MoreHelp←{⍺←⊣ ⋄ ⍺ ##.MoreHelp ⍵}
1+
MoreHelp←{##.MoreHelp ⍵}

APLSource/CodeBrowser/API/Run.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Run←{⍺← ⋄ ⍺ ##.Run ⍵}
1+
Run←{⍺← ⋄ ⍺ ##.Run ⍵}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Selfie←{⍺←⊣ ⋄ ⍺ ##.Selfie ⍵}
1+
Selfie←{##.Selfie ⍵}

0 commit comments

Comments
 (0)