Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative links are badly converted to markdown (only works correctly for {:file:* heading:}) #1491

Open
2 tasks done
TymekBrunka opened this issue Jun 28, 2024 · 2 comments
Open
2 tasks done
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@TymekBrunka
Copy link

TymekBrunka commented Jun 28, 2024

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

NVIM v0.10.0 (i have updated today and issue still exists (not big surprise))

Neorg setup

{
    "vhyrro/luarocks.nvim",
    priority = 1000, -- We'd like this plugin to load first out of the rest
    config = true,   -- This automatically runs `require("luarocks-nvim").setup()`
},
-- {
--     "champignoom/norg-pandoc",
--     branch = "neorg-plugin",
--     config = true,
-- },
{
    "nvim-neorg/neorg",
    dependencies = { "luarocks.nvim",
        { "nvim-lua/plenary.nvim" },
        { "laher/neorg-exec" },
        { "nvim-neorg/neorg-telescope" }
    },
    config = function()
        require("neorg").setup {
            load = {
                ["core.defaults"] = {},
                ["core.export"] = {},           -- export to md
                ["core.promo"] = {},            -- manage indent
                ["core.concealer"] = {
                    config = {                  -- We added a `config` table!
                        icon_preset = "varied", -- And we set our option here.
                    },
                },
                ["core.tangle"] = {},          -- Add tangling support
                ["core.esupports.metagen"] = { -- Automatically sync document meta
                    config = {
                        type = "auto",
                    }
                },
                ["core.dirman"] = {
                    config = {
                        workspaces = {
                            notes = "~/notes",
                        },
                        default_workspace = "notes",
                    },
                },
                ["core.presenter"] = {
                    config = {
                        zen_mode = "zen-mode",
                    },
                },
                --integrating?
                ["core.completion"] = {
                    config = {
                        engine = "nvim-cmp",
                    }
                },
                ["core.integrations.nvim-cmp"] = {},
                -- ["external.pandoc"] = {},
                ["core.integrations.telescope"] = {},
                ["external.exec"] = {
                    config = {
                        default_metadata = {
                            out = "virtual"
                        },
                        lang_cmds = {
                            cpp = {
                                cmd = "g++ ${0} && ./a.out && rm ./a.out",
                                type = "compiled",
                                main_wrap = [[
                                #include <iostream>
                                int main() {
                                    ${1}
                                }
                                ]],
                            },
                        }
                    }
                },
            },
        }

        vim.wo.foldlevel = 99
        vim.wo.conceallevel = 2
    end,
},

Actual behavior

so i try both ways i know how to insert link to relative path (and first and second one point to heading)

** {:$/syntax:** hi}[neorg syntax]
** {:syntax:** hi}[neorg syntax]
** {:syntax:}[neorg syntax]

(file exists, works fine in neorg)

but when converting to markdown with example command:
:Neorg export directory /home/tymek/notes markdown ./norg
and opening ./norg/index.norg
the links look like this

## [neorg syntax]($/syntax.md#hi)


## [neorg syntax](syntax.md#hi)


## [neorg syntax](#syntaxmd)

Expected behavior

idk, maybe working links

Steps to reproduce

what should i type here?

Potentially conflicting plugins

none, i guess, obsidian.nvim only works for .md files

Other information

also sometimes when opening link in .norg file to .norg file it opens that other .norg file with filetype=

Help (can i help with code)

No

Implementation help

No response

@TymekBrunka TymekBrunka added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Jun 28, 2024
@TymekBrunka TymekBrunka changed the title Relative links are badly converted to markdowm Relative links are badly converted to markdown (only works correctly for {:file:* heading:}) Jun 28, 2024
@benlubas
Copy link
Contributor

That markdown exporter is, as you've noticed, not that great. There are other ways to export to markdown that should yield better results. Those methods are described here in Pysan's tutorial, and I'd like to emphasize that each method has it's flaws currently.

Currently there's work being done on a new parser for norg, after that's done, proper markdown import/export via pandoc should come not too long after 🤞

@TymekBrunka
Copy link
Author

TymekBrunka commented Jul 1, 2024

good, i will stick to {:file:*header} syntax as it exports it correctly and hope that neorg exporter will get better.

thank you for info

(i will leave this issue open)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
Development

No branches or pull requests

2 participants