# Chinese README

# authordown

English README: README.md

鍦ㄧ嚎搴旂敤锛歔鎵撳紑搴旂敤](https://zh1peng-authordown.share.connect.posit.cloud/)

authordown 鏄竴涓敤浜庣鐞嗕綔鑰呬俊鎭苟鐢熸垚璁烘枃鍓嶇疆淇℃伅锛堝挨鍏舵槸澶у瀷浣滆€呭垪琛ㄩ鍚嶉〉锛夌殑 R 鍖呫€?

## 鍔熻兘

- 棰樺悕椤电敓鎴愶紙鏈烘瀯缂栧彿銆侀€氳浣滆€呮爣璁帮級
- 浣滆€呬俊鎭牎楠屼笌鏍囧噯鍖?
- 鑷磋阿銆佸埄鐩婂啿绐佷笌浣滆€呰础鐚儴鍒?
- 鏍囧噯妯℃澘锛岀粺涓€浣滆€呮暟鎹綍鍏?
- Shiny 搴旂敤鐢ㄤ簬蹇€熼瑙堜笌瀵煎嚭

## 瀹夎

CRAN锛堝彂甯冨悗锛夛細

    install.packages("authordown")

GitHub锛?

    # install.packages("devtools")
    devtools::install_github("zh1peng/authordown")

## 绔埌绔祦绋嬶紙绂荤嚎鍙敤锛?

### 1) 浠庡唴缃ā鏉垮紑濮?

    library(authordown)

    # 使用临时文件模板
    template_path <- authordown_template()
    authors <- authordown_read_local(template_path)

### 2) 鐢熸垚棰樺悕椤碉紙鏄剧ず瀛︿綅锛?

    title_page <- generate_title_page(
      data = authors,
      title = "Example Paper",
      style = "default",
      show_degree = TRUE
    )
    cat(title_page)

### 3) 鐢熸垚鍏朵粬閮ㄥ垎

    ack <- generate_acknowledgement(authors, style = "paragraph")
    coi <- generate_conflict(authors, style = "paragraph")
    contrib <- generate_contribution(authors, style = "bullets")

    cat(ack)
    cat("\n\n")
    cat(coi)
    cat("\n\n")
    cat(contrib)

### 4) XLSX 杈撳叆

    xlsx_path <- system.file("extdata", "authordown_template.xlsx", package = "authordown")
    authors_xlsx <- authordown_read_local(xlsx_path)

## 鍦ㄧ嚎琛ㄦ牸鎺ㄨ崘娴佺▼

濡傛灉浣犲湪鍦ㄧ嚎琛ㄦ牸涓淮鎶や綔鑰呬俊鎭紝寤鸿瀵煎嚭鍒版湰鍦板悗鍐嶈鍙栵細

1. 瀵煎嚭涓?CSV 鎴?XLSX锛堜篃鍙?TSV锛?
2. 浣跨敤 `authordown_read_local()` 璇诲彇鏈湴鏂囦欢

鏀寔鏍煎紡锛欳SV銆乀SV銆乆LSX銆?

## 鏈烘瀯淇℃伅锛圓ffiliations锛?

浣跨敤 `Affiliation1`, `Affiliation2`, … `AffiliationN` 鍒楀～鍐欏悓涓€浣滆€呯殑澶氫釜鏈烘瀯銆? 娌℃湁纭笂闄愶紝闇€瑕佸灏戝垪灏辨坊鍔犲灏戝垪銆傞鍚嶉〉浼氭寜棣栨鍑虹幇鐨勯『搴忕紪鍙枫€?

## Shiny 搴旂敤

鍦ㄧ嚎搴旂敤锛歔鎵撳紑搴旂敤](https://zh1peng-authordown.share.connect.posit.cloud/)

    if (interactive()) {
      shiny::runApp(system.file("shiny-app", package = "authordown"))
    }

娴佺▼锛氫笅杞芥ā鏉?鈫?濉啓妯℃澘 鈫?涓婁紶 鈫?棰勮瑙ｆ瀽缁撴灉 鈫?鐢熸垚杈撳嚭骞跺鍒?瀵煎嚭銆?

## 娓叉煋 HTML 浠ヤ究澶嶅埗绮樿创

濡傛灉闇€瑕佹覆鏌撳悗鐨?HTML 渚夸簬绮樿创鍒版姇绋跨郴缁燂紝鍙娇鐢細

    if (requireNamespace("rmarkdown", quietly = TRUE) && rmarkdown::pandoc_available()) {
      template_path <- authordown_template()
      authors <- authordown_read_local(template_path)

      html_path <- render_section_html(
        section_title = "Conflict of Interest",
        content_function = generate_conflict,
        data = authors,
        style = "paragraph"
      )
      # utils::browseURL(html_path)
    }

## 甯歌闂

- 鈥淢issing required column鈥?琛ㄧず鏂囦欢缂哄皯蹇呭～鍒楋紙濡?`FirstName`銆乣LastName`锛夈€?
- 鈥淐orresponding authors must have an Email鈥?琛ㄧず瀛樺湪 `Corresponding = TRUE` 浣?`Email` 涓虹┖銆?
- 鈥淥RCID values must use the 0000-0000-0000-0000 format鈥?琛ㄧず ORCID 鏍煎紡閿欒銆?

## 璁稿彲

AGPL-3