Publishing tool for MATLAB® live script to WordPress
编者注: This file was selected as MATLAB Central Pick of the Week
This MATLAB® App provides a fast and easy way for users to publish their MATLAB® live scripts as blog posts to their WordPress sites. What the users type in live script is what the users will see in WordPress. The App will:
- Keeps all the styles in the live script as well as outputs such as graphs and tables and convert entire live script into HTML markup and send to WordPress via WordPress JSON API.
- All the images in the live script will be converted to media files and uploaded to WordPress automatically.
- The animation output will be automatically converted into GIF files and uploaded to WordPress automatically.
- All the equations and formulas will be rendered nicely via MathJax in WordPress.
- Users also have the option to let the app upload their original live script as attachment for readers to download or not from their WordPress site.
- Be connected to internet
MathWorks® Products (https://www.mathworks.com)
- Requires MATLAB® release R2020a or newer
- WordPress V4.7 and above with WP JSON API enabled
- Update the setting of permalink to not be plain
- Have JWT Authentication for WP REST API (preferred) or Basic Authentication installed and configured in your WordPress site
- Get wp_publisher.mlapp and convertScript.p in your workspace
2. Add wp_publisher MATLAB® App directory into your MATLAB® path permanently
- Upload live-script-support to your WordPress plugin (/wp-content/plugins)
- Activate Live Script Support plugin:
According to your habits, you can create a folder for all your blog post live scripts, or a folder for all your blog post live scripts for a particular year (e.g. 2021_blog_posts).
Note: If you are not in your blog post folder, please close the publishing tool, go to your blog post folder with live scripts and reopen the App.
- Go to your blog post folder with live scripts
- In MATLAB® Command Window, simply type
wp_publisher
:
- The publishing tool will be opened and lead you to the settings tab, where you can input your WordPress blog site information.
- You also can choose the location to store the output files for your blog post live script
- Choose your installed WordPress API authentication
- Save your settings and your blog information will be saved in your workspace
- Switch to Publish post tab, you will see a dropdown menu to choose the live script you want to post as article to your WordPress blog
- You can check "Allow your readers to download your source Live Script" and your live script will be uploaded to your WordPress media library for users to download
- Once you finish choosing your blog post, click Publish draft button, your live script will be posted to your WordPress as a draft.
- The link to the draft of your post will be displayed in your MATLAB® Command Window (you need to log in your WordPress to see the draft)
- You can preview the post, once you are happy about the post, you can then publish it.
- Go to your blog post folder with live scripts
- In MATLAB® Command Window, simply type
wp_publisher
:- The publishing tool will be opened and lead you to the Publish post tab, you will see a dropdown menu to choose the live script you want to post as article to your WordPress blog
- You can check "Allow your readers to download your source Live Script" and your live script will be uploaded to your WordPress media library for users to download
- Once you finish choosing your blog post, click Publish draft button, your live script will be posted to your WordPress as a draft.
- The link to the draft of your post will be displayed in your MATLAB® Command Window (you need to log in your WordPress to see the draft)
- You can preview the post, once you are happy about the post, you can then publish it.
- If you are not in your blog post folder, please close the publishing tool, go to your blog post folder with live scripts and reopen the App.
- Once you click Publish draft button, the App will create a folder named as your live script to store the information of the article and images from your live script
- To avoid additional formatting by WordPress Editor, please select 'No Character Encoding' value at the bottom of the editor
- You can update your WordPress settings in the App whenever your are using the App
- In your live script of blog post, we suggest you add your article title so the publishing tool will know what's your blog post title. If you did not add title in your live script, the publishing tool will add a placeholder title for your blog post, you can modify it later in your blog draft.
- Once the live script is published to your WordPress site by the App and you want to make some editing on the article, instead updating directly in your WordPress, we'd suggest you edit your article in your MATLAB® live scripts and use the App again to keep content consistent. The App will know the post information from the output folder:
The license is available in the License file within this repository.
Copyright 2021-2024 The MathWorks, Inc.
引用格式
MathWorks Community Team (2024). Publishing tool for MATLAB® live script to WordPress (https://github.com/mathworks/WordPress_Publishing_Tool/releases/tag/v1.2), GitHub. 检索时间: .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!publishing-tool/+wpfunc
版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.2 | See release notes for this release on GitHub: https://github.com/mathworks/WordPress_Publishing_Tool/releases/tag/v1.2 |
||
1.1 | See release notes for this release on GitHub: https://github.com/mathworks/WordPress_Publishing_Tool/releases/tag/v1.1 |
||
1.0 |