Comments (8)
@trev-dev can you try this out on the dev branch and see if this is working as expected? If you're using Packer, you'd do the following. You'll need to stipulate an implicit extension in order to get this working, so assuming you're working with markdown files, you'd do:
use({
'jakewvincent/mkdnflow.nvim',
branch = 'dev',
config = function()
require('mkdnflow').setup({
-- ...
links = {
implicit_extension = 'md'
}
-- ...
})
end
})
from mkdnflow.nvim.
This is reasonable! My current thought is to create a links
table that will contain settings for both the link style (currently its own config option) and implicit extension:
require('mkdnflow').setup({
links = {
style = 'markdown',
implicit_extension = 'md'
}
})
I think rather than disabling interpretation of implicit extensions by default, it would be nice for the default behavior to be flexible--if there's no extension, the link is interpreted with an implicit extension... if there is, that's taken to be an explicit extension without issue. I'll try this out right now.
from mkdnflow.nvim.
I guess even if interpretation is flexible, there's the question of whether links should be created with or without extensions by default. That should probably be a config option. I'm not sure what most static site generators expect, but I believe Jekyll at least expects an explicit .md
extension. Which static site generator are you using? Any idea what's most common?
from mkdnflow.nvim.
I'm using Hugo, and the question of how to get its parser to drop the .md had been asked a few times and has gone unanswered. I had considered some other option such as pelican but I wanted to use something closer to GoLang because learning.
from mkdnflow.nvim.
or sorry, I meant any idea which behavior is most common when it comes to static site generators? Do you know if most tend not to expect an extension?
(I almost have this ready for testing, btw)
from mkdnflow.nvim.
or sorry, I meant any idea which behavior is most common when it comes to static site generators? Do you know if most tend not to expect an extension?
(I almost have this ready for testing, btw)
I have only used Pelican & Hugo in terms of static site generators that are not just my fingers and a text editor. I assume (bad!) that the expected behavior is to link to the expected generated route somehow, be it explicitly or via some route generator filter/method/function.
Hugo is interesting in that I may make relative links to content. As such, the extension itself is the only thing standing in my way...and I won't have to double-up on work or give up working links in one place or another.
can you try this out on the dev branch and see if this is working as expected?
Yes!
from mkdnflow.nvim.
[Note for self] Anchors within a link's source are currently only interpreted correctly if the .md extension is explicit. e.g. the following attempts to open a file document.mdanchor.md
instead of opening document.md
and trying to find a heading matching # Anchor
within that document.
[Link name](document#anchor)
from mkdnflow.nvim.
Addressed above comment in commit 0c305cb (currently in dev branch)
from mkdnflow.nvim.
Related Issues (20)
- Feature: Trigger MkdnUpdateNumbering in numbered list after ctrl d <C-d> ctrl t <C-t>
- Bug: Links created from visual selection containing multi-byte characters are not formatted correctly HOT 4
- Bug: Can't find external file HOT 1
- neovim 0.9.4: Invalid 'event': 'BufEnter, BufWinEnter' HOT 3
- Error disabling bib module HOT 1
- Bug: `:MkdnCreateLink` doesn't work on a visual selection
- Following links does not work outside of the root_tell file HOT 3
- Error with the default "cmp" module in a fresh installation. HOT 3
- Bug: Compatibility module throws error if 'modules' key not in user config HOT 3
- Bug: When jumping to next md-style link, links to URLs containing parentheses are skipped over HOT 2
- Bug: Commit f1e968c broke link following for when you have 2 links on one line HOT 5
- Question: Change `MkdnFollowLink` to not create links
- Bug: Links to external files not working
- Any Mkdn command ends with "Error executing Lua callback:" HOT 2
- Bib-file not found (not on default path, not in root directory) HOT 1
- Relative link does not open respective to the current file
- many problems in cmp autocompletion HOT 1
- newListItem Fails for Ordered List on First Line of File HOT 1
- Incorrect <tab> behaviour in table HOT 3
- yank as anchor link relative to `root_tell`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkdnflow.nvim.