removed wikilinks (for now)
This commit is contained in:
parent
d14028e727
commit
806ccf24cf
|
|
@ -23,7 +23,6 @@ from .utils import (
|
|||
save_note,
|
||||
delete_note,
|
||||
search_notes,
|
||||
parse_wiki_links,
|
||||
create_note_metadata,
|
||||
ensure_directories,
|
||||
create_folder,
|
||||
|
|
@ -336,8 +335,8 @@ async def api_documentation():
|
|||
{
|
||||
"method": "GET",
|
||||
"path": "/api/graph",
|
||||
"description": "Get graph data for note visualization (wiki links)",
|
||||
"response": "{ nodes: [{ id, label }], edges: [{ from, to }] }"
|
||||
"description": "Get graph data for note visualization",
|
||||
"response": "{ nodes: [{ id, label }], edges: [] }"
|
||||
},
|
||||
{
|
||||
"method": "GET",
|
||||
|
|
@ -651,13 +650,9 @@ async def get_note(note_path: str):
|
|||
if transformed_content is not None:
|
||||
content = transformed_content
|
||||
|
||||
# Parse wiki links
|
||||
links = parse_wiki_links(content)
|
||||
|
||||
return {
|
||||
"path": note_path,
|
||||
"content": content,
|
||||
"links": links,
|
||||
"metadata": create_note_metadata(config['storage']['notes_dir'], note_path)
|
||||
}
|
||||
except HTTPException:
|
||||
|
|
@ -745,28 +740,22 @@ async def search(q: str):
|
|||
|
||||
@api_router.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:
|
||||
notes = get_all_notes(config['storage']['notes_dir'])
|
||||
nodes = []
|
||||
edges = []
|
||||
|
||||
# Build graph structure
|
||||
# Build graph structure - only nodes for now
|
||||
for note in notes:
|
||||
nodes.append({
|
||||
"id": note['path'],
|
||||
"label": note['name']
|
||||
})
|
||||
|
||||
# Get links from this note
|
||||
content = get_note_content(config['storage']['notes_dir'], note['path'])
|
||||
if content:
|
||||
links = parse_wiki_links(content)
|
||||
for link in links:
|
||||
edges.append({
|
||||
"from": note['path'],
|
||||
"to": link
|
||||
})
|
||||
if note.get('type') == 'note': # Only include actual notes
|
||||
nodes.append({
|
||||
"id": note['path'],
|
||||
"label": note['name']
|
||||
})
|
||||
|
||||
# Note: Link detection between notes could be implemented here using markdown link parsing
|
||||
# For now, returning empty edges
|
||||
|
||||
return {"nodes": nodes, "edges": edges}
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -236,13 +236,6 @@ def delete_note(notes_dir: str, note_path: str) -> bool:
|
|||
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]:
|
||||
"""Simple full-text search through all notes"""
|
||||
results = []
|
||||
|
|
|
|||
|
|
@ -641,8 +641,8 @@
|
|||
<div class="benefit-item">
|
||||
<span class="emoji">🔗</span>
|
||||
<div class="text">
|
||||
<strong>Wiki Links</strong>
|
||||
Connect notes with internal links
|
||||
<strong>Internal Links</strong>
|
||||
Connect notes with markdown links
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -725,7 +725,7 @@
|
|||
"url": "https://www.notediscovery.com",
|
||||
"applicationCategory": "ProductivityApplication",
|
||||
"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": {
|
||||
"@type": "Offer",
|
||||
"price": "0",
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
## 🔗 Linking & Discovery
|
||||
|
||||
### 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
|
||||
- **Click to navigate** - Jump between notes seamlessly
|
||||
- **External links** - Open in new tabs automatically
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ curl -X POST http://localhost:8000/api/plugins/note_stats/toggle \
|
|||
|
||||
### 🔗 Links & References
|
||||
- **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
|
||||
- **Images** - `` count
|
||||
|
||||
|
|
@ -191,7 +191,7 @@ Find orphaned notes or track reference density.
|
|||
|
||||
**Words:** Split on whitespace, excluding code blocks
|
||||
**Reading Time:** `words / 200 minutes`
|
||||
**Links:** Regex match `[text](url)` and `[[WikiLink]]`
|
||||
**Links:** Regex match `[text](url)` markdown links
|
||||
**Tasks:** Match `- [ ]` and `- [x]`
|
||||
**Code Blocks:** Match ` ```language ` ` fences
|
||||
**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
|
||||
let html = marked.parse(content);
|
||||
let html = marked.parse(this.noteContent);
|
||||
|
||||
// Post-process: Add target="_blank" to external links and title attributes to images
|
||||
// Parse as DOM to safely manipulate
|
||||
|
|
|
|||
Loading…
Reference in New Issue