/dev/log: viole.in
-
2024/07/19
-
rework notes
-
now entry with the same name together, separate by date
-
-
remove
/sketch
-
-
2024/07/10
-
create friction log for feedback
-
why & how: https://blog.sbensu.com/posts/friction-logs/
-
i still remember how to build lol.
-
-
2023/12/14
-
added notes, created note
slugwith regex voodo and google-fu. -
notes gonna be my random entry point for everything uncatergorized and adhoc, until it have a better place/
-
still getting things out from
logseqwithpropertiesand generate static path withregex voodo-
const slug = (s: string) => s.replace(/[^a-z\d ]+/ig, " ").replace(/\s{2,}/g, " ").trim().split(" ").join("-") -
this will make things into
something-like-thisfor path purpose. -
horrendous, i know. but it quick and painless and i have
/dev/loghere for future reference
-
-
also query specific block using
uuidinlogseq-
[ :find (pull ?b ${model}) :in $ % :where [?b :block/uuid #uuid "${id}"] ] -
i donât know why, but it works, so it works
-
-
-
2023/12/13
-
firefox havenât supported
:has()selector yetâŚ-
polyfill and introducing
postcss-preset-envis too much complication for me to go that route. browser polyfill with js -> no. no. no.
-
-
back to
classway. figuring out whichlihave nestedul, and then add.parentto that.-
:hasmade stylingparent elementso much easier. why firefox, why
-
-
test on firefox to check if things work correctly or not
-
another level?
-
nobody should ever use h1 here, but i make it
longanyways to see if it wraps correctly -
siblings?
-
ok
-
-
-
-
-
2023/12/12
-
resurrecting til and marks, this time simpler, no more âjavascriptâ. hurrah.
-
goodreads killed off their api, so i ended up tracking book myself
-
logseqandsimple queryare good for this kind of stuff, so why not -
(and (property :book) (not (property :quote)) (property :status "read")) -
games and movies are next đ¤
-
-
-
2023/12/10
-
iâve been working on
v2with minimal to unstyle css, and had great fun with it. entire css hopefully is just under 100 lines of css. -
make an outline style for
logseqcontent-
css recently introduce
& nesting selectorso scoping style forlogseqis trivial now, and new css selector like:has,:isis a bliss to work with. -
the gap after list marker default doesnât give me any kind of alignment to create a border like
logseq. so i have to jumping through hoop and align everything by myself. -
the hardest thing about this is make the alignment just right for
headerand the bullet-
i have a simple solution is using fixed
line-heightfor all theheaderand then absolute positioning thebullet -
it convenient and still look great. keep it simple, stupid.
-
-
.logseq { & * > * {margin-bottom: 8px;} & h1, h2, h3, h4, h5, h6 { line-height: 32px; padding: 8px 0; & + ul:has(> :is(h1,h2,h3,h4,h5, h6)) {margin-top: -16px;} & + ul { margin-top: -8px;} } & ul { width: 100%; margin: 0 8px;} & * > ul {padding-left: 8px;} & li {list-style: none; position: relative; --bullet-spacing:0px} & li:has(> ul)::after {content:""; position: absolute; top: calc(24px + var(--bullet-spacing)); left: -8px; transform: translateX(100%); height: calc(100% - 24px - var(--bullet-spacing)); width: 2px; background-color: var(--sel); }; & li::before{content: "â˘"; position: absolute; left: -8px;} & li:has(h1,h2,h3,h4,h5,h6)::before{top:12px;} & li:has(h1,h2,h3,h4,h5,h6)::after {--bullet-spacing:12px;} }
-
-
-
2023/11/12
-
figuring out how to sort by left node #logseq
-
here a little peak into how
logseqstore the block insidedatascriptnicely encoded intypescript-
interface Node { id: number left_node: Node //sibling next to the node parent: Node //parent of this node } type Tree = Node[] -
this is a linked list (ikr đ¤Ż) reprensenting a tree
-
this kind of data structure help us figured out which of the node is the first children of other node with simple check
node.left_node.id === node.parent.id -
the other children will need to follow
left_nodeuntilleft_node.id == node.parent.idalso-
the length of search will neatly indicate the order of node in a tree (e.g first child = 1, second (left = first child ) = 2)
-
-
and we can find the order of node by follow the
left_nodeuntil theleft_nodeis also theparent_node, which mean we at the very first sibling of this tree
-
-
after we establish the relationship between
parentandleft_nodewe can easily traverse the tree with this beautiful recursive function-
function walk(tree, parent, count){ if (tree.id === parent.id) return count; return walk(tree.left_node, parent, count+1) }
-
-
-
the problem become sort by the distance from the node to the parent
-
first we need to recursively pulled the left node of this node
-
with
(pull [{:block/left ...}])
-
-
then we traverse the tree until we found the left node id equal to the parent
-
-
the only requirement to make this problem easier is the nodes to be sorted with should have the same parent
-
even
logseqitself have no clue how to sort when the query result have different parent
-
-
-
fixed some weird bugs about
textareaand@preact/signals-
textareadoesnât supportvalueproperty so when i tried to passedvalueinto it some thing broke. move the value insidetextareaand it works fine now
-
-
-
2023/11/12
-
init devlog
-