018 / zotcard

ZotCard is a plug-in for Zotero, which is a card note-taking enhancement tool. It provides card templates (such as concept card, character card, golden sentence card, etc., by default, you can customize other card templates), so you can write cards quickly. In addition, it helps you sort cards and standardize card formats.
MIT License
536 stars 27 forks source link

使用zotero7版本可以考虑使用zotero-better-notes插件中的模板来暂时替代,功能同效。等zotcard插件可以适配zotero7可以一步迁移。 #40

Open AnZhiJJ opened 1 year ago

AnZhiJJ commented 1 year ago

基于 zotero 7.0.0-beta40 改进的文学期刊阅读笔记模板(需要使用 zotero style、zotero-better-notes 和 easyscholar 插件) 使用zotero7版本可以考虑使用zotero-better-notes插件中的模板来暂时替代,功能同效。

AnZhiJJ commented 1 year ago

I. Examples:

image

Note: Only for zotero7.

II. Template Code

# This template is specifically for importing/sharing, using better 
# notes 'import from clipboard': copy the content and
# goto Zotero menu bar, click Edit->New Template from Clipboard.  
# Do not copy-paste this to better notes template editor directly.
name: "[Item]read notes template"
content: |-
  <h1 style="text-align: center">${topItem.getField('title')}</h1><hr/>
  <h2 style="color: #1B5E20; background-color:#F1F8E9;">💡 Meta Data</h2>

  <table>
      <tr>
          <th style="background-color:#dbeedd;">
              <p style="text-align: left;">Title</p>
          </th>
          <td style="background-color:#dbeedd;">
              ${topItem.getField('title')}
          </td>
      </tr>
      <tr>
          <th style="background-color:#f3faf4;">
              <p style="text-align: left">Journal</p>
          </th>
          <td style="background-color:#f3faf4;">
              ${topItem.getField('publicationTitle')}
          </td>
      </tr>
      <tr>
          <th style="background-color:#dbeedd;">
              <p style="text-align: left">Authors</p>
          </th>
          <td style="background-color:#dbeedd;">
              ${topItem.getCreators().map((v)=>v.firstName+" "+v.lastName).join("; ")}
          </td>
      </tr>
      <tr>
          <th style="background-color:#f3faf4;">
              <p style="text-align: left">Pub. date</p>
          </th>
          <td style="background-color:#f3faf4;">
              ${topItem.getField('date')}
          </td>
      </tr>
      <tr>
          <th style="background-color:#dbeedd;">
              <p style="text-align: left">期刊标签</p>
          </th>
          <td style="background-color:#dbeedd;">
              ${(() => {
                let tags = Zotero.ZoteroStyle.data.ztoolkit.ItemTree.fieldHooks.globalCache.getFieldHooks.PublicationTags(
                  "", true, true, topItem, undefined);
                let out = "";
            if (!tags){
                  out += `<span></span>`;
            }else{
                const jsonStartIndex = tags.indexOf('{');
                if (jsonStartIndex !== -1) {
                  tags = tags.slice(jsonStartIndex);
                }
                let regex = /"(sci|sciif)":"([^"]+)"/g;
                let matches = tags.match(regex);

                const keyValuePairs = JSON.parse(tags);
                const colors = ["#ff6666", "#ffd400", "#5fb236", "#2ea8e5", "#a28ae5"];

                for (const key in keyValuePairs) {
                  if (key === "ssci") {
                      out += `<span style="background-color: ${colors[0]}; margin-right: 20px; padding:5px">SSCI ${keyValuePairs[key]}</span>`;
                  }
                  if (key === "sci") {
                      out += `<span style="background-color: ${colors[1]}; margin-right: 20px; padding:5px">SCI ${keyValuePairs[key]}</span>`;
                  }
                  if (key === "sciwarn") {
                        out += `<span style="background-color: ${colors[4]}; margin-right: 20px; padding:10px"> 🚫</span>`;
                  }
                }
            }
                return out;
              })()}
          </td>
      </tr>
      <tr>
          <th style="background-color:#f3faf4;">
              <p style="text-align: left">DOI</p>
          </th>
          <td style="background-color:#f3faf4;">
              <a href="https://doi.org/${topItem.getField('DOI')}">${topItem.getField('DOI')}</a>
          </td>
      </tr>
      <tr>
          <th style="background-color:#dbeedd;">
              <p style="text-align: left">附件</p>
          </th>
          <td style="background-color:#dbeedd;">
              <a href="zotero://open-pdf/0_${Zotero.Items.get(topItem.getAttachments())[0].key}">
                  ${Zotero.Items.get(topItem.getAttachments())[0].getFilename()}
              </a>
          </td>
      </tr>
  </table>

  <h2 style="color:  #E65100; background-color:  #FFF8E1;">📜 研究背景 & 基础 & 目的</h2>
  <hr/>
  <p></p>

  <h2 style="color:#2E7D32; background-color:    #F1F8E9;">&#x1F4CA 研究内容</h2>
  <hr/>
  <p></p>

  <h2 style="color:#4A148C; background-color:    #F5F5F5;">🚩 研究结论</h2>
  <hr/>
  <p></p>

  <h2 style="color: #006064; background-color:   #E0F7FA;">📌 感想 & 疑问</h2>
  <hr/>
  <p></p>

  <h2 style="color:#1565C0; background-color:   #E1F5FE;">🔬 理论推导</h2>
  <hr/>
  <p></p>

III. Methods of use:

image image

Taurusxw commented 1 year ago

zotero7版本,导入显示 the copied template is invalid

AnZhiJJ commented 1 year ago

zotero7版本,导入显示 the copied template is invalid

经测试,模板格式出了问题,最新代码已更正。

MSCisbest commented 1 year ago

需要的是读卡功能,better notes没有!!

018 commented 1 year ago

已经在适配了,可以加我V(lyb018),会在群里发布抢先版。

niyuxinn commented 10 months ago

很好用!!谢谢