https://www.dendron.so/ logo
Join DiscordCommunities
Powered by
# dev
  • k

    kevins8

    08/31/2020, 6:45 PM
    so the type definition comes from vscode-uri
  • k

    kevins8

    08/31/2020, 6:46 PM
    dendron/packages/engine-server/node_modules/vscode-uri/lib/esm/index.d.ts
  • k

    kevins8

    08/31/2020, 6:47 PM
    vscode-uri
    is listed as a
    dependency
    in
    engine-server
    . is it showing up under
    node_modules
    in
    engine-server
    ?
  • j

    jojanaho

    08/31/2020, 6:51 PM
    yep; I get things to build also if I change
    import { URI } from "vscode-URI";
    to
    import { URI } from "vscode-uri";
  • j

    jojanaho

    08/31/2020, 6:51 PM
    ...since the folder there is
    vscode-uri
  • k

    kevins8

    08/31/2020, 6:53 PM
    got it. the
    vscode-URI
    was probably from me fat fingering a
    ~
    while in `vim`πŸ˜… might be something to do with case sensitive file systems that results in an error when you're building? whatever the case, it should probably be lowercase moving forward πŸ™‚
  • j

    jojanaho

    08/31/2020, 6:54 PM
    oh, are you developing on windows? running linux here
  • k

    kevins8

    08/31/2020, 6:54 PM
    mac
  • j

    jojanaho

    08/31/2020, 6:55 PM
    lol, didn't know that mac had case insensitive file system.
  • k

    kevins8

    08/31/2020, 6:55 PM
    yeah, digging into this
  • k

    kevins8

    08/31/2020, 6:56 PM
    Copy code
    File System Personality:   APFS
       Type (Bundle):             apfs
       Name (User Visible):       APFS
       Owners:                    Enabled
  • k

    kevins8

    08/31/2020, 6:56 PM
    new macs use apple file system which, by default, is case insensitive -_-
  • k

    kevins8

    08/31/2020, 6:56 PM
    so good catch is all i can say πŸ™‚
  • j

    jojanaho

    08/31/2020, 6:56 PM
    I'm on linux/android camp, so don't know anything about that
  • k

    kevins8

    08/31/2020, 6:59 PM
    we do have a travis pipeline that builds dendron on all platforms: https://github.com/dendronhq/dendron/blob/master/.travis.yml#L12:L12 error should have popped up there. will dig into the logs later today to see if i missed something
  • j

    jojanaho

    08/31/2020, 7:54 PM
    taking a look at https://github.com/dendronhq/dendron/issues/141 The one line change is not quite one line, since the following would fail if the editorPath is not set:
    Copy code
    typescript
        const cNoteFname =
          opts?.overrides?.domain || path.basename(editorPath, ".md");
  • j

    jojanaho

    08/31/2020, 7:54 PM
    While going through the code, I had to take a closer look at addBehavior - https://www.dendron.so/notes/5c213aa6-e4ba-49e8-85c5-1bdcb33ce202.html#defaultnodetypeaddbehavior . I had somewhat hard time following the examples, since the second one changes to use different note name (
    dendron.demo.md
    vs
    pro.foo.md
    ). If changing that to be the same, the second and third became equal:
    Copy code
    childOfDomain:
    dendron.demo.md -> create new journal note -> dendron.journal.2020-08-03.md
    
    childOfDomainNamespace:
    dendron.demo.md -> create new journal note -> dendron.demo.journal.2020-08-03.md
    
    childOfCurrent:
    dendron.demo.md -> create new journal note -> dendron.demo.journal.2020-08-03.md
    
    asOwnDomain:
    dendron.demo.md -> create new journal note -> journal.2020-08-03.md
  • j

    jojanaho

    08/31/2020, 7:56 PM
    I guess the intent of the second one is to create a child for the currently active schema leaf (namespace) if such exists (?). Without better knowledge, something like the following would make this more intuitive (to me):
    Copy code
    sibling:
    tools.dendron.notes.demo.md -> create new journal note -> tools.dendron.notes.journal.2020-08-03.md
    
    child:
    tools.dendron.notes.demo.md -> create new journal note -> tools.dendron.notes.demo.journal.2020-08-03.md
    
    root:
    tools.dendron.remarks.md -> create new journal note -> journal.2020-08-03.md
    
    schema:
    tools.dendron.notes.demo.md -> create new journal note -> tools.dendron.journal.2020-08-03.md
    
    in this example, the schema-option assumes that "tools" is defined in the schema, and it has set namespace to true.
    Continuing on this, the term "namespace" is also somewhat hard to understand correctly. Elsewhere in the docs: "when a schema is a namespace, it can have arbitrary children. equivalent to cli.* glob pattern". What makes this difficult is that any node in the schema can anyway have arbitrary children, since "...you can create notes that don’t match any schema". Anyway, after spending some time on this, I think I now know how it works. Maybe formulating namespace something like this could help "making a schema node a namespace automatically brings its immediate children as part of the schema, even if they are not explicitly defined in the schema definition".
  • k

    kevins8

    08/31/2020, 9:23 PM
    > taking a look at https://github.com/dendronhq/dendron/issues/141 > The one line change is not quite one line, since the following would fail if the editorPath is not set: > >
    Copy code
    typescript
    >     const cNoteFname =
    >       opts?.overrides?.domain || path.basename(editorPath, ".md");
    >
    @User you're right. all note creation requires a current active editor unless
    _noteAddBehaviorEnum = 'asOwnDomain'
  • k

    kevins8

    08/31/2020, 9:23 PM
    > While going through the code, I had to take a closer look at addBehavior - https://www.dendron.so/notes/5c213aa6-e4ba-49e8-85c5-1bdcb33ce202.html#defaultnodetypeaddbehavior . I had somewhat hard time following the examples, since the second one changes to use different note name (
    dendron.demo.md
    vs
    pro.foo.md
    ). If changing that to be the same, the second and third became equal: > >
    Copy code
    > childOfDomain:
    > dendron.demo.md -> create new journal note -> dendron.journal.2020-08-03.md
    > 
    > childOfDomainNamespace:
    > dendron.demo.md -> create new journal note -> dendron.demo.journal.2020-08-03.md
    > 
    > childOfCurrent:
    > dendron.demo.md -> create new journal note -> dendron.demo.journal.2020-08-03.md
    > 
    > asOwnDomain:
    > dendron.demo.md -> create new journal note -> journal.2020-08-03.md
    >
    @User and that's a fair point. i updated the second example so that the first and second wouldn't look the same but i will update them all to use the same hierarchy to drive home the point
  • k

    kevins8

    08/31/2020, 9:26 PM
    > I guess the intent of the second one is to create a child for the currently active schema leaf (namespace) if such exists (?). Without better knowledge, something like the following would make this more intuitive (to me): > >
    Copy code
    > sibling:
    > tools.dendron.notes.demo.md -> create new journal note -> tools.dendron.notes.journal.2020-08-03.md
    > 
    > child:
    > tools.dendron.notes.demo.md -> create new journal note -> tools.dendron.notes.demo.journal.2020-08-03.md
    > 
    > root:
    > tools.dendron.remarks.md -> create new journal note -> journal.2020-08-03.md
    > 
    > schema:
    > tools.dendron.notes.demo.md -> create new journal note -> tools.dendron.journal.2020-08-03.md
    > 
    > in this example, the schema-option assumes that "tools" is defined in the schema, and it has set namespace to true.
    >
    > > Continuing on this, the term "namespace" is also somewhat hard to understand correctly. Elsewhere in the docs: "when a schema is a namespace, it can have arbitrary children. equivalent to cli.* glob pattern". What makes this difficult is that any node in the schema can anyway have arbitrary children, since "...you can create notes that don’t match any schema". Anyway, after spending some time on this, I think I now know how it works. Maybe formulating namespace something like this could help "making a schema node a namespace automatically brings its immediate children as part of the schema, even if they are not explicitly defined in the schema definition". @User i use
    domain
    to mean the root of the current hierarchy. i like your simplified values, would just swap
    root
    with
    domain
    . in the future, instead of having
    parent: root
    in the default schema to indicate that it is the root of the hierarchy, planning on adding a
    domain: true
    property instead and removing
    parent
    altogether
  • k

    kevins8

    08/31/2020, 9:28 PM
    feel free to create an issue to update the
    addBehavior
    values. we have a way of automatically upgrading old settings here: https://github.com/dendronhq/dendron/blob/master/packages/plugin-core/src/commands/UpgradeSettings.ts#L1:L1 its currently only used to set new defaults but can also be used to change existing values.
  • k

    kevins8

    08/31/2020, 9:30 PM
    > Continuing on this, the term "namespace" is also somewhat hard to understand correctly. Elsewhere in the docs: "when a schema is a namespace, it can have arbitrary children. equivalent to cli.* glob pattern". What makes this difficult is that any node in the schema can anyway have arbitrary children, since "...you can create notes that don’t match any schema". Anyway, after spending some time on this, I think I now know how it works. Maybe formulating namespace something like this could help "making a schema node a namespace automatically brings its immediate children as part of the schema, even if they are not explicitly defined in the schema definition". @User that's a fair point. will update the docs here as well
  • k

    kevins8

    09/01/2020, 4:50 AM
    updated docs: https://www.dendron.so/notes/5c213aa6-e4ba-49e8-85c5-1bdcb33ce202.html#defaultnodetypeaddbehavior
  • j

    jojanaho

    09/01/2020, 3:41 PM
    @User > i use domain to mean the root of the current hierarchy Does that mean the closest node in the schema + potentially the children under it if it's a namespace? > i like your simplified values, would just swap root with domain. I was thinking that
    schema
    would be exactly that, and
    root
    would be the absolute root of the whole vault. IIUC, domain is the immediate child of the absolute root? I'm somewhat confused with the terminology... I think there's at least the following concepts: 1. root: the absolute root of the vault 2. static schema node: things defined explicitly in the schema 3. dynamic schema node: node that belongs to the schema via namespace mechanism 4. non-schema node: node which doesn't appear in schema or isn't an immediate child of a namespace schema node 5. domain: an immediate child of the root (?). Might be 2 or 4?
  • k

    kevins8

    09/01/2020, 3:52 PM
    i think part of the confusion is that dendron has two types of nodes,
    schemas
    and
    notes
    , and that the two relate to each other but are also independent. ### schemas - namespace: a schema can be designated as a namespace. if so, it will match all its children and designate them as a match ### notes
    Copy code
    .
    β”œβ”€β”€ root.md  --> absolute root of vault
    └── project.md  --> root of project hierarchy. also referred to as the hierarchy **domain**
        └── project.foo.md --> a note within the project hierarchy
    ### add behavior - for all below examples, assume that
    pro.dendron.demo.md
    is opened and that
    pro
    matches a namespace schema - childOfDomain: add new note as child of the current domain (aka root of current hierarchy). doesn't take into account schema - output:
    pro.journal
    - childOfDomainNamespace: add new note as child of the current domain. if domain matches a namespace schema, make it into a child of that instead - output:
    pro.dendron.journal
    - childOfCurrent: add new note as child of whatever note your currently on - output:
    pro.dendron.demo.journal
    - asOwnDomain: add new note as its own domain. dis-regards current open note - output:
    journal
    (domain name specified by
    default{NodeType}Name
    )
  • j

    jojanaho

    09/01/2020, 4:10 PM
    Sooo.. what is the name of a node below a namespace?
  • j

    jojanaho

    09/01/2020, 4:11 PM
    I think it gets schema icon, indicating that its part if the schema, thus its a schema node (?)
  • j

    jojanaho

    09/01/2020, 4:12 PM
    But on the other hand, it isnt
  • k

    kevins8

    09/01/2020, 4:12 PM
    a node below a namespace, if we're talking about add behavior, is the
    childOfDomainNamespace
12345...108Latest