The ULTIMATE Guide to Namespaces in Logseq | Beginner to Expert

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
namespaces are killer feature in log c and they can transform the way you work within it my name is aryan and in this video i'll be introducing you to the concert of namespaces in logseek and teaching you how to get the most out of it i'll be walking you through my workflow and give you tips and tricks that will apply to almost every use case you can think of now this will be a comprehensive video and it may be a bit long so you don't have to watch all of it especially if you're not new to log c and have been using it for a while but i'll anyways leave timestamps down in the description so you can easily walk around and just check out the parts that interest you the most although i do recommend not missing the tips and tricks section there'll be something in that for everyone let's start off with water name spaces i like to think of namespaces as a way to sort of create order in the chaos of tags now generally there's thought to be two primary organizational paradigms one is the hierarchical note-taking paradigm of rome research or what logsy typically identifies with where connections are made primarily with tags there isn't really a concept of folders while on the other hand there's a more traditional hierarchical uh note-taking structures now absent that uses structure are evernote onenote you know the general traditional kinds even pen and paper typically falls under this category both of these approaches have their own benefits and downsides and most apps fall under one of these categories now log seek is primarily a bottom-up or tag-based sort of application where connections are primarily made to through tags i'll link to a video here if you're interested in learning more about it but i'll get back to namespaces now so like i mentioned namespaces are a way to create order in the chaos of tags now how exactly does this work essentially namespaces allows you to sort of make a page a subpage of another all right so there's four primary cases where i use namespaces first is to enable inheritance second is if you have maybe two or more pages with similar names third is as a way to sort of categorize and get a visual look at the category as well as finally to segregate and separate pages into their own distinct sections now of course these four categories aren't set in stone and there's like a pretty good amount of carryover between each of these categories but i've tried my best to separate them into four distinct so let's start with inheritance all alright so let's say i've got a page about a book called say the daily stoic so this page will consist of all the highlights that i made from that book and now let's say one day i decided to watch thiago forte's videos and realize i should probably remix my content maybe i should create a blog post or a newsletter issue about this book and some of my favorite messages from it right so now how would i go about this so one potential solution is to add a section somewhere down on this page but now obviously this page is kind of a little bit huge so i'm really not sure that adding more stuff to this already massive page is the best idea right so now what's the other option so maybe create a page called the the article on the daily stoic but the issue here is that i genuinely believe that this page should still fundamentally exist as part of the previous page the daily story page but now how would i sort of handle this case i mean sure we could just name it article or book review or something on the daily story and maybe a link i guess to the daily story page or maybe have like a relates to property property but as you can see these probably isn't it it feels like there's something missing with this right so what can you do to like make this like a first class child essentially off the previous page this is where namespaces come in right now to create a namespace it's very simple so you simply create command k like you know the way you normally create a new page you can also create one through an inline link or something but literally just created using the daily stoic slash blog post and boom you've brought another page and there are a few special things about this page that you will notice the first is obviously this tile property but i'll just yeah so i'll just delete this so what else do you notice about this page right uh seems regular nothing at the top nothing here and hmm what's this hierarchy i wonder what this means and if you see here you see a bullet point called the daily stoic and if i click that hierarchy it takes me back to the daily story so i guess that's one way to that the relationship can be expressed because well now you can see the previous page and here but it still feels like there's something missing right like how would you know that this page is connected to that page like previously like even with the if you'd use the article about page you'd only see like a linked reference right but now what's special about this is that there's an entirely different section called hierarchy right and now we've and now we go to hierarchy and what's special about this hierarchy is that it essentially shows that the blog post is a descendant of the daily story now i really do not want to keep all the stuff here and i'm not actually going to use the block to page plug-in which i'll just show you so i'm just going to first indent everything under that block right and then tab and all right great it's indented i'll right click the block and click turn into page and boom now you've got a page called the daily story highlights right awesome and once again this title property and you can see all the highlights are on this page all right now this definitely cloud really declutters the original page and here's what's special now as you can see in the hierarchy in addition to having a blog post you see the relationship of the highlights page as well these are both inheriting from the daily strike page and if you go on to the blog post page well you only see the daily story because the blog post is only a child of the daily stoic and now the way that i'd approach this workflow is that i'd have the daily stoic as sort of like the central page of the daily story book so i'll just have as you can see a quick summary and over here i would essentially have whatever i want to see from the tool tip when i hover over this page will be shown here so i'm just like randomly typing and i see a daily story so i just hover over it and what i expect to see or what would be relevant to me in that time is just this quick synopsis that and i might just add uh 365 uh page 365 chapters one for every day awesome and now this is really all the information that i want to see when i hover over this page now a lot of there's lots of other cool stuff about this now this would essentially allow you to have multiple uh blog post pages like let's say you only want a blog post about one specific thing so let's say i only really need a blog post like because this book is too massive to divide into just a single blog post so i'll have blog post part one and i'll go back blog part one as you can see here but and i can also create now a page called blog post part two right so blog post part two um about fear maybe now you're back in the daily story and you can see these two uh blog post sections right so now at this point what i can do now is go even a step further and actually just rename these pages to blog post slash uh i don't know maybe about fear right and i'll go here and rename this blog post to about duty maybe and now if i go back to the page you'll notice that there's actually a third hierarchy blog post and and now if you go into this blog post page you'll see that there is uh it has children for about duty and about fear and this is pretty pretty big and definitely one of the best use cases that i've seen is just to be able to just go into the blog post page and easily see all the blog posts that have to do with it and this is similar i guess to the the map of contents in obsidian the entire method of map of contents and this can be replicated using namespaces and this allows you to have essentially multiple review pages as well while still keeping each blog post review separate and while still being connected to the initial book this directly bridges into the next use case which is naming and differentiating repeated pages let me explain so using the previous model you essentially have a bunch of review pages and these show up on the source page is just blog post but they're interestingly linked to the parent followed by the child or the daily stoic slash blog post this means you can have multiple review pages in your database and they all appear on sources just for you and they can be referred to and exist as separate pages for instance i can actually create a separate page called about duty and this exists separately to this page and that's really the core message you can have different pages for one topic but they're only differentiated by their namespace so i can have like maybe blog posts and this post exists separately from the daily story so i could just have like a plain old blog post page but i also have the daily story size blog post and this relates directly to the daily stoic but perhaps the best application for this is in programming notes so i'll actually just go there go to my programming notes right now so normally when you're learning programming languages a lot of the concepts are fundamentally the same well at least name so functions for instance right it's probably there in every single programming language has some concept of function one option is just create a plain page called functions right you probably want to differentiate between functions in different languages like functions and closure are different from functions in javascript they behave differently they are typed differently and when i'm like just generally if i come across an interesting application of functions on my day-to-day life and i write about it in the journal i want to be able to distinguish which kind of functions i'm talking about so the way i take programming notes involves me having a page for every single high-level language or framework so for instance i have pages for swift i have pages for javascript i have pages for python i have pages for c i pages for closure so i have all of these so now let's say i take a few notes on how to define a function in swift so how i do it is i start off with a link to the swift slash functions page right so and under this i'll indent uh defined by uh the syntax and over here i'll write the syntax or something so swift right and this i'll just have it here as my as one of my notes so now let's say later in the next week i'm learning about uh python and specifically i'm covering python functions so i in this case create a page called python functions which i already have and under this i'll indent like similar things about how to define uh now looking back at what i've done you'll see that i've essentially covered two very similar programming concepts but i've put them into their own pages based on their specific nuance so what's even cooler is how when i go into the swift page like just a plain old swift page right let's say i look down and i can see like literally every single hierarchy okay every single hierarchy that i have i can like see which what over what i can see my pages for each concept i can easily get a first eye view on each concept and understand how i can and i can see that everything's just organized into such a nice list and there's inheritance and it's a nice experience and now this may sound familiar to people who've used evernote or onenote or another notetaking tool in that range because this is essentially a list illustrating the hierarchy of a note but combined with the power of log c can leave to lead to a sort of best of both worlds so you can still use all your log seek features you can still heavily link and embed data in different places but you'll also be able to get the benefit of having say a separate database or in the case of onenote or something a separate folder or section for each of the swift things but still be able to like you know link in between it so i can still link to uh python functions like in the swift functions page and i can still link to maybe both of those functions using uh in the same page and i'm not restricted by something like evernote where each of these exist separately from each other in addition to this this use case also applies to things like general meeting notes for instance let's say i've had a meeting with bob from purchasing now now i have a question would you double click and create a link to a page called purchasing it's kind of a two-way street so sure you would likely want to tag the department so you can easily corroborate all communications with that specific department right but i mean just simply writing purchasing probably isn't going to help you very much specifically because let's say i'm taking notes on the importance of purchasing in a business right so now i've got a page for purchasing here and uh i probably want to uh create a link to a page while purchasing here as well the issue here is that if i go to the purchasing page i now have two different purchasing related things linked into it so i have the purchasing department and i have the concept of purchasing in businesses and so now you can see that i have like three different page links now this is obviously not ideal what if i create something like importance of purchasing a business so instead of linking to the purchasing page i'll link to business slash purchasing and here i'll link to acme slash purchasing and here maybe i'll link to a grocery slash purchasing right and i can probably delete this page now but now what's essentially happening is that i've got three different pages called purchasing and each of these pages are related to a specific branch a specific use case of purchasing so i can have acme search purchasing and business purchasing grocery slash purchasing so these are probably not the best examples but they're just good to list illustrate what's happening here and these become a lot easier to see at a glance but also to just delineate between similar things this third use case is once again similar to the previous one really it's really just a way to get at a quick glance what a note is about a common practice and i'll actually show you this because i've been using this practice for a very long time so a common practice is to prefix videos with the articles with d or courses with c and so on right so as you can see i've got uh maybe i've read an article so i have a so how to study through your popular revision techniques right so i have article notes over here right ali abdal i believe he has a part-time youtuber academy course but he also has an article called the part-time youtuber academy so there's cases like this where there's a separate article and there's a separate course but they all have the same name in this case i guess i would prefix them with a right now this is an example of a workflow that can be supercharged with namespaces so by naming the page for instance let's say uh let's see if i have one for atomic habits right so i went for b uh dash under atomic habits now what if i were to rename this page to b slash atomic habits so now what's special about this is that rather than having a b colon when i go into the b slash atomic habits page similar to the what we discussed previously okay it's kind of massive at the bottom you have this hierarchy called b now i can get a burst eye view of essentially every single book over here while also having the prefixes that i was anyways going to use for this so rather than adding a special tag called i don't know type uh book i can literally just write b slash atomic habits on maybe book slash atomic habits or something like that how cool is that so another example of this i guess would be what if your keyword to blend it with the previous use case as well a bit so what if i have apple you know the company and the fruit so i can have fruit slash apple or company such all right and this way i can also get my pages for every fruit and my page for every company and all like apples bananas milk or whatever i have well not milk milk sort of fruit apples banana carrots no carrots or vegetables okay so whatever fruit is will be uh inherited from fruit would go in the fruits pages link references and all companies will go on company now there is one more use case and i think that this is one that really depends on your own workflows and this is compartmentalizing the pages into their own sections this is essentially replicating a folder structure in logseek in its entirety without any changes so now this is actually personally the approach that i take for my school notes normally for my school notes but i start with off with my physics page right now i'll show you my hierarchy so as you can see here what i've done is i've essentially sort of replicated what you'd expect with a simple like physical binder so i have like maybe a section on my shelf called physics and in that section on my shelf i have all my physics related stuff in that shelf i have my textbook and binders for everything that i learned in my grade 10 maybe right and then in grade 10 i have my in my grade 10 binder i have sections for astrophysics electromagnetism thermal physics etc so now the advantage of this approach is that there's a clear delineation of its note into its own sections which allows me to at a glance see everything inside one section so all that everything that comes under one section everything that comes under grade 10 physics for instance or everything that comes under my classes what i've learned in my external classes or maybe i think that other better approach would probably be for my business notes those are probably a better example so as you can see down here everything that i've done is directly inherited from the grade 10 business studies as an individual section but also for instance here i've got my lemonade stand as the subpage of cash flow forecast as well this is quite similar to some of the above but in its purpose but it's different enough that this method essentially embodies the traditional folder base architecture while still preserving the atomicity of the information so as you can see here i've got maybe if i go to my uh i don't know uh thermal physics page you know rather actually maybe my atomic physics page it's from all over the place i've embedded things so like nuclear physics atomic physics and these are all in my in this page embedded into this block and this is something that you won't really get with most traditional folder based or folder based structures it allows you to have the best of both worlds and this is probably the most true sense as it's literally folders you're literally dividing them into folders like sections atomic physics is under grade 10 physics and maybe you have a grade 9 physics section as well so right so everything's embedded inside that into its own separate place essentially but it's still a part of the greater whole it can still be linked from anywhere it can still embed things from anywhere it can still be made up of block embeds or references from other places in your database and that's in my opinion pretty cool now a lot of these four concepts share a lot in common with each other including the downsides the first one's pretty obvious they're long like page titles are just quite a pain to type up like i mean who's going to really type out uh all right physics or rather let's say business start and seem longer actually so i'm just going to go with um business studies stash grade 10 business studies slash i don't know uh income statements right and do i really want to be typing this enormous link every time i type right and just in a practical sense are you ever going to use these links if they're just this goddamn long to type out and they're also very ugly when you're just linking to it so like i did performed a income statement analysis on company x like really why is the link taking up seventy percent of the words in the sentence that's so probably not ideal and it can be very unwieldy and it isn't really the ideal frictionless experience and secondly there's another concern which is that this method of organization can at times force you into the type of rigidity that you might not actually want and this is something that's true for all of the mentioned use cases so what if you're not sure where something could go what if you have a single interdisciplinary class on engineering taught by both your science and math teachers like do you make a sentence sectional engineering or put it into math or put it into physics section how do you decide is the lecture already halfway done and you're still debating where to put your notes right now this is actually one of the problems in logsy install but in this area you're kind of getting stuck here and i think you can see where i'm going there's a chance that the friction coming from this can outweigh the benefits and this is supposed to be one of the benefits of log seat you don't have to think where to put your notes and this will be something that will be incredibly personal towards you so all of these above workflows may not work for everybody everyone the workflow the prefixes for videos are for instance pretty usable generally for everyone but the same cannot be said for categorizing the notes based on their overarching subject slash topic which is going to be more useful for students in my opinion and like for instance like going back to the engineering example like i have taking a notes on engineering so engineering taster session maybe right so i'm just taking notes here um now i know the last bit was a bit theoretical and i myself probably jumbled things up a bit with but that's because all the functions are so interrelated that it's hard to create solid delinations when you implement one so you usually benefit from the other one as well so let's have some fun now sure all the applications of namespaces may not be too applicable for your use case but there are some tricks that are almost universally useful so the first two deal with the typically unwieldy nature of namespaces usually by the virtue of its length in order to make the namespaces look less messy especially when your use case involves a lot of nested namespaces such as my usage for studying in order to make the name spaces look less messy you can use the following custom.js script now if you haven't used custom.js before and the process is fairly simple and i'll walk you through it all and i'll have a link to the custom.js script in the description as well right so this is the script for the namespace optimizer and you can this is actually by cannibalx and it's part of his larger his larger grid this is part of his larger bloxy custom files suite which you can find over here and this includes a quite a few utilities that i totally recommend but uh let's get back to this topic so i've literally just forked it and i've just taken the namespaces prefix collapser just to make it easier for you all so now to install this into your logseek instance just click download zip file uh allow download if you're in safari and then all you have to do is click into it we'll have a very weird name but once you've got that it should appear and here it is right so the next step is to quite literally just drag this file into your database folder right you uh you'll see wait i'll show you where the database is so as you can see test seek is over here and which is the name of the database and inside that there's a bunch of five folders which you're probably familiar with and inside the logseq folder you literally just drag this custom.js file and you're ready so now when you return to logseq reindex and now your boom now you're at your daily note page and as you can see all of your name spaces that were previously in this format and have now been reduced to simple collapsed and this just shows last name while also having dots to signify that these are descended from others so you can just create something else even more and as you can see from here the naspc just keeps getting shortened and boom and you can always you know just open the page click it and then maybe just return back and you can actually hover over it i believe and it will show you the full title of the page and this is pretty neat and i totally recommend this method for just keeping your name spaces much cleaner next is aliases which is already one of the most powerful features of dog seek but are especially useful when dealing with namespaces and i've created an in-depth article about this topic as well and a link to it will be in the description i believe if you want to read more so the beauty of aliases is that they're another way to refer to a page while the previous method deals primarily with the viewing of namespaces via aliases such as in this page you will notice that there's two that there is an alias property over here so as you can see it says statements of financial position and balance sheets both of these are separated by a comma so now what if i and now if i go to the bottom you can see that there's three linked references right but one very interesting thing that you'll notice all of a sudden is that some of these references like this one doesn't link to this very long name i can also just go here and type balance sheet so now when i go to balance sheets uh it actually takes me to this page and what's special about this is that it appears at the bottom as well as linked references and this makes it so you don't have to type that massive link every single time and like even for this example you can this link over here you could have just typed income statements and the link would still be counted because i've already created an alias in this page that leads to income statements and i have more about this in the article right but there's also another way and like let's see you see this big link right over here right i can just take out these brackets uh surrounded in just brackets add thing here and over here you can add alias text such such as um [Music] i see i know that's not cool short form for income statements but as you'll see you can actually link directly to this while maintaining the connections there and that's pretty cool but i do thoroughly recommend the alias colon example as that allows you to like have it actually appear in autocomplete and this is just sort of a visual this whole thing radically simplifies the use of namespaces and makes it that you can retain the structure of namespaces without maintaining the downsides of it now another very nice feature to do with namespaces is the namespace query feature but what i've essentially done here is that i've added this purely looking text it just says namespace and then business studies in some bracket i guess what this does is that it shows you every single item in the namespace but it shows you that in hierarchy it shows you what descends from which topic the connection between all those and this view is essentially what you'd see in like the sidebar of a note taking app like evernote or obsidian where you can see that the notes are in their own folders but and this is quite literally just a way of viewing the notes in their in the folders and a really neat thing about this is that you can quite literally put this query anywhere that you want some people just keep it in their contents page to create sort of a map of contents i guess just automatically generate it and that's just a very useful thing that not many people know about segmenting from this here's the tip about querying and linked references so when you link to a page like say uh yeah i'll just create one link to this page so when i go to this page like as you would expect you would see this link up here at the bottom right but one very interesting thing is that the physics page will also have a page appear as a link and it's the same with the grade 10 physics page that will also appear right over here and this is pretty cool because this unlocks a few possibilities especially when using other use cases like for instance for the daily story from previously when you link to the daily story slash highlights right when you link to this page you also link to the regular daily story page and from there you can easily see everything that has to do with the daily story not just like the highlights of it or everything that has to do with the review and it's acts as sort of a centralized repository of and this will allow you to instantly sort through the references which gives a ton of utility to the source page and this relates well with almost all the above use cases actually and the same logic can be applied to querying where by querying for one page you would also return all the results of the pages above it so for instance if i create a query for uh let's say physics it's not only the physics pages that will be returned but also the links to the external places as well so like astrophysics the thermophysics the the grade 10 physics all this stuff will also appear in the query like if you combine it with the previous prefix thing for like book and all you can also just query for a book and all the books will show up so finally for those who are interested i'm going to go into a bit of the behind the scenes and maybe a few technical details so feel free to skip the section if you're not interested in knowing about this but this will help you understand it and its limitations so at its core all namespace files are stored in the same manner as regular files they're just hanging out in the pagestep folder if i open this page using uh open directory what appears is this so you've got the parent page and all the sub pages are separated by these percentage 2f which is just unicode because file systems do not really treat the slashes simply very well and as a result it's necessary that something like this be used from version 0.6 to 6.8 onwards this new percentage 2f url encoding has been performed so that it is more steady and this will eliminate the need for the title property in the future and this also unlocks the possibility for having dots in the title of your page as this would previously create namespace as in prior versions the file names had dots instead of the percentage 2f now if you're into advanced queries these are stored as regular pages in the database but all of these are accessible via the the blog namespace property so now i hope this this video was helpful for you and it would help you kick off your journey with namespaces it's a powerful tool and is one that i definitely think can add value to your setup thank you and until next time you can see any additional videos if you'd like on the left and the right of the screen
Info
Channel: Aryan Sawhney
Views: 31,096
Rating: undefined out of 5
Keywords: Losgeq, logseq, namespaces, logseq folders, studying, notetaking, study notes, notes
Id: POQgVXpaHxw
Channel Id: undefined
Length: 33min 27sec (2007 seconds)
Published: Wed Jul 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.