{"id":212332,"date":"2010-10-20T08:00:00","date_gmt":"2010-10-20T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/wp-readme-parser\/"},"modified":"2025-03-15T02:04:00","modified_gmt":"2025-03-15T02:04:00","slug":"wp-readme-parser","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/wp-readme-parser\/","title":{"rendered":"Plugin README Parser"},"content":{"rendered":"<p>WordPress README files are formatted using a version of the Markdown language. This plugin can be used to convert these to XHTML and display on a post or page of your site.<\/p>\n<p>It\u2019s ideal for plugin developers who wish to add instructions to their own site without having to duplicate effort.<\/p>\n<p>Key features include\u2026<\/p>\n<ul>\n<li>Convert your markdown README to XHTML and display in any post or page<\/li>\n<li>Use shortcodes or a direct PHP function call<\/li>\n<li>Responsive output of screenshots<\/li>\n<li>Output is cached for maximum performance<\/li>\n<li>Links automatically added to author and tag information<\/li>\n<li>Download links added<\/li>\n<li>Ability to specify which sections of the readme to exclude<\/li>\n<li>Can also omit specific lines of text<\/li>\n<li>Extra shortcodes available to display plugin banners and to return specific plugin data (download link, version number, etc)<\/li>\n<li>Google Translation suppressed on code output<\/li>\n<li>And much, much more!<\/li>\n<\/ul>\n<p>Iconography is courtesy of <a href=\"https:\/\/www.freepik.com\/flatart\" rel=\"nofollow ugc\">Flatart<\/a> \u2665\ufe0f<\/p>\n<p>\ud83d\udc49 Please visit the <a href=\"https:\/\/github.com\/morehawes\/plugin-readme-parser\" title=\"Github\" rel=\"nofollow ugc\">Github page<\/a> for the latest code development, planned enhancements and known issues \ud83d\udc48<\/p>\n<h3>Getting Started<\/h3>\n<p>To use, simply add the <code>[readme]<\/code> shortcode to any post or page. An example of use would be\u2026<\/p>\n<pre><code>[readme]WP README Parser[\/readme]\n<\/code><\/pre>\n<p>This would fetch and display the README for this plugin. You can also specify a filename instead.<\/p>\n<p>The first heading, which is the name of the plugin, will be automatically suppressed as it is assumed that you have already added this to your post\/page or are using it as the title.<\/p>\n<h3>Additional Shortcode Parameters<\/h3>\n<p><strong>exclude<\/strong><\/p>\n<p>Each README is divided into a number of sections. If you wish to exclude any from the output then use this parameter to list them.<\/p>\n<p>Before the first section (usually \u201cDescription\u201d) is a number of pieces of \u201cmeta data\u201d about the plugin, including tags, etc. Links are automatically added to these. If, however, you wish to just exclude this data then you should use the section name of \u201cmeta\u201d. Underneath this data is a short description which will remain in this case. If you want to remove this description and the meta data then use the section name of \u201chead\u201d. If you wish to just remove a particular bit of meta data then specify <code>contributors<\/code>, <code>donate<\/code>, <code>tags<\/code>, <code>requires<\/code>, <code>license<\/code>, <code>license uri<\/code>, <code>tested<\/code> or <code>stable<\/code>.<\/p>\n<p>For example\u2026<\/p>\n<pre><code>[readme exclude=\"Meta,Changelog\"]WP README Parser[\/readme]\n<\/code><\/pre>\n<p>This will display the entire README with the exception of the Changelog and the Plugin meta.<\/p>\n<p><strong>include<\/strong><\/p>\n<p>The opposite of <code>exclude<\/code> this allows you to specify ONLY the section that you wish to appear. So, using the example from above\u2026<\/p>\n<pre><code>[readme include=\"Meta,Changelog\"]WP README Parser[\/readme]\n<\/code><\/pre>\n<p>This will ONLY show the Meta and Changelog sections of the README file.<\/p>\n<p>The only difference to the exclude command is that you can\u2019t include just specific sections of the meta. If you believe that this option is required then please get in touch via the forum.<\/p>\n<p><strong>ignore<\/strong><\/p>\n<p>Different from <code>exclude<\/code> this allows to ignore specific lines of the README. Multiple lines should be separated by double commas (to allow single commas to be be used in the actual line to be ignored). For example\u2026<\/p>\n<pre><code>[readme ignore=\"this line,,and this line\"]WP README Parser[\/readme]\n<\/code><\/pre>\n<p><strong>target<\/strong><\/p>\n<p>Any links will have a target of <code>_blank<\/code>. If you wish this to be anything else then change it with this parameter. For example\u2026<\/p>\n<pre><code>[readme target=\"_self\"]WP README Parser[\/readme]\n<\/code><\/pre>\n<p><strong>nofollow<\/strong><\/p>\n<p>If you wish a link to have a nofollow option (i.e. the tag of <code>rel=\"nofollow\"<\/code>) then specify this as \u201cYes\u201d. By default it won\u2019t. For example\u2026<\/p>\n<pre><code>[readme nofollow=\"Yes\"]WP README Parser[\/readme]\n<\/code><\/pre>\n<p><strong>cache<\/strong><\/p>\n<p>This allows you to specify how long output should be cached for, in minutes. By default caching is set to 60 minutes. For example, to cache for 24 hours\u2026<\/p>\n<pre><code>[readme cache=1440]WP README Parser[\/readme]\n<\/code><\/pre>\n<p><strong>version<\/strong><\/p>\n<p>If you wish to display a specific version of the README, use this parameter to request it. For example\u2026<\/p>\n<pre><code>[readme version=1.0]WP README Parser[\/readme]\n<\/code><\/pre>\n<p><strong>mirror<\/strong><\/p>\n<p>If your plugin is hosted at a number of other locations then you can use this to specify alternative download URLs other than the WordPress repository. Simply seperate multiple URLs with double commas (i.e. ,,). For example\u2026<\/p>\n<pre><code>[readme mirror=\"http:\/\/www.example1.com,,http:\/\/www.example2.com\"]WP README Parser[\/readme]\n<\/code><\/pre>\n<p><strong>links<\/strong><\/p>\n<p>By default download and other links will be added to the bottom of the README output. By specifying a section name via this parameter, however, then the links will appear before that section. For example, to appear before the description you\u2019d put\u2026<\/p>\n<pre><code>[readme links=\"description\"]WP README Parser[\/readme]\n<\/code><\/pre>\n<p><strong>name<\/strong><\/p>\n<p>If you specify a README filename instead a name then it will be assumed that the plugin name at the top of the README is the correct one. This may not be the case, however, if you\u2019ve renamed your plugin (as is the case for this plugin). You can therefore use the <code>name<\/code> parameter to override this.<\/p>\n<pre><code>[readme name=\"WP README Parser\"]https:\/\/plugins.svn.wordpress.org\/wp-readme-parser\/trunk\/readme.txt[\/readme]\n<\/code><\/pre>\n<p><strong>ext<\/strong><\/p>\n<p>The extension that your screenshots are stored as \u2013 i.e. PNG or JPG.<\/p>\n<p><strong>assets<\/strong><\/p>\n<p>Storing your screenshots in your assets folder? Then set this to \u2018yes\u2019 for them to be read from there. For example\u2026<\/p>\n<pre><code>[readme assets=\"yes\"]WP README Parser[\/readme]<h3>Using Content Reveal<\/h3>\n<\/code><\/pre>\n<p>If you also have the plugin <a href=\"https:\/\/wordpress.org\/plugins\/simple-content-reveal\/\" title=\"Content Reveal\" rel=\"ugc\">Content Reveal<\/a> installed, then each section of the README will be collapsable \u2013 that is, you can click on the section heading to hide the section content.<\/p>\n<p>By default, all sections of the output will be revealed.<\/p>\n<p>You may now use 3 further parameters when using the <code>[readme]<\/code> shortcode\u2026<\/p>\n<p><strong>hide<\/strong><\/p>\n<p>Use this parameter to hide sections automatically \u2013 simply click on them to reveal them again.<\/p>\n<p>For example\u2026<\/p>\n<pre><code>[readme hide=\"Changelog\"]WP README Parser[\/readme]\n<\/code><\/pre>\n<p><strong>scr_url<\/strong><\/p>\n<p>If you wish to supply your own hide\/reveal images then you can specify your own folder here.<\/p>\n<p>The two images (one for when the content is hidden, another for when it\u2019s shown) must be named image1 and image2. They can either by GIF or PNG images (see the next parameter).<\/p>\n<p>For example\u2026<\/p>\n<pre><code>[readme scr_url=\"https:\/\/artiss.blog\u201d]WP README Parser[\/readme]\n<\/code><\/pre>\n<p><strong>scr_ext<\/strong><\/p>\n<p>Use this specify whether you wish to use PNG or GIF images for your own hide\/reveal images. If you do not specify it, GIF will be used.<\/p>\n<p>For example\u2026<\/p>\n<pre><code>[readme scr_url=\"https:\/\/artiss.blog\" scr_ext=\"png\"]WP README Parser[\/readme]<h3>Using a Function Call<\/h3>\n<\/code><\/pre>\n<p>If you wish to code a direct PHP call to the plugin, you can do. The function is named <code>readme_parser<\/code> and accepts 2 parameters. The first is an array of all the options, the same as the shortcode. The second parameter is the README name or filename.<\/p>\n<p>For example\u2026<\/p>\n<pre><code>echo readme_parser( array( 'exclude' => 'meta,upgrade notice,screenshots,support,changelog,links,installation,licence', 'ignore' => 'For help with this plugin,,for more information and advanced options ' ), 'YouTube Embed' );\n<\/code><\/pre>\n<p>This may be of particular use to plugin developers as they can then display the README for their plugins within their administration screens.<\/p>\n<h3>Displaying the plugin banner<\/h3>\n<p>Some plugins have banners assigned to them. The shortcode <code>[readme_banner]<\/code> can be used to output them (responsively too). Between the opening and closing shortcode you must specify a plugin name (a URL can\u2019t be used) and that\u2019s it. For example\u2026<\/p>\n<pre><code>[readme_banner]YouTube Embed[\/readme_banner]\n<\/code><\/pre>\n<p>If no banner image exists then nothing will be output.<\/p>\n<h3>Display specific README information<\/h3>\n<p>You may wish to add your own section to the output to provide download links, etc. In which case you can suppress this section and then use an additional shortcode to retrieve the information that you need.<\/p>\n<p>Use the shortcode <code>[readme_info]<\/code> to return one of a number of different pieces of information. Use the required parameter <code>data<\/code> to specify what you need \u2013 this can b\u2026<\/p>\n<ul>\n<li><strong>download<\/strong> \u2013 Display a download link<\/li>\n<li><strong>version<\/strong> \u2013 Output the current version number<\/li>\n<li><strong>forum<\/strong> \u2013 Display a link to the forum<\/li>\n<li><strong>wordpress<\/strong> \u2013 Display a link to the plugin in the WordPress.org repository<\/li>\n<\/ul>\n<p>In the cases of the links you must specify text between the opening and closing shortcodes to link to.<\/p>\n<p>There are 4 additional parameters\u2026<\/p>\n<ul>\n<li><strong>name<\/strong> \u2013 Use this to specify the plugin name. This is a require parameter<\/li>\n<li><strong>target<\/strong> \u2013 If outputting a link this will assign a target to the output (default is _blank)<\/li>\n<li><strong>nofollow<\/strong> \u2013 If <code>Yes<\/code> then this will be a <code>nofollow<\/code> link. By default it won\u2019t be<\/li>\n<li><strong>cache<\/strong> \u2013 By default any output will be cached for 50 minutes so that if you use this shortcode multiple times on a page the data will only be fetched once. Specify a different number (in minutes) to adjust this. Set to <code>No<\/code> to switch off caching entirely<\/li>\n<\/ul>\n<p>An example of usage may be\u2026<\/p>\n<p>`[readme_info name=\u201dYouTube Embed\u201d data=\u201ddownload\u201d]Download YouTube Embed[\/readme_info]\u2019<\/p>\n<h3>Reviews & Mentions<\/h3>\n<p><a href=\"http:\/\/wpcandy.com\/reports\/wp-readme-parser-plugin-converts-plugins-readme-into-blog-ready-xhtml?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+wpcandy+%28WPCandy+-+The+Best+of+WordPress%29\" title=\"WPCandy\" rel=\"nofollow ugc\">WPCandy<\/a> \u2013 WP README Parser Plugin converts Plugin\u2019s readme into blog-ready XHTML<\/p>\n<h3>Acknowledgements<\/h3>\n<p>Plugin README Parser uses <a href=\"http:\/\/michelf.com\/projects\/php-markdown\/extra\/\" title=\"PHP Markdown Extra\" rel=\"nofollow ugc\">PHP Markdown Extra<\/a> by Michel Fortin.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udcd1 Embed README content into posts<\/p>\n","protected":false},"author":65,"featured_media":385262,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Plugin README Parser - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"\ud83d\udcd1 Embed README content into posts"},"footnotes":""},"categories":[1],"tags":[849,1340,12742,9629],"class_list":["post-212332","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-embed","tag-markdown","tag-parser","tag-readme"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/212332","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=212332"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/212332\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/385262"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=212332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=212332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=212332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}