|
10 | 10 | # 6. 基于配置和输入文件生成 plot.R
|
11 | 11 | #
|
12 | 12 | # ./hisub.R examples/helloworld.R test_hello
|
13 |
| -VERSION <- 0.2 |
| 13 | +VERSION <- 0.3 |
14 | 14 |
|
15 | 15 | TEMPLATE <- '# @hiplot start
|
16 | 16 | # @appname helloworld
|
| 17 | +# @alias An-Example |
17 | 18 | # @apptitle
|
18 | 19 | # Hiplot Hello World
|
19 | 20 | # Hiplot 示例插件
|
@@ -157,6 +158,9 @@ parse_tag_header <- function(x) sub("# *@[^ ]+ +", "", x[1])
|
157 | 158 | parse_tag_appname <- function(x) {
|
158 | 159 | list(type = "appname", value = parse_tag_value(x))
|
159 | 160 | }
|
| 161 | +parse_tag_alias <- function(x) { |
| 162 | + list(type = "alias", value = parse_tag_header(x)) |
| 163 | +} |
160 | 164 | parse_tag_apptitle <- function(x) {
|
161 | 165 | list(
|
162 | 166 | type = "apptitle",
|
@@ -331,6 +335,7 @@ parse_tag <- function(x, name) {
|
331 | 335 | switch(
|
332 | 336 | name,
|
333 | 337 | appname = parse_tag_appname(x),
|
| 338 | + alias = parse_tag_alias(x), |
334 | 339 | apptitle = parse_tag_apptitle(x),
|
335 | 340 | target = parse_tag_target(x),
|
336 | 341 | tag = parse_tag_tag(x),
|
@@ -527,6 +532,7 @@ a$params <- collect_params(a)
|
527 | 532 | # Metadata for the plugin
|
528 | 533 | json_meta <- list(
|
529 | 534 | name = list(zh_cn = a$apptitle$value$zh, en = a$apptitle$value$en),
|
| 535 | + alias = if (is.null(a$alias$value)) list(a$appname$value) else list(a$alias$value), |
530 | 536 | intro = list(zh_cn = a$description$value$zh, en = a$description$value$en),
|
531 | 537 | src = "",
|
532 | 538 | href = paste0("/", a$target$value, "/", a$appname$value),
|
|
0 commit comments