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

Add Markdown transformer #596

Merged
merged 1 commit into from
Jan 31, 2020
Merged

Add Markdown transformer #596

merged 1 commit into from
Jan 31, 2020

Conversation

sebastianbenz
Copy link
Collaborator

This transformer adds out-of-the-box markdown support. This allows
using AMP Optimizer to convert HTML documents created from Markdown
files into valid AMP. A typical conversion flow would be:

README.md => HTML => AMP Optimizer => valid AMP

The only thing this transformer does is converting <img> tags into
either amp-img or amp-anim tags. All other Markdown features are
already supported by AMP. The transformer will try to resolve image
dimensions from the actual files. Images larger than 200px will automatically
get an intrinsic layout. For image detection to work, an optional dependency
probe-image-size needs to be installed via NPM.

This transformer supports the following options:

  • markdown [Boolean]: enables Markdown HTML support. Default is false.
  • imageBasePath: specifies a base path used to resolve an image during build,
    this can be a file system path or URL prefix.

 This transformer adds out-of-the-box markdown support. This allows
 using AMP Optimizer to convert HTML documents created from Markdown
 files into valid AMP. A typical conversion flow would be:

 README.md => HTML => AMP Optimizer => valid AMP

 The only thing this transformer does is converting `<img>` tags into
 either `amp-img` or `amp-anim` tags. All other Markdown features are
 already supported by AMP. The transformer will try to resolve image
 dimensions from the actual files. Images larger than 200px will automatically
 get an intrinsic layout. For image detection to work, an optional dependency
 `probe-image-size` needs to be installed via NPM.

 This transformer supports the following options:

 - `markdown [Boolean]`: enables Markdown HTML support. Default is `false`.
 - `imageBasePath`: specifies a base path used to resolve an image during build,
   this can be a file system path or URL prefix.
Copy link
Member

@andreban andreban left a comment

Choose a reason for hiding this comment

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

LGTM - Excited to try this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants