Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate readme.txt in favor of just README.md #5807

Merged
merged 14 commits into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .dev-lib

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
8 changes: 8 additions & 0 deletions .wordpress-org/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
14 changes: 3 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function( grunt ) {
'assets',
'back-compat',
'includes',
'readme.txt',
'README.md',
'src',
'templates',
'vendor',
Expand Down Expand Up @@ -71,9 +71,6 @@ module.exports = function( grunt ) {
stdout: true,
stderr: true,
},
readme: {
command: './vendor/xwp/wp-dev-lib/scripts/generate-markdown-readme', // Generate the readme.md.
},
verify_matching_versions: {
command: 'php bin/verify-version-consistency.php',
},
Expand All @@ -97,7 +94,7 @@ module.exports = function( grunt ) {
options: {
plugin_slug: 'amp',
build_dir: 'build',
assets_dir: 'wp-assets',
assets_dir: '.wordpress-org',
},
},
},
Expand All @@ -114,10 +111,6 @@ module.exports = function( grunt ) {
'build',
] );

grunt.registerTask( 'readme', [
'shell:readme',
] );

grunt.registerTask( 'build', function() {
const done = this.async();
const spawnQueue = [];
Expand Down Expand Up @@ -169,7 +162,7 @@ module.exports = function( grunt ) {
dest: 'build',
expand: true,
options: {
noProcess: [ '*/**', 'LICENSE' ], // That is, only process amp.php and readme.txt.
noProcess: [ '*/**', 'LICENSE' ], // That is, only process amp.php and README.md.
process( content, srcpath ) {
let matches, version, versionRegex;
if ( /amp\.php$/.test( srcpath ) ) {
Expand All @@ -192,7 +185,6 @@ module.exports = function( grunt ) {
},
},
} );
grunt.task.run( 'readme' );
grunt.task.run( 'copy' );
grunt.task.run( 'shell:composer_install' );

Expand Down
76 changes: 47 additions & 29 deletions readme.txt → README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
=== AMP ===
Contributors: google, xwp, automattic, westonruter, albertomedina, schlessera, swissspidy, pierlo, johnwatkins0, joshuawold, ryankienstra
Tags: amp, mobile, optimization, accelerated mobile pages, framework, components, blocks, performance, ux, seo, official
Requires at least: 4.9
Tested up to: 5.6
Stable tag: 2.0.10
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Requires PHP: 5.6
# AMP

The Official AMP Plugin, supported by the AMP team. Formerly Accelerated Mobile Pages, AMP enables great experiences across both mobile and desktop.
Contributors: google, xwp, automattic, westonruter, albertomedina, schlessera, swissspidy, pierlo, johnwatkins0, joshuawold, ryankienstra
Tags: amp, mobile, optimization, accelerated mobile pages, framework, components, blocks, performance, ux, seo, official
Requires at least: 4.9
Tested up to: 5.6
Stable tag: 2.0.10
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Requires PHP: 5.6

== Description ==
![The Official AMP Plugin for WordPress](.wordpress-org/banner-1544x500.png)

This official plugin from the AMP project enables AMP content publishing with WordPress in a way that is fully and seamlessly integrated with the standard mechanisms of the platform. The key features are the following:
The official AMP Plugin, supported by the AMP team. Formerly Accelerated Mobile Pages, AMP enables great experiences across both mobile and desktop.

[![Build Status](https://github.com/ampproject/amp-wp/workflows/Build,%20test%20&%20measure/badge.svg)](https://github.com/ampproject/amp-wp/actions?query=branch%3Adevelop+workflow%3A%22Build%2C+test+%26+measure%22)
[![Coverage Status](https://img.shields.io/codecov/c/github/ampproject/amp-wp/develop.svg)](https://codecov.io/gh/ampproject/amp-wp)
[![Built with Grunt](https://gruntjs.com/cdn/builtwith.svg)](http://gruntjs.com)

## Description

This official plugin from the AMP project enables AMP content publishing with WordPress in a way that is fully and seamlessly integrated with the standard mechanisms of the platform.

https://www.youtube.com/watch?v=s52JNMT59s8&list=PLXTOW_XMsIDRGRr5QDffrvND8Qh1RndFb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be embeddable on wp.org? GitHub doesn't render it appropriately:

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, see https://make.wordpress.org/core/2010/02/20/plugins-can-now-include-videos-in-their-readme-txt-files/

It previews as expected on https://wpreadme.com/

image

I've added videos like that before in readmes. Actually, wp-dev-lib supports that in transforming readme.txt to readme.md (at least in shortcode form):

https://github.com/xwp/wp-dev-lib/blob/a62ccca94f9995f294e12d500c45856adff81e34/scripts/class-wordpress-readme-parser.php#L97-L99

It's unfortunate that the bare URL in the README.md here would not be rendered on GitHub, but it seems like an acceptable tradeoff.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could could contribute up to the WordPressdotorg\Plugin_Directory\Markdown class the ability to transform something more markdown-friendly into the bare URL that would be the YouTube embed.

For example, let's say that the README.md had this line:

[![Play video on YouTube](https://i1.ytimg.com/vi/s52JNMT59s8/hqdefault.jpg)](https://www.youtube.com/watch?v=s52JNMT59s8&list=PLXTOW_XMsIDRGRr5QDffrvND8Qh1RndFb)

This would be rendered on GitHub as:

Play video on YouTube

But then the Markdown class could transform any such YouTube-linked images to unwrap top the bare URL:

https://www.youtube.com/watch?v=s52JNMT59s8&list=PLXTOW_XMsIDRGRr5QDffrvND8Qh1RndFb

Then on WordPress.org the oEmbed would render, whereas on GitHub there would be a poster image linked to the video on YouTube.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like a great idea!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed a ticket requesting this: https://meta.trac.wordpress.org/ticket/5582


For more videos like this, check out the ongoing [AMP for WordPress video series](https://www.youtube.com/playlist?list=PLXTOW_XMsIDRGRr5QDffrvND8Qh1RndFb).

The key features are the following:

1. **Automate the process of generating AMP-valid markup as much as possible**, letting users follow the standard workflows they are used to in WordPress.
2. **Provide effective validation tools** to help users deal with AMP incompatibilities when they happen, including mechanisms for **identifying**, **contextualizing**, and **resolving issues caused by validation errors**.
Expand All @@ -22,7 +35,7 @@ This official plugin from the AMP project enables AMP content publishing with Wo

The official AMP plugin for WordPress is a powerful tool that helps you build user-first WordPress sites, that is, sites that are fast, beautiful, secure, engaging, and accessible. A user-first site will deliver experiences that delight your users and therefore will increase user engagement and the success of your site. And, contrary to the popular belief of being only for mobile sites (it doesn't stand for Accelerated _Mobile_ Pages anymore!), AMP is a fully responsive web component framework, which means that you can provide AMP experiences for your users on both mobile and desktop devices.

= AMP Plugin Audience: Everyone =
### AMP Plugin Audience: Everyone

This plugin can be used by both developers and non-developer users:

Expand All @@ -31,7 +44,7 @@ This plugin can be used by both developers and non-developer users:

The bottom line is that regardless of your technical expertise, the AMP plugin can be useful to you.

= Template Modes =
### Template Modes

The official AMP plugin enables site owners to serve AMP to their users in different ways, which are referred to as template modes: Standard, Transitional, and Reader. The differences between them are in terms of the number of themes used (one or two), and the number of versions of the site (non-AMP, AMP). Each template mode brings its own value proposition and serves the needs of different scenarios in the large and diverse WordPress ecosystem. And in all cases, the AMP plugin provides as much support as possible in terms of automating the generation of AMP pages, as well as keeping the option chosen AMP valid. In a nutshell, the available template modes are the following:

Expand All @@ -43,49 +56,54 @@ The official AMP plugin enables site owners to serve AMP to their users in diffe

Different modes would be recommended in different scenarios, depending on the specifics of your site and your role. As you configure the plugin, it will suggest the mode that might be best for you based on its assessment of the theme and plugins used on your site. And, independently of the mode used, you have the option of serving all or only a portion of your site as AMP. This gives you all the flexibility you need to get started enabling AMP on your site progressively.

= AMP Ecosystem =
### AMP Ecosystem

It is possible today to assemble great looking user-first sites powered by the AMP plugin by picking and choosing themes and plugins from a growing AMP-compatible ecosystem. In this context, the AMP plugin acts as an orchestrator of the overall AMP content creation and publishing process; it serves as a validator and enforcer making it easier to not only get to AMP experiences, but to maintain them with confidence.

Many popular theme and plugin developers have taken efforts to support the official AMP plugin. If you are using a theme like Astra or Newspack, or if you are using plugins like Yoast or WP Forms — they will work out of the box! You can see the [growing list](https://amp-wp.org/ecosystem/) of tested themes and plugins.

= AMP Development =
### AMP Development

Although there is a growing ecosystem of AMP-compatible WordPress components, there is still a ways to go before majority AMP compatibility in the ecosystem. If you are a developer, or you have the resources to pursue development projects, you may want in some cases to develop custom plugin or theme to serve your specific needs. The official AMP plugin can be of great help to you by providing powerful and effective developer tools that shed light into the AMP development process as it is done in WordPress. This includes mechanisms for detailing the root causes of validation issues, the contextual space to understand them properly, and methods to deal with them during the process of achieving full AMP compatibility. Read more about [Developer Tools](https://amp-wp.org/documentation/getting-started/developer-tools/).

= Getting Started =
### Getting Started

To learn more about the plugin and start leveraging its capabilities to power your AMP publishing workflow, check [the official AMP plugin product site](https://amp-wp.org/).

If you are a developer, we encourage you to [follow along](https://github.com/ampproject/amp-wp) or [contribute](https://github.com/ampproject/amp-wp/blob/develop/contributing.md) to the development of this plugin on GitHub.
If you are a developer, we encourage you to [follow along](https://github.com/ampproject/amp-wp) or [contribute](https://github.com/ampproject/amp-wp/wiki/Contributing) to the development of this plugin on GitHub.

We have put up a comprehensive [FAQ page](https://amp-wp.org/documentation/frequently-asked-questions/) and extensive documentation to help you start as smoothly as possible.

But if you need some help, we are right here to support you in the plugin's [support forum](https://wordpress.org/support/plugin/amp/), as well as through [GitHub issues](https://github.com/ampproject/amp-wp/issues) (for technical bugs and feature requests). And our thriving [AMP Expert ecosystem](https://amp-wp.org/ecosystem/amp-experts/) has indie freelancers to enterprise grade agencies in case you need commercial support!

== Installation ==
## Installation

1. Upload the folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the "Plugins" menu in WordPress.
3. Navigate to AMP > Settings in the WordPress admin to configure the plugin; use the onboarding wizard there for guided setup.

== Frequently Asked Questions ==
## Frequently Asked Questions

Please see the [FAQs on amp-wp.org](https://amp-wp.org/documentation/frequently-asked-questions/). Don't see an answer to your question? Please [search the support forum](https://wordpress.org/support/plugin/amp/) to see if it has already been discussed. Otherwise, please [open a new support topic](https://wordpress.org/support/plugin/amp/#new-post).

== Screenshots ==
## Screenshots

1. New onboarding wizard to help you get started.<br>![New onboarding wizard to help you get started.](.wordpress-org/screenshot-1.png)

2. Built for developers and non-technical content creators alike.<br>![Built for developers and non-technical content creators alike.](.wordpress-org/screenshot-2.png)

3. Theme selection to enhance the Reader mode experience.<br>![Theme selection to enhance the Reader mode experience.](.wordpress-org/screenshot-3.png)

4. Preview how your site looks across desktop and mobile before finalising changes.<br>![Preview how your site looks across desktop and mobile before finalising changes.](.wordpress-org/screenshot-4.png)

5. Customize the design of AMP pages in the Customizer.<br>![Customize the design of AMP pages in the Customizer.](.wordpress-org/screenshot-5.png)

1. New onboarding wizard to help you get started.
2. Built for developers and non-technical content creators alike.
3. Theme selection to enhance the Reader mode experience.
4. Preview how your site looks across desktop and mobile before finalising changes.
5. Customize the design of AMP pages in the Customizer.
6. Reopen the onboarding wizard, change individual options, or manage advanced settings.
6. Reopen the onboarding wizard, change individual options, or manage advanced settings.<br>![Reopen the onboarding wizard, change individual options, or manage advanced settings.](.wordpress-org/screenshot-6.png)

== Changelog ==
## Changelog

For the plugin’s changelog, please see [the Releases page on GitHub](https://github.com/ampproject/amp-wp/releases).

== Upgrade Notice ==
## Upgrade Notice

If you currently use older versions of the plugin in Reader mode, it is strongly encouraged to pick a Reader theme instead of using the legacy Reader templates. You may also want to switch to Standard mode or Transitional mode if you have AMP-compatible theme and plugins.
File renamed without changes.
4 changes: 2 additions & 2 deletions bin/amphtml-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

from within a Linux environment such as VVV.

See the Updating Allowed Tags and Attributes section of the Contributing guide
https://github.com/ampproject/amp-wp/blob/develop/contributing.md#updating-allowed-tags-and-attributes.
See the Updating Allowed Tags and Attributes section of the Engineering Guidelines
https://github.com/ampproject/amp-wp/wiki/Engineering-Guidelines#updating-allowed-tags-and-attributes.

Then have fun sanitizing your AMP posts!
"""
Expand Down
6 changes: 3 additions & 3 deletions bin/verify-version-consistency.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

$versions = [];

$readme_txt = file_get_contents( dirname( __FILE__ ) . '/../readme.txt' );
if ( ! preg_match( '/Stable tag:\s+(?P<version>\S+)/i', $readme_txt, $matches ) ) {
$readme_md = file_get_contents( dirname( __FILE__ ) . '/../README.md' );
if ( ! preg_match( '/Stable tag:\s+(?P<version>\S+)/i', $readme_md, $matches ) ) {
echo "Could not find stable tag in readme\n";
exit( 1 );
}
$versions['readme.txt#stable-tag'] = $matches['version'];
$versions['README.md#stable-tag'] = $matches['version'];

$plugin_file = file_get_contents( dirname( __FILE__ ) . '/../amp.php' );
if ( ! preg_match( '/\*\s*Version:\s*(?P<version>\d+\.\d+(?:.\d+)?(-\w+)?)/', $plugin_file, $matches ) ) {
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
"wp-cli/export-command": "^2.0",
"wp-cli/extension-command": "^2.0",
"wp-cli/wp-cli": "^2.4",
"wp-coding-standards/wpcs": "2.3.0",
"xwp/wp-dev-lib": "1.6.5"
"wp-coding-standards/wpcs": "2.3.0"
},
"suggest": {
"ext-intl": "Enables use of idn_to_utf8() to convert punycode domains to UTF-8 for use with an AMP Cache.",
Expand Down
55 changes: 9 additions & 46 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading