zotcard icon indicating copy to clipboard operation
zotcard copied to clipboard

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

Open AnZhiJJ opened this issue 1 year ago • 6 comments

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

AnZhiJJ avatar Sep 21 '23 12:09 AnZhiJJ

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

AnZhiJJ avatar Sep 21 '23 12:09 AnZhiJJ

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

Taurusxw avatar Sep 22 '23 08:09 Taurusxw

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

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

AnZhiJJ avatar Sep 22 '23 08:09 AnZhiJJ

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

MSCisbest avatar Sep 23 '23 02:09 MSCisbest

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

018 avatar Oct 19 '23 15:10 018

很好用!!谢谢

niyuxinn avatar Jan 15 '24 02:01 niyuxinn