I am a Design-Document.
I describe Low-Level-Details of the current All-Dings-Implementation.
The All-Dings-HLD describes the high-level System-Design. I describe the concrete Files, Data-Structures, Commands and Implementation-Details behind that Design.
The Top-Level-Makefile is:
Important Make-Targets are:
make workdir: Collect Dings-Files into Work-Dir and update md-sm2 Json Artifacts.make render: Render Work-Dir/*.ir.json into Html-Files under Day/, copy additional Files like .htaccess and update Thumbnails.make prod: Sync with the Dings-Server.make docker: Build the Docker-Image with Apache.The current Work-Dir Makefile is:
The current Rendering-Makefile is:
The current default Html Rendering uses:
dings-gpt render Ir-Html: Create Html from existing *.ir.json Files.The legacy Html Rendering is still available:
dings html generate -a: Create Html from Markdown.Design-Direction:
dings-gpt render sm2-html.The Web-Server can be started with:
~/All-Dings/111 (Master)$ dings-host docker web start
The following Directories are used in the Dings-System:
The Environment-Variable Dings_Dir defines the Starting-Point:
$ set | grep Dings_Dir
Dings_Dir=/Users/michaelholzheu/All-Dings/111
The dings-gpt show sm Implementation uses the following Pipeline:
md -> ir -> sm1 -> sm2 -> Text
The current Json Artifacts are:
DINGS_NUMBER.ir.jsonDINGS_NUMBER.sm1.jsonDINGS_NUMBER.sm2.jsonAll-Dings.sm1.jsonAll-Dings.sm2.jsonThe Pipeline-Layers have the following Implementation Roles:
md: Markdown Source-File.ir: Parsed Markdown Structure.sm1: Explicit semantic Document-Truth extracted from one Dings.sm2: Derived semantic View with resolved Names, Classes, Relations and Claims.dings-gpt show sm.The generated Json-Files are Implementation-Artifacts.
Their exact Shape is defined by the current Code and can change.
This Document describes only the stable Top-Level-Structure and the intended Meaning of important Keys.
ir uses:
Type: Json Node-Type, currently Dings_IR_Node_Document.Source: Source Metadata of the Markdown-File.Block_List: Parsed Markdown Blocks and Inline-Nodes.Dings_IR_Node_Block_App: App Block parsed from one Markdown Embed Line; adjacent Embed Lines become separate App Blocks.Dings_IR_Node_Block_List: Flat Markdown List parsed into List-Items; supports unordered and ordered Lists.Dings_IR_Node_Block_Math: Display-Math parsed from $$ ... $$.Dings_IR_Node_Block_Quote: Block-Quote parsed from Markdown Quote Lines.Dings_IR_Node_Block_Table: Markdown Table parsed into Header-Cells and Row-Cells.Dings_IR_Node_Inline_Math: Inline-Math parsed from $ ... $.Dings_IR_Node_Inline_Emphasis: Inline Emphasis parsed from _..._ or *...*.Dings_IR_Node_Inline_Strong: Inline Strong parsed from __...__ or **...**.sm1 uses:
Dings_System_Version_NumberDings_NumberDings_NameDings_SM_Base_Class_MainDings_SM_Base_Class_Also_ListStatement_Listsm2 uses:
sm1 KeysDings_SM_Remote_Base_Class_ListDings_SM_Self_Alias_ListDings_SM_Remote_Alias_ListDings_SM_Topic_ListDings_SM_Abbreviation_ListDings_SM_Format_ListDings_SM_Type_ListDings_SM_Part_ListDings_SM_Time_Stamp_ListDings_SM_Undefined_ListDings_SM_Parent_ListDings_SM_Predecessor_ListAll-Dings.sm2.json adds global Lists and Maps for cross-document Queries.
For exact current Json, use the generated *.ir.json, *.sm1.json, *.sm2.json and All-Dings.sm2.json Files together with the Builder-Code.
show sm accepts different Target-Forms:
.mdConcrete Targets resolve to a Dings-Number.
Virtual Class-Targets can also resolve to a virtual Class-Key, for Example when a Reference-Label is different from the canonical Dings-Name.
show sm dings TARGET shows one Dings.
The command ensures the current sm1 and sm2 Json-Files for the Dings, builds a SM-Channel and renders it as Text.
The Output combines:
sm1sm2show sm list TARGET shows Members of a Class or virtual Class.
It uses:
Dings_SM_Class_Member_Mapshow sm list [TARGET] where PREDICATE=OBJECT shows Dings matching a Relation.
It uses:
Dings_SM_Relation_Source_MapThe where Form supports Wildcards:
PREDICATE=**=OBJECT*=*show sm names-of TARGET [BASE] shows observed Names and Reference-Labels for a Dings.
It uses:
Dings_SM_Target_Virtual_Name_MapThe optional BASE filters Names by Context-Class.
show sm claims-from CLAIMER [PREDICATE] shows Claims that originate from one Dings.
It uses:
Dings_SM_Claim_By_Claimer_MapThe optional PREDICATE can filter by:
I_Am or I_Have[Topic](600051.md)The following Maps in All-Dings.sm2.json are especially relevant for show sm:
Dings_ListDings_SM_Virtual_Class_ListDings_SM_Class_Member_MapDings_SM_Relation_Source_MapDings_SM_Claim_ListDings_SM_Claim_By_Subject_MapDings_SM_Claim_By_Predicate_MapDings_SM_Claim_By_Object_MapDings_SM_Claim_By_Claimer_MapDings_SM_Target_Virtual_Name_MapGlobal Views like list, names-of and claims-from require a current All-Dings.sm2.json.
The current Command to generate it is:
~/All-Dings/111 (Master)$ dings-gpt render md-sm2
The Ir-Html Render-Path renders the ir Document-View into Html-Files without reparsing Markdown.
It is the current default Html Render-Path used by make render.
Supported Command Forms are:
~/All-Dings/111 (Master)$ dings-gpt render Ir-Html
~/All-Dings/111 (Master)$ dings-gpt render 'Ir->Html'
~/All-Dings/111 (Master)$ dings-gpt render Ir Html
The default Output is:
Day/<DINGS_NUMBER>.htmlThe Render-Path uses:
Dings_Gpt_Cmd_Render.py: Command Dispatch, Selection, Output-Directory and Summary.Dings_Lib_Render.py: Ir Document-View to Html Rendering.Work-Dir/300000002.htm: Existing Html Template for Presentation Elements.The Render-Path expects the required Presentation and App Assets to exist in the target Html Environment.
The first Html Document-View renders:
$ ... $ and Display-Math from $$ ... $$ rendered to MathMLThe legacy dings html generate -a Command stays available.
With -debug, show sm can show less compressed Source-Details where supported.
This includes: