diff --git a/.wordpress-org/assets/banner-772x250.jpg b/.wordpress-org/assets/banner-772x250.jpg new file mode 100644 index 0000000..0d88006 Binary files /dev/null and b/.wordpress-org/assets/banner-772x250.jpg differ diff --git a/.wordpress-org/assets/icon-128x128.jpg b/.wordpress-org/assets/icon-128x128.jpg new file mode 100644 index 0000000..9847ce7 Binary files /dev/null and b/.wordpress-org/assets/icon-128x128.jpg differ diff --git a/.wordpress-org/assets/screenshot-1.jpg b/.wordpress-org/assets/screenshot-1.jpg new file mode 100644 index 0000000..7c8d551 Binary files /dev/null and b/.wordpress-org/assets/screenshot-1.jpg differ diff --git a/.wordpress-org/citations-tools.php b/.wordpress-org/citations-tools.php new file mode 100644 index 0000000..cb8063b --- /dev/null +++ b/.wordpress-org/citations-tools.php @@ -0,0 +1,169 @@ + null + ), + $atts + ) + ); + + $link = ''.$content.''; + + return $link; +} + +# doi resolver +add_shortcode('ctdoiresolve', 'ctdoiresolve'); + + function ctdoiresolve ($atts, $content = null) { + + extract( + shortcode_atts( + array( + 'code' => null, + 'arxiv' => null, + 'pdfurl' => null, + 'archiveurl' => null + ), + $atts + ) + ); + + $fullCitation = null; + $getfile = 'https://search.crossref.org/dois?sort=score&page=1&rows=1&q='.$code; + $jsondata = file_get_contents($getfile); + $array = json_decode($jsondata,true); + $item=$array[0]; + $doi = $item['doi']; + $coins = $item['coins']; + $fullCitation =$item['fullCitation']; + + $citation = '
'.$fullCitation.' doi:'.$code.''; + + if ( $arxiv <> null ) + {$citation = $citation.' (arXiv)';} + else + {$citation = $citation;} + + if ( $pdfurl <> null ) + {$citation = $citation.' (pdf)';} + else + {$citation = $citation;} + + if ( $archiveurl <> null ) + {$citation = $citation.' (archive.org)';} + else + {$citation = $citation;} + + $results = $citation.'
'; + + return $results; +} + +# paperdata +add_shortcode('paperdata', 'paperdata'); + + function paperdata ($atts, $content = null) { + + extract( + shortcode_atts( + array( + 'auth' => null, + 'year' => null, + 'title' => null, + 'journal' => null, + 'vol' => null, + 'issue' => null, + 'pages' => null, + 'code' => null, + 'arxiv' => null, + 'pdfurl' => null, + 'archiveurl' => null + ), + $atts + ) + ); + + $fullcitation = null; + + if ( $auth <> null ) + {$fullcitation = $fullcitation.$auth;} + else + {$fullcitation = $fullcitation;} + + if ( $year <> null ) + {$fullcitation = $fullcitation.', '.$year;} + else + {$fullcitation = $fullcitation;} + + if ( $title <> null ) + {$fullcitation = $fullcitation.', '.$title;} + else + {$fullcitation = $fullcitation;} + + if ( $journal <> null ) + {$fullcitation = $fullcitation.', '.$journal.'';} + else + {$fullcitation = $fullcitation;} + + if ( $vol <> null ) + {$fullcitation = $fullcitation.', vol.'.$vol;} + else + {$fullcitation = $fullcitation;} + + if ( $issue <> null ) + {$fullcitation = $fullcitation.', n.'.$issue;} + else + {$fullcitation = $fullcitation;} + + if ( $pages <> null ) + {$fullcitation = $fullcitation.', pp. '.$pages;} + else + {$fullcitation = $fullcitation;} + + $citation = '
'.$fullcitation; + + if ( $code <> null ) + {$citation = $citation.' doi:'.$code.'';} + else + {$citation = $citation;} + + if ( $arxiv <> null ) + {$citation = $citation.' (arXiv)';} + else + {$citation = $citation;} + + if ( $pdfurl <> null ) + {$citation = $citation.' (pdf)';} + else + {$citation = $citation;} + + if ( $archiveurl <> null ) + {$citation = $citation.' (archive.org)';} + else + {$citation = $citation;} + + $results = $citation.'
'; + + return $results; + +} +/* ------------------------------------------------------ */ diff --git a/.wordpress-org/readme.txt b/.wordpress-org/readme.txt new file mode 100644 index 0000000..4ccd103 --- /dev/null +++ b/.wordpress-org/readme.txt @@ -0,0 +1,83 @@ +=== Citations tools === +Contributors: ulaulaman +Tags: doi, citations, research, blog, blogging, research blogging, arXiv +Requires at least: 4.8.5 +Tested up to: 4.9.5 +Requires PHP: 7.0.18 +Stable tag: trunk +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html + +Developer version of the homonym plugin on Worpdress repository +Some tools for scientific and editorial bloggers. + +== Description == +The plugin add a shortcode in order to link a paper using its doi code. You can also use an other shortcode to resolve doi code and publish a full citation apa formatted. It is also a shortcode for manual citations. + +## Link doi + +Using the standard for doi link, the plugin introduce a shortcode in order to create a link to a paper provided by doi. +**How to use the shortcode**: + +[ctdoi code="..."]Title of the paper[/doi] + +## Doi resolver + +The plugin send the doi code to [Crossref Metadata Search](https://search.crossref.org/), get the information and publish a full citation in apa standard with the shortcode [ctdoiresolve ...]. +**How to use the shortcode**: + +[ctdoiresolve code="..."] + +There are also three optional parameters: + +[ctdoiresolve code="..." arxiv="..."] + +if the paper has an arXiv version + +[ctdoiresolve code="..." pdfurl="..."] + +if the paper has a free pdf version + +[ctdoiresolve code="..." archiveurl="..."] + +if the paper has a free version on [archive.org](https://archive.org/) + +## Manual citations + +There's also a shortcode for manual citations, [paperdata ...]. You can use it with the following syntax: + +[paperdata auth="author/s name/s" year="..." title="..." journal="..." vol="..." issue="..." pages="..." code="..."] + +You can also use the arxiv, pdfurl, archiveurl parameters. + +## Styling + +You can style citations adding in your css theme the class "paperdata". + +## External service + +**Digital Object Identifier**, or *DOI*, is a persistent identifier used to uniquely identify objects, standardized by the **International Organization for Standardization** (*ISO*). DOIs are mainly used to identify academic, professional, and government information, such as journal articles, research reports and data sets, official publications. + +***Citations tools*** uses the [CrossRef Metadata API](http://search.crossref.org/help/api) to retrieve complete publication information using the doi code as a search query. CrossRef is a part of the [doi system](https://dx.doi.org/). + +== Screenshots == +1. The doi resolver: the shortcode (up) and the results (down) + +== Installation == +1. Extract the citations-tools.zip file and upload its contents to the /wp-content/plugins/ directory. Alternately, you can install directly from the Plugin directory within your WordPress Install. +2. Activate the plugin through the "Plugins" menu in WordPress. +3. Use the shortcode into your posts or pages. + +== Changelog == +* 0.3.2 add compatibility with Wordpress 4.9.5 +* 0.3.1 fix error in html script in [ctdoi] shortcode +* 0.3 add shortcode for manual citations +* 0.2.6.1 update readme.txt +* 0.2.6 add archive.org link in doi resolver as shortcode's parameter +* 0.2.5 fix error code +* 0.2.4 changed functions names +* 0.2.3 add pdf link in doi resolver as shortcode's parameter +* 0.2.2 add arXiv link in doi resolver as shortcode's parameter +* 0.2.1 add doi link in doi resolver +* 0.2 add shortcode to resolve doi using code +* 0.1 shortcode for doi link diff --git a/.github/workflows/deploy.yml b/workflows/deploy.yml similarity index 100% rename from .github/workflows/deploy.yml rename to workflows/deploy.yml