File tree Expand file tree Collapse file tree 7 files changed +16
-10
lines changed Expand file tree Collapse file tree 7 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,14 @@ let components = {
47
47
"Warn" : Markdown .Warn .make ,
48
48
}
49
49
50
+ // the loadAllMdx function logs out all of the file contents as it reads them, which is noisy and not useful.
51
+ // We can suppress that logging with this helper function.
52
+ let allMdx = await Shims .runWithoutLogging (() => loadAllMdx ())
53
+
50
54
let loader : Loader .t <loaderData > = async ({request }) => {
51
55
let mdx = await loadMdx (request )
52
56
53
- let fileContents = await ( await loadAllMdx (~ filterByPaths = [ "docs" ]))
57
+ let fileContents = await allMdx
54
58
-> Array .filter (mdx => (mdx .path :> string )-> String .includes ("docs/manual/introduction" ))
55
59
-> Array .get (0 )
56
60
-> Option .map (mdx => mdx .path )
@@ -94,8 +98,6 @@ let default = () => {
94
98
95
99
let {categories , entries } = useLoaderData ()
96
100
97
- Console .log (entries )
98
-
99
101
let metaTitleCategory =
100
102
(pathname :> string )-> String .includes ("docs/manual" )
101
103
? "ReScript Language Manual"
Original file line number Diff line number Diff line change 1
- Console .log ("I am a dummy file" )
1
+ Console .debug ("I am a dummy file" )
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ let content = {
3
3
getLatest ()-> toXmlString
4
4
}
5
5
6
- Console .log (content )
6
+ Console .debug (content )
Original file line number Diff line number Diff line change
1
+ @module ("./shims.js" )
2
+ external runWithoutLogging : (unit => Promise .t <'a >) => Promise .t <'a > = "runWithoutLogging"
Original file line number Diff line number Diff line change @@ -138,9 +138,6 @@ module H2 = {
138
138
@react.component
139
139
let make = (~id , ~children ) => {
140
140
let title = childrenToString (children )-> String .toLowerCase -> String .replaceAll (" " , "-" )
141
-
142
- Console .log (title )
143
-
144
141
<>
145
142
// Here we know that children is always a string (## headline)
146
143
<h2 id className = "group mt-16 mb-3 hl-3 scroll-mt-32" >
Original file line number Diff line number Diff line change @@ -116,8 +116,6 @@ let make = (
116
116
}}
117
117
</div >
118
118
119
- Console .log2 ("activeToc" , activeToc )
120
-
121
119
let sidebar =
122
120
<Sidebar isOpen = isSidebarOpen toggle = toggleSidebar preludeSection ?activeToc categories route />
123
121
Original file line number Diff line number Diff line change
1
+ export const runWithoutLogging = async ( fn ) => {
2
+ const orig = console . log ;
3
+ console . log = ( ) => { } ;
4
+ const values = await fn ( ) ;
5
+ console . log = orig ;
6
+ return values ;
7
+ }
You can’t perform that action at this time.
0 commit comments