Skip to main content

Converts different typed link formats in Markdown into each other and to external formats.

Project description

Semantic Markdown converter

Converts different typed link formats in Markdown into each other and to external formats. Designed for visualizing obsidian.md vaults using Neo4j bloom by importing the data into neo4j.

Getting started

Requires python 3.5+ and Neo4j desktop

  • Install with pip install --upgrade semantic-markdown-converter
  • Create a new database in Neo4j desktop and start it
  • Run smdc --input "folder with notes" --password "neo4j database password"

WARNING: This clears all the data in the active neo4j database!

Supported input formats

There is currently only one input format supported. An issue or use a pull request for different formats are appreciated! In particular for different markdown syntax for interpreting semantic links.

Plain markdown with a rudimentary typed links format.

This collects all notes with extension .md in the input directory (default: markdown/). Each note is interpreted as follows:

  • Interprets tags as entity types
  • Interprets YAML frontmatter as entity properties
  • Interprets wikilinks as links with type inline, and adds content
  • Lines of the format "- linkType [[note 1]], [[note 2|alias]]" creates links with type linkType from the current note to note 1 and note 2.
  • The name of the note is stored in the property name
  • The content of the note (everything except YAML frontmatter and typed links) is stored in the property content
  • Links to notes that do not exist yet are created without any types.
  • The obsidian url is added as property obsidian_url

Supported output formats

Neo4j

Streams the input into the currently active Neo4j database. WARNING: This clears all the data in your database by default! Run with --retaindb if this is not desired.

  1. Start the database in Neo4j you want to use
  2. Run using smdc --input "folder with notes" --password "neo4j database password". This can take a couple of minutes for large vaults.

CYPHER

Converts the input into a single .cypher file (default: out.cypher) with statements that create nodes and relationships in Neo4j. This can be loaded in Neo4j desktop as follows:

  1. Create a new database
  2. Manage your database (three dots, manage)
    1. Plugins -> Install APOC
    2. Settings: Add line apoc.import.file.enabled=true
    3. Open project folder, then copy out.cypher to the import folder within the project folder.
  3. Start database
  4. Open Neo4j browser
    1. Run CALL apoc.cypher.runFile('out.cypher')

Importing with Cypher can take quite a while (multiple minutes). I'll look into alternative methods if people are interested.

Neo4j Bloom

A use case for this converter is to visualize your obsidian.md graph in Neo4j bloom. Neo4j bloom is very powerful graph visualization software. Compared to the Obsidian graph view, it allows

  • Coloring and styling notes with different tags
  • Coloring and styling relationships with different types
  • Selective expansion
  • A hierarchical view
  • Very strong querying capabilities

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

semantic-markdown-converter-0.2.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

semantic_markdown_converter-0.2.2-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file semantic-markdown-converter-0.2.2.tar.gz.

File metadata

  • Download URL: semantic-markdown-converter-0.2.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5

File hashes

Hashes for semantic-markdown-converter-0.2.2.tar.gz
Algorithm Hash digest
SHA256 9ef37ab688efc799cedbb8a9e496130879571a6e023bcad008a2dfce325e1513
MD5 8413c77cf5f722da2ed308cbc6129d50
BLAKE2b-256 7ba6478e72e2aa8a4b894626956dab477d30df5bc86ece6178437ebf1b2a411e

See more details on using hashes here.

File details

Details for the file semantic_markdown_converter-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: semantic_markdown_converter-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5

File hashes

Hashes for semantic_markdown_converter-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6cf1ace4a3a581057524c7f566f18838edd9bffe4893fc4c7a3def0a855d116a
MD5 37c69567e40e99083f0d2dab4505a702
BLAKE2b-256 1a9d673f851996c7677dfc37f44481b4610ffc0c76a7203417cd0c799cb3cf2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page