Skip to content

Commit

Permalink
(core/wiki) Show wiki document node's title on hover
Browse files Browse the repository at this point in the history
  • Loading branch information
malkoG committed Nov 25, 2023
1 parent e3f7a3b commit d807a03
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 77 deletions.
14 changes: 8 additions & 6 deletions plugins/builders/backlink_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ def build

_, *tokens = pathname.split('/') # Removes _wiki/
filename = tokens.join('/')
source = filename[..-4] # Removes file extension name
slug_name = filename[..-4] # Removes file extension name

nodes << source
nodes << {
slug_name: slug_name,
title: wiki_document.data.title
}

wiki_content = wiki_document.content

Expand All @@ -105,17 +108,16 @@ def build
group_name = "##{tag}"
links << {
"source": group_name,
"target": source,
"target": slug_name,
"value": 100,
}
end

internal_links = wiki_content.scan(/\[\[([\w\-\/\_\s\.]+)\]\]/)
internal_links&.each do |link|
link = link[0]
nodes << link
links << {
"source": source,
"source": slug_name,
"target": link,
"value": 1,
}
Expand All @@ -125,7 +127,7 @@ def build
cluster_node_coordinates, cluster_links = Utils::ClusterVisualizer.calculate_coordinates(CLUSTER)
reference_graph = {
"nodes": [
*nodes.to_a.map { |name| ({ id: name, group: 1 }) },
*nodes.to_a.map { |node| ({ id: node[:slug_name], group: 1, name: node[:title] }) },
*cluster_node_coordinates,
],
"links": [*links, *cluster_links],
Expand Down
2 changes: 1 addition & 1 deletion src/_data/available_wiki_documents.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["tmuxinator","rfc/visualization","metacognition","improving-productivity/journey","productivity","vim/versus-neovim","vim/builtins","vim","quarterly/2023-Q3","workbench/cheatsheet","mastodon/recommendations","archive","quarterly/2023-Q2","appendix/excelcon-2nd","appendix","rfc","rfc/2616","quarterly/2023-Q1","mastodon","vim-plugin/flutter-tools.nvim","digital-garden","prompt-engineering","vim-plugin/mind.nvim","improving-productivity","cli/diff","cli","dogfooding-driven-development","workbench","wezterm","vim-plugin/telekasten.nvim","vim-plugin","symbol","neovim","projects/neural-bridge","daily/2023-01-19"]
["rfc/visualization","mermaid","metacognition","improving-productivity/journey","productivity","vim/versus-neovim","vim/builtins","vim","quarterly/2023-Q3","workbench/cheatsheet","mastodon/recommendations","archive","quarterly/2023-Q2","appendix/excelcon-2nd","appendix","rfc","rfc/2616","quarterly/2023-Q1","mastodon","vim-plugin/flutter-tools.nvim","digital-garden","prompt-engineering","vim-plugin/mind.nvim","improving-productivity","cli/diff","cli","dogfooding-driven-development","workbench","wezterm","vim-plugin/telekasten.nvim","vim-plugin","tmuxinator","symbol","neovim","projects/neural-bridge","daily/2023-01-19"]
169 changes: 99 additions & 70 deletions src/_data/wiki_datasets.json
Original file line number Diff line number Diff line change
@@ -1,160 +1,184 @@
{
"nodes": [
{
"id": "tmuxinator",
"group": 1
},
{
"id": "rfc/visualization",
"group": 1
"group": 1,
"name": "RFC 문서 참조 관계 시각화"
},
{
"id": "metacognition",
"group": 1
"id": "mermaid",
"group": 1,
"name": "Mermaid"
},
{
"id": "improving-productivity",
"group": 1
"id": "metacognition",
"group": 1,
"name": "메타인지"
},
{
"id": "improving-productivity/journey",
"group": 1
"group": 1,
"name": "생산성 개선을 위한 여정"
},
{
"id": "productivity",
"group": 1
"group": 1,
"name": "생산성"
},
{
"id": "vim/versus-neovim",
"group": 1
"group": 1,
"name": "Vim vs Neovim"
},
{
"id": "vim/builtins",
"group": 1
"group": 1,
"name": "Vim에서 제공하는 기본 기능"
},
{
"id": "vim",
"group": 1
"group": 1,
"name": "Vim (TBD)"
},
{
"id": "quarterly/2023-Q3",
"group": 1
"group": 1,
"name": "2023 Q3 Review"
},
{
"id": "workbench/cheatsheet",
"group": 1
"group": 1,
"name": "오로지 키보드로만 모든 것을 해결하기 위한 Cheatsheet"
},
{
"id": "mastodon/recommendations",
"group": 1
"group": 1,
"name": "개발자들을 위한 페디버스 온보딩 가이드"
},
{
"id": "archive",
"group": 1
},
{
"id": "quarterly/2023-Q1",
"group": 1
"group": 1,
"name": "Archive"
},
{
"id": "quarterly/2023-Q2",
"group": 1
"group": 1,
"name": "2023 Q2 Review"
},
{
"id": "appendix/excelcon-2nd",
"group": 1
"group": 1,
"name": "제 2회 EXCELCON - Neovim으로 생산성 퀀텀점프하기"
},
{
"id": "appendix",
"group": 1
"group": 1,
"name": "부록"
},
{
"id": "rfc",
"group": 1
"group": 1,
"name": "RFC(Request For Comments)"
},
{
"id": "rfc/2616",
"group": 1
"group": 1,
"name": "RFC 2616 (HTTP 1.1)"
},
{
"id": "projects/neural-bridge",
"group": 1
"id": "quarterly/2023-Q1",
"group": 1,
"name": "2023 Q1 Review"
},
{
"id": "mastodon",
"group": 1
"group": 1,
"name": "Mastodon"
},
{
"id": "vim-plugin/flutter-tools.nvim",
"group": 1
},
{
"id": "flutter",
"group": 1
"group": 1,
"name": "akinsho/flutter-tools.nvim"
},
{
"id": "digital-garden",
"group": 1
},
{
"id": "vim-plugin/telekasten.nvim",
"group": 1
"group": 1,
"name": "디지털 가든"
},
{
"id": "prompt-engineering",
"group": 1
"group": 1,
"name": "프롬프트 엔지니어링"
},
{
"id": "vim-plugin/mind.nvim",
"group": 1
"group": 1,
"name": "mind.nvim"
},
{
"id": "cli/diff",
"group": 1
"id": "improving-productivity",
"group": 1,
"name": "생산성 개선"
},
{
"id": "cli",
"group": 1
"id": "cli/diff",
"group": 1,
"name": "CLI/diff"
},
{
"id": "wezterm",
"group": 1
"id": "cli",
"group": 1,
"name": "CLI"
},
{
"id": "tmux",
"group": 1
"id": "dogfooding-driven-development",
"group": 1,
"name": "개밥먹기 주도 개발"
},
{
"id": "dogfooding-driven-development",
"group": 1
"id": "workbench",
"group": 1,
"name": "kodingwarrior's workbench"
},
{
"id": "neovim",
"group": 1
"id": "wezterm",
"group": 1,
"name": "wezterm"
},
{
"id": "workbench",
"group": 1
"id": "vim-plugin/telekasten.nvim",
"group": 1,
"name": "Telekasten.nvim"
},
{
"id": "vim-plugin",
"group": 1
"group": 1,
"name": "vim-plugin"
},
{
"id": "vim-plugin/telescope.nvim",
"group": 1
"id": "tmuxinator",
"group": 1,
"name": "tmuxinator"
},
{
"id": "symbol",
"group": 1
"group": 1,
"name": "사회의 암묵적인 약속"
},
{
"id": "Neovim",
"group": 1
"id": "neovim",
"group": 1,
"name": "neovim"
},
{
"id": "projects/neural-bridge",
"group": 1,
"name": "Neural Bridge"
},
{
"id": "daily/2023-01-19",
"group": 1
"group": 1,
"name": "2023-01-19"
},
{
"id": "#prelude",
Expand Down Expand Up @@ -267,13 +291,8 @@
],
"links": [
{
"source": "#cli",
"target": "tmuxinator",
"value": 100
},
{
"source": "#productivity",
"target": "tmuxinator",
"source": "#prelude",
"target": "mermaid",
"value": 100
},
{
Expand Down Expand Up @@ -606,6 +625,16 @@
"target": "vim-plugin/telekasten.nvim",
"value": 1
},
{
"source": "#cli",
"target": "tmuxinator",
"value": 100
},
{
"source": "#productivity",
"target": "tmuxinator",
"value": 100
},
{
"source": "#misc",
"target": "symbol",
Expand Down

0 comments on commit d807a03

Please sign in to comment.