Skip to content

Commit

Permalink
feat: format quarto.version
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanouil authored Feb 3, 2024
1 parent c5bde29 commit 670e473
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions _extensions/lua-env/_extension.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
title: lua-env
author: Mickaël Canouil
version: 1.0.0
quarto-required: ">=1.2.0"
version: 1.0.1
quarto-required: ">=1.4.459"
contributes:
shortcodes:
- lua-env-shortcode.lua
Expand Down
2 changes: 1 addition & 1 deletion _extensions/lua-env/lua-env-filter.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--[[
# MIT License
#
# Copyright (c) Mickaël Canouil
# Copyright (c) 2024 Mickaël Canouil
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 6 additions & 2 deletions _extensions/lua-env/lua-env-shortcode.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--[[
# MIT License
#
# Copyright (c) Mickaël Canouil
# Copyright (c) 2024 Mickaël Canouil
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -41,7 +41,11 @@ return {
['lua-env'] = function(args, kwargs, meta)
if #args > 0 then
local var_name = pandoc.utils.stringify(pandoc.Span(args[1]))
return get_value(split(var_name, "."), meta["lua-env"])
if args[1] == "quarto.version" then
return table.concat(get_value(split(var_name, "."), meta["lua-env"]), '.')
else
return get_value(split(var_name, "."), meta["lua-env"])
end
else
return nil
end
Expand Down

0 comments on commit 670e473

Please sign in to comment.