Commit 9a955216 authored by Michael Murtaugh's avatar Michael Murtaugh
Browse files

local changes

parent 103579f2
......@@ -11,12 +11,100 @@
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<style type="text/css">
a.sourceLine { display: inline-block; line-height: 1.25; }
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
a.sourceLine:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
a.sourceLine { text-indent: -1em; padding-left: 1em; }
}
pre.numberSource a.sourceLine
{ position: relative; left: -4em; }
pre.numberSource a.sourceLine::before
{ content: attr(title);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; pointer-events: all; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
a.sourceLine::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header>
<h1 class="title">Makeserver: Change log</h1>
</header>
<nav id="TOC">
<ul>
<li><a href="#section">2016</a><ul>
<li><a href="#nov">24 nov</a></li>
<li><a href="#nov-1">23 nov</a></li>
<li><a href="#nov-2">22 nov</a></li>
<li><a href="#dec">1 Dec</a></li>
</ul></li>
<li><a href="#section-1">2017</a><ul>
<li><a href="#march">March</a></li>
<li><a href="#august">August</a></li>
</ul></li>
<li><a href="#section-2">2018</a></li>
<li><a href="#section-3">2020</a></li>
<li><a href="#section-4">2021</a><ul>
<li><a href="#feb-2021-code-folding-framing">04 Feb 2021: Code folding + Framing!</a></li>
<li><a href="#feb-18">Feb 18</a></li>
<li><a href="#feb-21">Feb 21</a></li>
</ul></li>
<li><a href="#design-decisions">Design decisions</a><ul>
<li><a href="#single-makefile">Single makefile</a></li>
<li><a href="#from-indexical-back-to-dynamic-index">From Indexical back to dynamic index</a></li>
</ul></li>
</ul>
</nav>
<h1 id="section">2016</h1>
<p>It seemed very strong how when generalizing the data join, I suddenly (finally) started to care about the form of the incoming data. In other words, the specific labels of the data started to have an effect as they connected (or didn’t) with the names of properties in the rdfa “template” element. Thus the document becomes instrumentalized as a sort of filter / query into the incoming data stream. Now, finally, the benefits of data rewriting via a mechanism like json-ld would be most useful (and appreciated) to complete the loop without a need for ad hoc reframing / tweaking of the data. The hit or miss effect of the selection, filtering and ignoring unnecessary data, is reminiscent (in an encouraging way) of json-ld’s contexts as filters.</p>
<p>A surprising discovery has been the re-finding of writing “template” code in the form of a sample table row with rdfa properties. It seems it might be useful to revisit early web publishing flows that must have used this kind of mechanism (vague memories of Internet Explorer specific html element properties like data-source).</p>
......@@ -260,6 +348,21 @@ Successfully remade target file &#39;all&#39;.</code></pre>
<p>The confusion of documents/data that Daniel Punday writes about is reflecting in a confusion of work practices and standards for representation (RDF). A line that stands out now for me in Punday is the observation of the signficance (not expanded upon) of Licklider’s desire for destroying barriers of disciplinarity (is Punday thus saying that such an erasure isn’t possible/desirable!).</p>
<p>Inspiration: Things I hate: playing music in Rhythm box and not being able to edit the title + artist data (presumably because the right extensions aren’t installed to actually edit the metadata for whatever format the music file is) … but also … what if the file is the whole album (not broken into tracks… also!)…</p>
<p>rdf is like binary… an extreme reduction that is on one hand revolutionary and a foundation for making computing general purpose, and on the other hand not in and of itself an important “encoding” to consider / look at. In actual use, digital data need interpretive/algorithmic frames to reconstitute and represent it. I think in a similar way, RDF as a data structure is a kind of extreme data normalization, permitting a general purpose way for relational data to be expressed. But in terms of actually using/reading/writing the data, its more appropriate to consider the framing as an essential part of making the process meaningful. (There’s nothing pure about a bit, nor is there about a triple of “data”)…. zooming out and framing is necessary to ascribe meaning and the consider the quality / recombine documents. When a document / article / book is “rediscovered”, read again years after publication (or an initial reading) – and one “discovers” something new – it’s because the value derived from documents and from reading depends on a changing (personal / culutural) frame.</p>
<h2 id="feb-18">Feb 18</h2>
<ul>
<li>Look into integrating with: https://www.npmjs.com/package/pdfjs-dist for #page= support ? … <a href="https://github.com/mozilla/pdf.js/wiki/Setup-pdf.js-in-a-website">using in website</a> … also example with <a href="https://github.com/mozilla/pdf.js/tree/master/examples/webpack">webpack</a></li>
</ul>
<h2 id="feb-21">Feb 21</h2>
<p>For embedding scons, it’s useful to look at the Script/Main.py code, in my install that’s currently:</p>
<p>~/.local/lib/python3.7/site-packages/SCons/Script/Main.py</p>
<p>Interesting bits: in the QuestionTask (line 415) you see:</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode python"><code class="sourceCode python"><a class="sourceLine" id="cb13-1" title="1"> <span class="cf">if</span> <span class="va">self</span>.targets[<span class="dv">0</span>].get_state() <span class="op">!=</span> SCons.Node.up_to_date <span class="kw">or</span> <span class="op">\</span></a>
<a class="sourceLine" id="cb13-2" title="2"> (<span class="va">self</span>.top <span class="kw">and</span> <span class="kw">not</span> <span class="va">self</span>.targets[<span class="dv">0</span>].exists()):</a>
<a class="sourceLine" id="cb13-3" title="3"> <span class="kw">global</span> exit_status</a>
<a class="sourceLine" id="cb13-4" title="4"> <span class="kw">global</span> this_build_status</a>
<a class="sourceLine" id="cb13-5" title="5"> exit_status <span class="op">=</span> <span class="dv">1</span></a>
<a class="sourceLine" id="cb13-6" title="6"> this_build_status <span class="op">=</span> <span class="dv">1</span></a>
<a class="sourceLine" id="cb13-7" title="7"> <span class="va">self</span>.tm.stop()</a></code></pre></div>
<h1 id="design-decisions">Design decisions</h1>
<p>Why were certain key design decisions made?</p>
<h2 id="single-makefile">Single makefile</h2>
......
......@@ -383,6 +383,41 @@ Inspiration: Things I hate: playing music in Rhythm box and not being able to ed
rdf is like binary... an extreme reduction that is on one hand revolutionary and a foundation for making computing general purpose, and on the other hand not in and of itself an important "encoding" to consider / look at. In actual use, digital data need interpretive/algorithmic frames to reconstitute and represent it. I think in a similar way, RDF as a data structure is a kind of extreme data normalization, permitting a general purpose way for relational data to be expressed. But in terms of actually using/reading/writing the data, its more appropriate to consider the framing as an essential part of making the process meaningful. (There's nothing pure about a bit, nor is there about a triple of "data").... zooming out and framing is necessary to ascribe meaning and the consider the quality / recombine documents. When a document / article / book is "rediscovered", read again years after publication (or an initial reading) -- and one "discovers" something new -- it's because the value derived from documents and from reading depends on a changing (personal / culutural) frame.
Feb 18
--------------------
* Look into integrating with: https://www.npmjs.com/package/pdfjs-dist for #page= support ? ... [using in website](https://github.com/mozilla/pdf.js/wiki/Setup-pdf.js-in-a-website) ... also example with [webpack](https://github.com/mozilla/pdf.js/tree/master/examples/webpack)
Feb 21
------------
For embedding scons, it's useful to look at the Script/Main.py code, in my install that's currently:
~/.local/lib/python3.7/site-packages/SCons/Script/Main.py
Interesting bits: in the QuestionTask (line 415) you see:
```python
if self.targets[0].get_state() != SCons.Node.up_to_date or \
(self.top and not self.targets[0].exists()):
global exit_status
global this_build_status
exit_status = 1
this_build_status = 1
self.tm.stop()
```
line 313
```python
t = self.targets[0]
for tp in self.options.tree_printers:
tp.display(t)
if self.options.debug_includes:
tree = t.render_include_tree()
if tree:
print()
print(tree)
```
Design decisions
......
HTMLFromMarkdown = Builder(action="""pandoc --css ${SOURCES[1]} --standalone ${SOURCES[0]} -o $TARGET""")
HTMLFromMarkdown = Builder(action="""pandoc --toc --css ${SOURCES[1]} --standalone ${SOURCES[0]} -o $TARGET""")
env = Environment(BUILDERS={
'HTMLFromMarkdown': HTMLFromMarkdown
})
......
......@@ -181,13 +181,20 @@ async def route_get (request):
# print ("GET", path, file=sys.stderr)
if path == '':
path = '.'
pathisdir = os.path.isdir(path)
makefile = request.app['makefile']
makecmd = request.app['make']
im = await is_makeable(path, makefile=makefile, make=makecmd)
verbose = request.app['verbose']
if not pathisdir:
# only use is_makeable with paths
# scons treats directory names as all targets in a folder
im = await is_makeable(path, makefile=makefile, make=makecmd, verbose=verbose)
else:
im = MAKE['UP_TO_DATE']
remake = 'remake' in request.rel_url.query
if path and (im == MAKE['NEEDS_REMAKING'] or \
(im == MAKE['UP_TO_DATE'] and remake)):
code, resp = await make(path, makefile=makefile, make=makecmd, force=remake)
code, resp = await make(path, makefile=makefile, make=makecmd, force=remake, verbose=verbose)
if not code:
resppage = """<!DOCTYPE html>
<head>
......@@ -285,6 +292,12 @@ async def lab_index_handler (request):
htdocs = request.app['htdocs']
return web.FileResponse(os.path.join(htdocs, "index.html"))
async def terminal_index_handler (request):
htdocs = request.app['htdocs']
return web.FileResponse(os.path.join(htdocs, "terminal", "index.html"))
# from .terminal import terminal_websocket_handler
def main ():
ap = argparse.ArgumentParser("make & serve")
ap.add_argument("--makefile", "-f", default="Makefile")
......@@ -293,7 +306,7 @@ def main ():
ap.add_argument("--port", type=int, default=8000)
ap.add_argument("--editor", default=None)
ap.add_argument("--static", nargs=2, default=None, action="append")
ap.add_argument("--debug", action="store_true", default=False)
ap.add_argument("--verbose", action="store_true", default=False)
ap.add_argument("--version", action="store_true", default=False)
args = ap.parse_args()
......@@ -310,12 +323,13 @@ def main ():
asyncio.set_event_loop(loop)
app = web.Application()
app['makefile'] = args.makefile
app['verbose'] = args.verbose
if args.scons or (args.makefile.lower() == "sconstruct.py"):
app['make'] = "scons"
else:
app['make'] = "make"
app['editor'] = args.editor
app.router.add_route('GET', '/ws', websocket_handler)
# app.router.add_route('GET', '/ws', websocket_handler)
data = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data")
htdocs = os.path.join(data, "htdocs")
......@@ -324,7 +338,9 @@ def main ():
print (f"Adding static route {laburl}/ -> {htdocs}")
# add /__lab__/ => index.html
app.router.add_route("GET", f"/{laburl}/", lab_index_handler)
app.router.add_static(f"/{laburl}", htdocs, show_index=args.debug)
# app.router.add_route("GET", f"/{laburl}/terminal/", terminal_index_handler)
# app.router.add_route("GET", f"/{laburl}/terminal/ws", terminal_websocket_handler)
app.router.add_static(f"/{laburl}", htdocs, show_index=args.verbose)
if args.static:
for name, path in args.static:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment