This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
/* | |
# Hypothes.idian a templater script for retrieving annotations from Hypothes.is | |
Dev: RoamHacker https://twitter.com/roamhacker | |
# Prerequisites: | |
+ Templater plugin by https://github.com/SilentVoid13/Templater | |
+ Free Hypothes.is developer token from: https://hypothes.is/account/developer | |
+ This script will prompt you for his token and save it to a file called "hypothesis config.md" | |
+ This file store your configuration and can be located any where in your vault. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Annotation Template | |
* | |
*/ | |
$mf2_post = new MF2_Post( get_the_ID() ); | |
$cite = $mf2_post->fetch(); | |
if ( ! $cite ) { | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( "wp_enqueue_scripts", "hypothesis_annotation_enqueue_scripts_styles" ); | |
function hypothesis_annotation_enqueue_scripts_styles() { | |
wp_enqueue_style("hlib.css", "https://jonudell.info/hlib/hlib.css"); | |
wp_enqueue_script("hlib.bundle.js", "https://jonudell.info/hlib/hlib.bundle.js"); | |
wp_enqueue_script("showdown.js", "https://jonudell.info/hlib/showdown.js"); | |
} | |
function hypothesis_annotation($args) { | |
$id = $args["id"]; |