Changeset 3088010
- Timestamp:
- 05/17/2024 12:16:50 AM (3 months ago)
- Location:
- merpress/trunk
- Files:
-
- 32 added
- 3 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
merpress/trunk/README.txt
r2839602 r3088010 3 3 Tags: posts, mermaid, diagrams, gantt, sequence, class, erd, entity-relationship, actor, flowchart, block 4 4 Requires at least: 5.0 5 Tested up to: 6. 16 Stable tag: 1. 0.95 Tested up to: 6. 6 Stable tag: 1. 7 7 Requires PHP: 7.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html 10 10 11 Merpress lets you create diagrams and visualizations using <a href="https://mermaid -js.github.io/mermaid/">MermaidJS</a>.11 Merpress lets you create diagrams and visualizations using <a href="https://mermaid/">MermaidJS</a>. 12 12 13 13 == Description == 14 14 15 Merpress lets you create diagrams and visualizations using [MermaidJS](https://mermaid -js.github.io/mermaid/).15 Merpress lets you create diagrams and visualizations using [MermaidJS](https://mermaid/). 16 16 17 17 == Frequently Asked Questions == … … 19 19 = Can you make diagrams with this? = 20 20 21 Yes. Checkout [MermaidJS](https://mermaid -js.github.io/mermaid/#/n00b-syntaxReference) for syntax reference and example diagrams.21 Yes. Checkout [MermaidJS](https://mermaid) for syntax reference and example diagrams. 22 22 23 23 == Screenshots == … … 31 31 == Changelog == 32 32 33 = 1.0.9 = 34 * Update mermaid to 9.3.0. 33 = 1.1.0-e = 34 * Update mermaid to 10.9.1. 35 * Adds *_beta_* feature to store PNG of diagram. Currently broken in Firefox. 35 36 36 37 == Upgrade Notice == 37 38 38 = 1. 0.9=39 M ermaid update (9.3.0)39 = 1. = 40 M -
merpress/trunk/merpress.php
r2839602 r3088010 1 1 <?php 2 3 2 /** 4 3 * Plugin Name: MerPress 5 4 * Plugin URI: https://github.com/n3f/merpress 6 5 * Description: Merpress lets you create diagrams and visualizations using <a href="https://mermaid-js.github.io/mermaid/">MermaidJS</a>. 7 * Version: 1. 0.96 * Version: 1. 8 7 * Requires at least: 4.6 9 8 * … … 11 10 */ 12 11 13 define( 'MERMAID_JS_VERSION', '9.3.0' ); 14 define( 'MERMAID_PLUGIN_VERSION', '1.0.9' ); 12 declare( strict_types=1 ); 13 14 // If this file is called directly, abort. 15 if ( ! defined( 'ABSPATH' ) ) { 16 exit; 17 } 18 19 define( 'MERMAID_PLUGIN_VERSION', '1.1.0-e' ); 20 define( 'MERMAID_JS_VERSION', '10.9.1' ); 15 21 16 22 add_action( 17 23 'init', 18 24 function () { 19 wp_register_script( 'mermaid', plugin_dir_url( __FILE__ ) . 'assets/mermaid.min.js', [], MERMAID_JS_VERSION, true ); 25 $mermaid_config = [ 26 'mermaid_version' => MERMAID_JS_VERSION, 27 'mermaid_url' => plugin_dir_url( __FILE__ ) . 'public/mermaid.min.js', 28 ]; 20 29 21 30 wp_register_script( 22 'mermaid-init', 23 plugin_dir_url( __FILE__ ) . 'assets/mermaid-init.js', 24 [ 25 'jquery', 26 'mermaid', 27 ], 28 MERMAID_PLUGIN_VERSION, 29 true 30 ); 31 32 wp_register_script( 33 'mermaid-gutenberg-block', 34 plugin_dir_url( __FILE__ ) . 'assets/mermaid-block.js', 35 [ 'mermaid' ], 36 MERMAID_PLUGIN_VERSION, 37 true 31 'mermaid', 32 $mermaid_config['mermaid_url'], 33 [], 34 $mermaid_config['mermaid_version'], 35 false 38 36 ); 39 37 40 38 wp_register_style( 41 39 'mermaid-gutenberg-block', 42 plugin_dir_url( __FILE__ ) . ' assets/mermaid-block.css',43 [ 'wp-edit-blocks'],40 plugin_dir_url( __FILE__ ) . '/mermaid-block.css', 41 [], 44 42 MERMAID_PLUGIN_VERSION 45 43 ); 46 44 47 register_block_type( 48 'merpress/mermaidjs', 49 [ 50 'editor_script' => 'mermaid-gutenberg-block', 51 'editor_style' => 'mermaid-gutenberg-block', 52 ] 53 ); 54 55 $enqueue_mermaid = function () { 56 wp_enqueue_script( 'mermaid-init' ); 57 }; 58 59 add_action( 'loop_end', $enqueue_mermaid ); 60 add_action( 'loop_no_results', $enqueue_mermaid ); 45 // Register the mermaidjs block. 46 $result = register_block_type( __DIR__ . '/build' ); 47 if ( false === $result ) { 48 error_log( 'Failed to register block type' ); 49 } 61 50 } 62 51 );
Note: See TracChangeset
for help on using the changeset viewer.