Kurama622 / profile.nvim

Your Personal Homepage in Neovim
27 stars 1 forks source link

Allow ascii art instead of image #3

Closed T0nd0Tara closed 2 days ago

T0nd0Tara commented 2 days ago

For the people who don't want to switch into a different terminal that support imagery. I think it would be a great feature to allow ascii art instead of the image

Kurama622 commented 2 days ago

freecompress-profile-ascii

This is permissible, and one configuration method is as follows:

  {
    "Kurama622/profile.nvim",
    config = function()
      local comp = require("profile.components")
      require("profile").setup({
        avatar_opts = {
          force_blank = false,
        },
        user = "Kurama622",
        git_contributions = {
          start_week = 1,
          end_week = 53,
          empty_char = " ",
          full_char = { "", "󰧞", "", "", "" },
          fake_contributions = nil,
        },
        hide = {
          statusline = true,
          tabline = true,
        },
        format = function()
          local header = {
            [[                                                                       ]],
            [[                                                                       ]],
            [[                                                                       ]],
            [[                                                                       ]],
            [[                                                                       ]],
            [[                                                                       ]],
            [[                                                                     ]],
            [[       ████ ██████           █████      ██                     ]],
            [[      ███████████             █████                             ]],
            [[      █████████ ███████████████████ ███   ███████████   ]],
            [[     █████████  ███    █████████████ █████ ██████████████   ]],
            [[    █████████ ██████████ █████████ █████ █████ ████ █████   ]],
            [[  ███████████ ███    ███ █████████ █████ █████ ████ █████  ]],
            [[ ██████  █████████████████████ ████ █████ █████ ████ ██████ ]],
            [[                                                                       ]],
          }
          for _, line in ipairs(header) do
            comp:text_component_render({ comp:text_component(line, "center", "ProfileBlue") })
          end

          comp:separator_render()
          comp:card_component_render({
            type = "table",
            content = function()
              return {
                {
                  title = "kurama622/llm.nvim",
                  description = [[LLM Neovim Plugin: Effortless Natural
Language Generation with LLM's API]],
                },
                {
                  title = "kurama622/profile.nvim",
                  description = [[A Neovim plugin: Your Personal Homepage]],
                },
              }
            end,
            hl = {
              border = "ProfileYellow",
              text = "ProfileYellow",
            },
          })
          comp:separator_render()
          comp:git_contributions_render("ProfileGreen")
        end,
      })
      vim.api.nvim_set_keymap("n", "<leader>p", "<cmd>Profile<cr>", { silent = true })
    end,
  },
}