diff --git a/css/notes.css b/css/notes.css index cf503e5..3ff6374 100644 --- a/css/notes.css +++ b/css/notes.css @@ -197,3 +197,36 @@ th { tr:nth-child(even) { background-color: #f2f2f2; } + +/* Table of Contents */ + +.table-of-contents { + float: right; + width: 40%; + background: #eee; + font-size: 0.8em; + padding: 1em 2em; + margin: 0 0 0.5em 0.5em; +} +.table-of-contents ul { + padding: 0; +} +.table-of-contents li { + margin: 0 0 0.25em 0; +} +.table-of-contents a { + text-decoration: none; +} +.table-of-contents a:hover, +.table-of-contents a:active { + text-decoration: underline; +} + +h3:target { + animation: highlight 1s ease; +} + +@keyframes highlight { + from { background: yellow; } + to { background: white; } +} diff --git a/utils/ninja.py b/utils/ninja.py index a08213b..6a34bdf 100644 --- a/utils/ninja.py +++ b/utils/ninja.py @@ -174,7 +174,7 @@ def out(infile, **kwargs): ext = kwargs.get("ext", None) outdir = kwargs.get("outdir", "build") - ret = pth.join(outdir, pth.splitext(pth.basename(infile))[0]) + ret = path.join(outdir, path.splitext(path.basename(infile))[0]) if ext is not None: ret += ext @@ -190,13 +190,13 @@ def __init__(self, *args, **kwargs): self.pattern, self.include_paths, self.files = \ kwargs["pattern"], kwargs["include_paths"], eset - def search_file(self, path): + def search_file(self, Path): for p in self.include_paths: - f = pth.join(p, path) + f = path.join(p, Path) # print(f, pth.isfile(f)) - if pth.isfile(f): + if path.isfile(f): return f return None @@ -273,7 +273,7 @@ def __init__(self, *args, **kwargs): def sources(self, sources, **kwargs): for src in sources: - self.deps.include_paths.add(pth.abspath(pth.dirname(src))) + self.deps.include_paths.add(path.abspath(path.dirname(src))) self.deps.get_dependencies(src) @@ -295,6 +295,15 @@ def full(self, sources, **kwargs): self.newline() +class Html(HTML): + ext = ".build.html" + + def out(self, src, **kwargs): + kwargs.setdefault("outdir", ".") + + return super().out(src, **kwargs) + + class Compiled(Ninja): obj_ext = ".o"