|
26 | 26 | local utils = require(quarto.utils.resolve_path('_modules/utils.lua'):gsub('%.lua$', '')) |
27 | 27 | local git = require(quarto.utils.resolve_path('_modules/git.lua'):gsub('%.lua$', '')) |
28 | 28 |
|
| 29 | +--- Flag to track if superseded warning has been shown |
| 30 | +--- @type boolean |
| 31 | +local superseded_warning_shown = false |
| 32 | + |
29 | 33 | --- Flag to track if deprecation warning has been shown |
30 | 34 | --- @type boolean |
31 | 35 | local deprecation_warning_shown = false |
@@ -70,12 +74,28 @@ local function get_metadata_value(meta, key) |
70 | 74 | return nil |
71 | 75 | end |
72 | 76 |
|
| 77 | +--- Show superseded extension warning once |
| 78 | +--- This function displays a warning message informing users that this extension |
| 79 | +--- has been superseded by the Git Link extension |
| 80 | +local function show_superseded_warning() |
| 81 | + if not superseded_warning_shown then |
| 82 | + quarto.log.warning( |
| 83 | + 'The "GitHub" extension has been superseded by the "Git Link" extension. ' .. |
| 84 | + 'Please update your extension following the instructions at: ' .. |
| 85 | + 'https://github.com/mcanouil/quarto-gitlink?tab=readme-ov-file#installation' |
| 86 | + ) |
| 87 | + superseded_warning_shown = true |
| 88 | + end |
| 89 | +end |
| 90 | + |
73 | 91 | --- Get repository name from metadata or git remote |
74 | 92 | --- This function extracts the GitHub repository name either from document metadata |
75 | 93 | --- or by querying the git remote origin URL |
76 | 94 | --- @param meta table The document metadata table |
77 | 95 | --- @return table The metadata table (unchanged) |
78 | 96 | local function get_repository(meta) |
| 97 | + show_superseded_warning() |
| 98 | + |
79 | 99 | local meta_github_base_url = get_metadata_value(meta, 'base-url') |
80 | 100 | local meta_github_repository = get_metadata_value(meta, 'repository-name') |
81 | 101 |
|
|
0 commit comments