~melchizedek6809/nujel.net

fc218b2396f819160767d8d56ce7b57a992aa439 — Benjamin Vincent Schulenburg 2 years ago e4fe5b4
Improvements
M content/reference/core/generator.nuj => content/reference/core/generator.nuj +7 -2
@@ 66,8 66,8 @@
      [when examples
        [cat "<h4>Examples</h4><pre class=\"docstring-examples source source-nujel\">"
             [-> examples
                 [map [fn [e] [pp-nujel [fmt "{:?}\n{:?}\n\n" [cadr e] [car e]] :html]]]
                 [join ""]]
                 [map [fn [e] [pp-nujel [fmt "{:?}\n{:?}\n" [cadr e] [car e]] :html]]]
                 [join "\n"]]
             "</pre>"]]]

[defn closure-html-related [f]


@@ 79,9 79,14 @@
                 [join ""]]
             "</div>"]]]

[defn closure-html-internal [f]
      [when [meta f :internal]
        "{{ [component :InternalWarning] }}"]]

[defn generate-reference-for [f]
      [cat [closure-signature f]
           "<br/><br/>"
           [closure-html-internal f]
           [closure-html-documentation f]
           [closure-html-examples f]
           [closure-html-related f]]]

M content/reference/index.html => content/reference/index.html +3 -1
@@ 16,10 16,12 @@ date: "2022-09-13"
    All the documentation here is generated by parsing the built-in documentation and some additional metadata. All the examples seen here are also just pretty printed unit tests which are run on every commit.
</p>

<div class="category-list">
{{
    [def cats @[]]
    [-> [symbol-table]
        [map resolve]
        [for-each [fn [a] [tree/set! cats [closure/cat a] #t]]]]
    [join [map [tree/keys cats] [fn [a] [component :CategoryNavigation @[:category a]]]] "<br/><br/>"]
    [join [map [tree/keys cats] [fn [a] [component :CategoryNavigation @[:category a]]]] ""]
}}
</div>
\ No newline at end of file

M ssg/content.nuj => ssg/content.nuj +1 -1
@@ 10,7 10,7 @@
             [file/copy [car res] [fmt "{deploy-dir}/{}" [cdr res]]]]]

[defn path/content? [path]
      [= [lowercase [path/extension path]] "html"]]
      [= [lower-case [path/extension path]] "html"]]

[defn load-frontmatter [path name content-frontmatter]
      [when-not [path/content? path] [return #nil]]

M ssg/loader.nuj => ssg/loader.nuj +1 -1
@@ 38,7 38,7 @@
[defn build [ctx path]
      "Build a certain path using the loader"
      :export
      [def ext [string->keyword [lowercase [path/extension path]]]]
      [def ext [string->keyword [lower-case [path/extension path]]]]
      [if [== ext :html]
          [build-html ctx path]
          [build-copy ctx path]]]

M ssg/theme/default/components/CategoryNavigation.html => ssg/theme/default/components/CategoryNavigation.html +10 -4
@@ 1,4 1,10 @@
<h2>{{ [def cur-cat [tree/ref props :category]] [keyword->string cur-cat] }}</h2>
<nav>
{{ [join [sort [map [navigation #nil #nil cur-cat] [fn [v] [render-link v]]]] "<br/>"] }}
</nav>
\ No newline at end of file
<div class="category-navigation">
	<h2>{{
		[def cur-cat [tree/ref props :category]]
		[def items [navigation #nil #nil cur-cat]]
		[fmt "{} ({})" [capitalize [keyword->string cur-cat]] [length items]]
	}}</h2>
	<nav>
		{{ [join [sort [map items [fn [v] [render-link v]]]] "<br/>"] }}
	</nav>
</div>
\ No newline at end of file

A ssg/theme/default/components/InternalWarning.html => ssg/theme/default/components/InternalWarning.html +5 -0
@@ 0,0 1,5 @@
<box-wrap box-color="red">
    <h3>Warning</h3>
    <p>This function is declared internal, so there are no guarantees whatsoever regarding its existence or functionality.</p>
    <p>Have fun playing around with the internals but please try not to use any of these in any library or application.</p>
</box-wrap>
\ No newline at end of file

M ssg/theme/default/resources/main.css => ssg/theme/default/resources/main.css +13 -0
@@ 466,4 466,17 @@ h4 {
	color: #8f949e;
	font-size: 1.4rem;
	margin-bottom: 0.25em;
}

.category-navigation > nav {
	display: block;
	column-count: 5;
	margin-bottom: 2rem;
}

@media (max-width: 780px) {
	.category-navigation > nav {
		display: block;
		column-count: 3;
	}
}
\ No newline at end of file