Conversation
Resolves @include(path) directives in argdown code blocks by recursively inlining the referenced vault file's contents before parsing, mirroring the @include syntax and semantics of @argdown/node's IncludePlugin so that argdown source is portable between the argdown-cli and Obsidian. Also supports referencing normal Obsidian notes (.md) as include targets by extracting the contents of fenced ```argdown code blocks, since Obsidian's UI doesn't easily support creating bare .argdown files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves @include(path) directives in argdown code blocks by recursively inlining the referenced vault file's contents before parsing, mirroring the @include syntax and semantics of @argdown/node's IncludePlugin so that argdown source is portable between the argdown-cli and Obsidian.
Also supports referencing normal Obsidian notes (.md) as include targets by extracting the contents of fenced ```argdown code blocks, since Obsidian's UI doesn't easily support creating bare .argdown files.
The main pitfall I see with this approach is that it duplicates @include resolution code that is also present in the argdown CLI. However, to properly share code, we would need to factor the recursive resolution logic into argdown/core. To get this new library, we'd need to update the argdown dependency in this repo, which has a major version change and requires some changes to how GraphViz is handled. I made all of these changes locally and they're in draft at shamgang/argdown#1 and shamgang#1. I've left them draft for now because I'm not sure if that next step is worth the trouble right now.
For context, I made this change because I want to model complex arguments in argdown that have composition - the same sub-claim is used in multiple higher-level arguments.