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

    kevins8

    09/01/2020, 4:12 PM
    if it has a schema icon, it means that it matches a schema
  • k

    kevins8

    09/01/2020, 4:12 PM
    notes are always notes and schemas are always schemas. a note can match a schema
  • k

    kevins8

    09/01/2020, 4:13 PM
    a schema consists of nodes. a particular type of schema node is a
    namespace node
  • k

    kevins8

    09/01/2020, 4:13 PM
    a schema that is a
    namespace
    has the property that it will match everything one level under it
  • j

    jojanaho

    09/01/2020, 4:29 PM
    coming back to the terminology soon; before that a clarifying question 🙂 - what's the use case for namespace schema? at the moment I think I can only see that via an icon (?), but what if I add a note below a non-namespace schema - how does that differ and why the separation between namespace and non-namespace is meaningful?
  • k

    kevins8

    09/01/2020, 4:30 PM
    naming things is hard 🙂 if things are confusing, more than likely because i made it that way 😅
  • k

    kevins8

    09/01/2020, 4:32 PM
    as for namespaces, they were originally put in place because lots of hierarchies followed the
    {namespace}/{instance-of-namespace}
    pattern. (eg. projects - you could enumerate every single project as a child in the schema or you could make
    project
    a
    namespace
    and call it a day)
  • k

    kevins8

    09/01/2020, 4:32 PM
    before we introduced the
    pattern
    attribute to schemas, a
    namespace
    was the only way to do a
    *
    glob match using schemas
  • k

    kevins8

    09/01/2020, 4:33 PM
    Copy code
    yml
    id: project 
    namespace: true
    is almost equivalent to
    Copy code
    yml
    id: project
    pattern: project.*
  • k

    kevins8

    09/01/2020, 4:34 PM
    the difference is that
    childOfDomainNamespace
    will apply if namespace is set
  • k

    kevins8

    09/01/2020, 4:34 PM
    this being said, if you have an idea to simplify this, i'm all ears 🙂
  • j

    jojanaho

    09/01/2020, 4:35 PM
    hmm, just thinking if it would just be
    id: project
    without pattern or namespace, what would be the drawback
  • k

    kevins8

    09/01/2020, 4:36 PM
    the default case is to just use
    id
  • k

    kevins8

    09/01/2020, 4:36 PM
    Copy code
    yml
    id: project
    is equivalent to
    Copy code
    yml
    id: project
    namespace: false
    pattern: project
  • j

    jojanaho

    09/01/2020, 4:37 PM
    yep. what if that would be the only thing the user can do - what would be the drawback
  • k

    kevins8

    09/01/2020, 4:37 PM
    so if a user couldn't use a namespace or pattern, then they would need to explicitly enumerate each child
    Copy code
    yml
    id: project
    children:
    - p1
    - p2
    - p3
    -...
  • j

    jojanaho

    09/01/2020, 4:38 PM
    nah, I mean if they just add the notes under the project
  • k

    kevins8

    09/01/2020, 4:38 PM
    it would also make it hard to match notes like
    journals
  • j

    jojanaho

    09/01/2020, 4:38 PM
    without any schema
  • j

    jojanaho

    09/01/2020, 4:38 PM
    what would be the drawback of that in comparison to namespaced project
  • k

    kevins8

    09/01/2020, 4:39 PM
    can you give an example of adding notes under the project without schemas?
  • k

    kevins8

    09/01/2020, 4:39 PM
    also, current schema for journal. wouldn't be feasible without the
    pattern
    attribute
    Copy code
    yml
    # schema for journals
    # the following schema will match the follwoing
    # 
    # journal
    # journal.2020
    # journal.2020.09
    # journal.2020.09.12
    # journal.2020.09.12.foo.md
    
    version: 1
    schemas:
    - id: journal
      title: journal
      desc: ""
      parent: root
      children:
        - year
    - id: year
      title: year
      pattern: "[0-2][0-9][0-9][0-9]"
      children: 
        - month
    - id: month
      title: month
      pattern: "[0-9][0-9]"
      children: 
        - day
    - id: day
      title: day
      pattern: "[0-9][0-9]"
      namespace: true
  • j

    jojanaho

    09/01/2020, 4:41 PM
    > can you give an example of adding notes under the project without schemas? Just slamming "project.my-project" into the note structure without any concern about schemas 🙂
  • j

    jojanaho

    09/01/2020, 4:42 PM
    I think currently how this would be visible to me is that I miss an icon. Maybe there's also something else?
  • k

    kevins8

    09/01/2020, 4:42 PM
    yep, that's exactly it
  • k

    kevins8

    09/01/2020, 4:42 PM
    schemas don't stop you from adding notes and aren't required
  • k

    kevins8

    09/01/2020, 4:43 PM
    thats why i like to compare them to an optional type system
  • k

    kevins8

    09/01/2020, 4:43 PM
    eg. typescript definitions
  • k

    kevins8

    09/01/2020, 4:44 PM
    you can use them when you have lots of notes under a hierarchy and want to enforce some sort of consistency
  • k

    kevins8

    09/01/2020, 4:44 PM
    in my knowledge base, i would guess maybe ~60% of my notes are covered by a schema
12345...108Latest