removed wikilinks (for now)
This commit is contained in:
parent
d14028e727
commit
806ccf24cf
|
|
@ -23,7 +23,6 @@ from .utils import (
|
||||||
save_note,
|
save_note,
|
||||||
delete_note,
|
delete_note,
|
||||||
search_notes,
|
search_notes,
|
||||||
parse_wiki_links,
|
|
||||||
create_note_metadata,
|
create_note_metadata,
|
||||||
ensure_directories,
|
ensure_directories,
|
||||||
create_folder,
|
create_folder,
|
||||||
|
|
@ -336,8 +335,8 @@ async def api_documentation():
|
||||||
{
|
{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
"path": "/api/graph",
|
"path": "/api/graph",
|
||||||
"description": "Get graph data for note visualization (wiki links)",
|
"description": "Get graph data for note visualization",
|
||||||
"response": "{ nodes: [{ id, label }], edges: [{ from, to }] }"
|
"response": "{ nodes: [{ id, label }], edges: [] }"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
|
|
@ -651,13 +650,9 @@ async def get_note(note_path: str):
|
||||||
if transformed_content is not None:
|
if transformed_content is not None:
|
||||||
content = transformed_content
|
content = transformed_content
|
||||||
|
|
||||||
# Parse wiki links
|
|
||||||
links = parse_wiki_links(content)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"path": note_path,
|
"path": note_path,
|
||||||
"content": content,
|
"content": content,
|
||||||
"links": links,
|
|
||||||
"metadata": create_note_metadata(config['storage']['notes_dir'], note_path)
|
"metadata": create_note_metadata(config['storage']['notes_dir'], note_path)
|
||||||
}
|
}
|
||||||
except HTTPException:
|
except HTTPException:
|
||||||
|
|
@ -745,28 +740,22 @@ async def search(q: str):
|
||||||
|
|
||||||
@api_router.get("/graph")
|
@api_router.get("/graph")
|
||||||
async def get_graph():
|
async def get_graph():
|
||||||
"""Get graph data for visualization"""
|
"""Get graph data for note visualization (currently only returns nodes, link detection not implemented)"""
|
||||||
try:
|
try:
|
||||||
notes = get_all_notes(config['storage']['notes_dir'])
|
notes = get_all_notes(config['storage']['notes_dir'])
|
||||||
nodes = []
|
nodes = []
|
||||||
edges = []
|
edges = []
|
||||||
|
|
||||||
# Build graph structure
|
# Build graph structure - only nodes for now
|
||||||
for note in notes:
|
for note in notes:
|
||||||
nodes.append({
|
if note.get('type') == 'note': # Only include actual notes
|
||||||
"id": note['path'],
|
nodes.append({
|
||||||
"label": note['name']
|
"id": note['path'],
|
||||||
})
|
"label": note['name']
|
||||||
|
})
|
||||||
# Get links from this note
|
|
||||||
content = get_note_content(config['storage']['notes_dir'], note['path'])
|
# Note: Link detection between notes could be implemented here using markdown link parsing
|
||||||
if content:
|
# For now, returning empty edges
|
||||||
links = parse_wiki_links(content)
|
|
||||||
for link in links:
|
|
||||||
edges.append({
|
|
||||||
"from": note['path'],
|
|
||||||
"to": link
|
|
||||||
})
|
|
||||||
|
|
||||||
return {"nodes": nodes, "edges": edges}
|
return {"nodes": nodes, "edges": edges}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
|
|
@ -236,13 +236,6 @@ def delete_note(notes_dir: str, note_path: str) -> bool:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def parse_wiki_links(content: str) -> List[str]:
|
|
||||||
"""Extract wiki-style links [[link]] from markdown content"""
|
|
||||||
pattern = r'\[\[([^\]]+)\]\]'
|
|
||||||
matches = re.findall(pattern, content)
|
|
||||||
return matches
|
|
||||||
|
|
||||||
|
|
||||||
def search_notes(notes_dir: str, query: str) -> List[Dict]:
|
def search_notes(notes_dir: str, query: str) -> List[Dict]:
|
||||||
"""Simple full-text search through all notes"""
|
"""Simple full-text search through all notes"""
|
||||||
results = []
|
results = []
|
||||||
|
|
|
||||||
|
|
@ -641,8 +641,8 @@
|
||||||
<div class="benefit-item">
|
<div class="benefit-item">
|
||||||
<span class="emoji">🔗</span>
|
<span class="emoji">🔗</span>
|
||||||
<div class="text">
|
<div class="text">
|
||||||
<strong>Wiki Links</strong>
|
<strong>Internal Links</strong>
|
||||||
Connect notes with internal links
|
Connect notes with markdown links
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -725,7 +725,7 @@
|
||||||
"url": "https://www.notediscovery.com",
|
"url": "https://www.notediscovery.com",
|
||||||
"applicationCategory": "ProductivityApplication",
|
"applicationCategory": "ProductivityApplication",
|
||||||
"operatingSystem": "Linux, Windows, macOS",
|
"operatingSystem": "Linux, Windows, macOS",
|
||||||
"featureList": "Markdown editor, LaTeX math equations, Mermaid diagrams, Code syntax highlighting, Dark mode, Plugin system, Internal wiki links, HTML export, Full-text search, Self-hosted, Obsidian, Evernote, Notion, Onenote, Second brain",
|
"featureList": "Markdown editor, LaTeX math equations, Mermaid diagrams, Code syntax highlighting, Dark mode, Plugin system, Internal links, HTML export, Full-text search, Self-hosted, Obsidian, Evernote, Notion, Onenote, Second brain",
|
||||||
"offers": {
|
"offers": {
|
||||||
"@type": "Offer",
|
"@type": "Offer",
|
||||||
"price": "0",
|
"price": "0",
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
## 🔗 Linking & Discovery
|
## 🔗 Linking & Discovery
|
||||||
|
|
||||||
### Internal Links
|
### Internal Links
|
||||||
- **Wiki-style links** - `[[Note Name]]` syntax
|
- **Markdown links** - `[Note Name](note.md)` syntax
|
||||||
- **Drag to link** - Drag notes or images into the editor to insert links
|
- **Drag to link** - Drag notes or images into the editor to insert links
|
||||||
- **Click to navigate** - Jump between notes seamlessly
|
- **Click to navigate** - Jump between notes seamlessly
|
||||||
- **External links** - Open in new tabs automatically
|
- **External links** - Open in new tabs automatically
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ curl -X POST http://localhost:8000/api/plugins/note_stats/toggle \
|
||||||
|
|
||||||
### 🔗 Links & References
|
### 🔗 Links & References
|
||||||
- **Total Links** - All `[text](url)` links
|
- **Total Links** - All `[text](url)` links
|
||||||
- **Internal Links** - `[[WikiLinks]]` to other notes
|
- **Internal Links** - Links to other notes (`.md` files)
|
||||||
- **External Links** - HTTP/HTTPS URLs
|
- **External Links** - HTTP/HTTPS URLs
|
||||||
- **Images** - `` count
|
- **Images** - `` count
|
||||||
|
|
||||||
|
|
@ -191,7 +191,7 @@ Find orphaned notes or track reference density.
|
||||||
|
|
||||||
**Words:** Split on whitespace, excluding code blocks
|
**Words:** Split on whitespace, excluding code blocks
|
||||||
**Reading Time:** `words / 200 minutes`
|
**Reading Time:** `words / 200 minutes`
|
||||||
**Links:** Regex match `[text](url)` and `[[WikiLink]]`
|
**Links:** Regex match `[text](url)` markdown links
|
||||||
**Tasks:** Match `- [ ]` and `- [x]`
|
**Tasks:** Match `- [ ]` and `- [x]`
|
||||||
**Code Blocks:** Match ` ```language ` ` fences
|
**Code Blocks:** Match ` ```language ` ` fences
|
||||||
**Headings:** Match `#`, `##`, `###` at line start
|
**Headings:** Match `#`, `##`, `###` at line start
|
||||||
|
|
|
||||||
|
|
@ -2321,13 +2321,8 @@ function noteApp() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Convert wiki-style links [[link]] to HTML links
|
|
||||||
let content = this.noteContent.replace(/\[\[([^\]]+)\]\]/g, (match, linkText) => {
|
|
||||||
return `<a href="#" style="color: var(--accent-primary);" onclick="return false;">[[${linkText}]]</a>`;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Parse markdown
|
// Parse markdown
|
||||||
let html = marked.parse(content);
|
let html = marked.parse(this.noteContent);
|
||||||
|
|
||||||
// Post-process: Add target="_blank" to external links and title attributes to images
|
// Post-process: Add target="_blank" to external links and title attributes to images
|
||||||
// Parse as DOM to safely manipulate
|
// Parse as DOM to safely manipulate
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue